c++ Open frameworks OpenGl drawing special chars like é á ú

1k views Asked by At

I have an array of strings that include characters that are not used in English:

string words[5]={"állat", "köcsög" ,"alúl", "ugrik", "setál"}

I have the Arial fonts from the windows folders loaded in and stored in an ofTrueTypeFront object: I loaded the fonts to make _bFullCharacterSet=true.

ofTrueTypeFont font;
font.loadFont("arial.ttf",24, true, true);

I want to draw them on the canvas like:

for (int i=0;i<words.size();i++){
    font.drawString("Start!",ofGetWidth()/6,ofGetHeight()/8*i);
}

The first characters are draws fine, but as soon as a char that is not included in the English dictionary it draw a question mark and leaves out the rest. I have read about the different codings, but I have not found the solution. How can I fix this?

1

There are 1 answers

1
bakercp On BEST ANSWER

Currently ofTrueTypeFont does not have full support for Unicode characters. Better international support in the openFrameworks core is in the works though. You can find our plans in the openFrameworks 1.0 roadmap see our internationalization plans here http://is.gd/of_i8n and our typographic plans here http://is.gd/of_type.

While you are waiting, the best alternatives for unicode support are probably found in the following addons: