- The text editor in Gideros Studio works with utf-8 encoding by default. - TextField display object correctly displays utf-8 strings. - URLLoader correctly handles utf-8 strings.
You need to create a bitmap font that contains your Chinese characters. I couldn't download your font but I created a bitmap font (which includes ascii characters + 我 + 们) from simhei.ttf and be able to display Chinese.
hi,atilim thanks a lot I wonder how to produce the simhei.txt and simhei.png, exported from font creator?? what's the ttf file you imported to font creator
Then I copied simhei.ttf to desktop and opened it within Gideros Font Creator. I added extra chars (我, 们) and exported simhei.png and simhei.txt. Here is a screenshot:
@alexzheng - I was going over the forum and seen your localization question again and wanted to clarify things a bit - by localization, did you mean "using different language strings within the same application" ?
@alexzheng localization support is implemented! :-) Thanks!
Hi,@gorkem ,any code snippet for using the official localization implementation?
for my current simple job,I can just define different languages and choose the right one according to the result of application:getLocale or application:getLanguage.
local text ={
en ={
EAZY ="EAZY",
INTERMEDIATE ="INTERMEDIATE",
HARD ="HARD",
CANCEL ="CANCEL",
},
zh ={
EAZY ="初级",
INTERMEDIATE ="中级",
HARD ="高级",
CANCEL ="取消",
}}
Well this method is ok when you know what text you have, but what if the text is for example news, and I want to display it for reading>? Would I just load the TTF file the same as other TTF files?
REAL programmers type copy con filename.exe ---------------------------------------
Well this method is ok when you know what text you have, but what if the text is for example news, and I want to display it for reading>? Would I just load the TTF file the same as other TTF files?
you can use this code to load the TTF file directly ! local font = TTFont.new('STCAIYUN.ttf', 15)
Comments
- The text editor in Gideros Studio works with utf-8 encoding by default.
- TextField display object correctly displays utf-8 strings.
- URLLoader correctly handles utf-8 strings.
could you please show me some sample code for how to make a TextField to show chinese ,I use following code from the samples
local font1 = Font.new("BILLO___.txt", "BILLO___.png")
local scoreLabel = TextField.new(font1,"我们: abc")
and add the scoreLabel to stage
It only show abc
this is because the font1 does not contain any chinese character
I use a ttf file downloaded from
http://www.sj00.com/download.php?a_k=XQ8DUAcDBEVRX1kQREJeGE1cXBMLTEZbUwcfUglaDFsFHXYqYB13DFkWQktTWg1ZB0tWSyIgfh4LVl9IDxhQClhXHdyJ4Paz592d2MIcHl4SHldZVURGDEVDDABVBg9WAAULVgIUWBMKUwNVHgZVGVMKC0pdUhNcXgc=
and export two files using the font creator ,howerver it still does not work
https://sites.google.com/site/xraystudiogame
You need to create a bitmap font that contains your Chinese characters. I couldn't download your font but I created a bitmap font (which includes ascii characters + 我 + 们) from simhei.ttf and be able to display Chinese.
You can download the example here: http://dl.dropbox.com/u/684866/for alexzheng.zip
thanks a lot
I wonder how to produce the simhei.txt and simhei.png, exported from font creator??
what's the ttf file you imported to font creator
https://sites.google.com/site/xraystudiogame
I'm using Windows XP. When I install East Asian language files (as described here: http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/int_pr_install_languages.mspx) simhei.ttf is installed to my fonts folder.
Then I copied simhei.ttf to desktop and opened it within Gideros Font Creator. I added extra chars (我, 们) and exported simhei.png and simhei.txt. Here is a screenshot:
I got it
btw, do you have any plan to support localization
https://sites.google.com/site/xraystudiogame
http://giderosmobile.com/DevCenter/index.php/Product_Roadmap
https://sites.google.com/site/xraystudiogame
for my current simple job,I can just define different languages and choose the right one according to the result of application:getLocale or application:getLanguage.
https://sites.google.com/site/xraystudiogame
Check this one out:
http://appcodingeasy.com/Gideros-Mobile/Localization-in-Gideros
https://sites.google.com/site/xraystudiogame
---------------------------------------
local font = TTFont.new('STCAIYUN.ttf', 15)