Closed rockswang closed 11 years ago
That's strange. Cyrillic UTF8 characters processed correctly. Could you provide example xml?
Please download it here: https://github.com/rs2013/wp1301/blob/master/upload/stablexui_genCode_.zip?raw=true It's based on demo/ui/main.xml, and ui_index_xml.hx is the saved haxe source. BTW, I have to made some change on UIBuilder.hx to make the function "saveCodeTo" works, it seems in Windows, FileSystem does not treat a slash-ended string as a valid directory path: var endSlash : EReg = ~/(\/|)$/; if( !endSlash.match(dir) ){ //dir += '/'; } if( !FileSystem.exists(dir) || !FileSystem.isDirectory(dir) ){ Err.trigger('Path does not exist or is not a directory: ' + dir); } UIBuilder._generatedCodeDir = dir + '/';
Hi, I've just got some progress on this, it's because the embeded asset font "ui/android/fonts/regular.ttf" does not contains Chinese characters. So, here come two solutions:
Are you compiling to neko target? On neko 1.8.2 cyrillic characters are shown as rectangles too, while targeting cpp works fine.
As for regular.ttf in android demo, i took this font from android web site. It was bundled with android theme psd. I don't know whether NME does any fonts preprocessing for flash target, but i know it does for html5.
Hi, Eventually I found the third solution, it's not perfect but works for my very object.
Yes, you can use conditional compilation in xml. You need to typ # twice:
Hi, I've just tried to put some Chinese characters in a ui xml, e.g. as the button text, however they are not correctly displayed in the final ui (on both flash & windows targets). I then opened "saveCodeTo" and checked generated haxe source and found that the Chinese characters are good there with UTF-8 encoding. So it looks the most suspicious place might be Context.parseInlineString(), it's probably not handling UTF-8 encoded string correctly like the haxe compiler does.