How to display Unicode string in with Lua in Cocos Code Ide -
i'm using cocos code ide create simple project lua. main.lua saved in utf-8 without bom , contains following snippet:
local label1 = cc.label:createwithttf("長い","fonts/marker felt.ttf",32); local label2 = cc.label:createwithttf("long","fonts/marker felt.ttf",32); local label3 = cc.label:createwithttf("rất dài","fonts/marker felt.ttf",32);
label1 japanese string rendered correctly, label2 ansi string. however, label3 wasn't rendered correctly. in fact, rendered "rt dài".
i had tried use other unicode fonts has character. still, couldn't character rendered correctly. have done wrong?
i have same issue, , have solved. figure out that, font file marker felt.tff include in cocos project not unicode version. after while, have found unicode version of marker felt font in mac pc in: system/library/fonts/markerfelt.ttc
Comments
Post a Comment