Defold not supporting turkish character

must writing aşçı in boxes.
And i use arimo bold font but this is font support turkish characters “ş,ç”

arimo.zip (947.7 KB)

This is font file

You must either check the All Characters checkbox in your font or write all characters outside the standard ascii range in the Extra Characters field of the font.

1 Like

already selected

Turkish Character.zip (585.8 KB)

3 Likes

but i am import text from json file

sorular.zip (346 Bytes)

function kurulum(seviye)
		yazilacak_string = ""
		local data = sys.load_resource("/db/sorular.json")
		local layout_table = json.decode(data)
		local kelime = layout_table["Level_Dortlu"][seviye]["dizilis"]
		soru = layout_table["Level_Dortlu"][seviye]["soru"]
		konu = layout_table["Level_Dortlu"][seviye]["konu"]
		local sayi = string.len(kelime)
		label.set_text("/four_boxes/go#konu_label", konu)
		go.animate("/four_boxes/go", "position.x", go.PLAYBACK_ONCE_BACKWARD, 3, go.EASING_INEXPO, 1)	go.animate("/four_boxes/go", "position.x", go.PLAYBACK_ONCE_BACKWARD, 3, go.EASING_INEXPO, 1)
		for i=1,4 do
			label.set_text("/four_boxes/harfler".. i .. "#label",string.sub(kelime, i, i))
			table.insert(harf_table, i,string.sub(kelime, i, i))
		end
		go.animate("/four_boxes/harfler1", "position.y", go.PLAYBACK_ONCE_BACKWARD, 6, go.EASING_INCUBIC, 1)
		go.animate("/four_boxes/harfler2", "position.y", go.PLAYBACK_ONCE_BACKWARD, 6, go.EASING_INCUBIC, 1)
		go.animate("/four_boxes/harfler3", "position.y", go.PLAYBACK_ONCE_BACKWARD, 6, go.EASING_INCUBIC, 1)
		go.animate("/four_boxes/harfler4", "position.y", go.PLAYBACK_ONCE_BACKWARD, 6, go.EASING_INCUBIC, 1,0,anim_bitti)
		go.set(".", "scale", vmath.vector3(0.13, 0.13, 0))

	end


if i select 4 letters, half writed in label

I think table.insert function has a bug.

No, it is not a table bug. Lua 5.1 + string.sub doesn’t support utf8.
You can do it like this: unicode - Extract the first letter of a UTF-8 string with Lua - Stack Overflow

harf_tablo= {}
kelime = "aşçı-öÖçÇşŞiİğĞüÜıI"

for karakter in kelime:gmatch("[%z\1-\127\194-\244][\128-\191]*") do
  table.insert(harf_tablo, karakter)
end
pprint(harf_tablo)

It should return:

{ 
  1 = "a",
  2 = "ş",
  3 = "ç",
  4 = "ı",
  5 = "-",
  6 = "ö",
  7 = "Ö",
  8 = "ç",
  9 = "Ç",
  10 = "ş",
  11 = "Ş",
  12 = "i",
  13 = "İ",
  14 = "ğ",
  15 = "Ğ",
  16 = "ü",
  17 = "Ü",
  18 = "ı",
  19 = "I"
}
5 Likes