[Solved] Displaying special characters with ofTrueTypeFont

#1

Hi, I’m having a bit of a problem with displaying special characters with my fonts usign ofTrueTypeFont.

This is what I want displayed:

fontSemibold.drawString( "aáúőű–", 100, 40 );
fontBold.drawString( "aáúőű–", 100, 80 );
fontItalic.drawString( "aáúőű–", 100, 120 );

What is displayed instead:

And yes, the fonts have those characters in their sets. And yes, the source files are in UTF-8 encoding. I’m using OF v0.10.1.

This is the entire code:

void ofApp::setup()
{
    fontSemibold.load( "semibold.otf", 24, true, true );
    fontBold.load( "bold.otf", 24, true, true );
    fontItalic.load( "italic.otf", 24, true, true );
}

void ofApp::draw()
{
    ofSetColor( 0 );
    ofDrawRectangle( 0, 0, ofGetWidth(), ofGetHeight() );
    
    ofSetColor( 255 );
    fontSemibold.drawString( "aáúőű–", 100, 40 );
    fontBold.drawString( "aáúőű–", 100, 80 );
    fontItalic.drawString( "aáúőű–", 100, 120 );
}
#2

Ranges need to be added as specified here: