Extended character sets and multiple ways of loading fonts

I have a very basic question about loading fonts. I would like to load in some text with chinese characters. One way to do this is with

ofTrueTypeFontSettings settings("/path/to/font",72);
settings.addRanges(ofAlphabet::Chinese);
font.load(settings);

This lets me render chinese text. However, I also need to load the contours for the font, via makeContours. I can do this with

font.load("/path/to/font",72,false,true,true);

where the last “true” specifies that the font contours will be made. However, when I do the latter, I am unable to render chinese characters! How should I load the font so as to both get the extended character set and make the font contours?

Hi, you can do that with the ofTrueTypeFontSettings. It is a really simple struct as you can see here
So you can simply do,

ofTrueTypeFontSettings settings("/path/to/font",72);
settings.addRanges(ofAlphabet::Chinese);
settings.contours = true;
font.load(settings);
1 Like