You probably need to save the file as utf8 for it to work. If you go to File > Save as… there should be an option to change the file encoding, chnage it to utf8 and save it with the same name
Hello,i have followed your codes,but i cannot run as you display.My font is “Verdana.ttf”.Is there something wrong with my font? should i have to load “Microsoft YaHei UI”?
yes surely verdana doesn’t have chinese glyphs. you should try a font that has them. google fonts https://fonts.google.com/ for example gives you the option to look for fonts by language
Hello,i have realized it,but it become too slow.Is the speed affect by “settings.addRanges(ofAlphabet::Chinese)”?When i remove this line of code,speed become fast.Could you please tell me some solutions?Thank you.
have you tried to run your application in release mode rather than debug? specially in visual studio that will make a big difference
also if even with that the application is still slow you can try a couple of things:
instead of adding the full chinese alphabet you can try to add specific ranges. For example the chinese alphabet is composed by {ofUnicode::Space, ofUnicode::IdeographicSpace, ofUnicode::CJKLettersAndMonths, ofUnicode::CJKUnified} The two spaces are just one glyph each but the other two specially CJKUnified are pretty big so perhaps you can add only the glyphs you are going to use if you know that before hand by creating your own ranges as:
ofUnicode::range myRange{begin, end};
where begin and end are the first and last (not included) glyphs you want to use. for example CJKUnified is:
ttf.getStringTexture("text") which returns a texture with the text you pass, you can create texts in setup and then reuse them afterwards which should be pretty fast but not as flexible as drawString
hi! arturo, could you please tell me why OF_functions about OfEasyCam cannot work in setup() but it work in draw()? for example, camera.setPosition() . But OfCamera’s functions can work in setup().