Output a full-width symbol by ofTrueTypeFont

Hi, I’m Japanese student.

I am trying to output a full-width symbol by ofTrueTypeFont.

because Added all of Unicode listed in ofTrueTypeFontSetting here.
https://openframeworks.cc/documentation/graphics/ofUnicode/

but etc ‘ー’ can not output. why?

ofTrueTypeFontSettings settings("/Library/Fonts/Songti.ttc", 32);
settings.addRanges(ofAlphabet::Emoji);
settings.addRanges(ofAlphabet::Japanese);
settings.addRanges(ofAlphabet::Chinese);
settings.addRanges(ofAlphabet::Korean);
settings.addRanges(ofAlphabet::Arabic);
settings.addRanges(ofAlphabet::Devanagari);
settings.addRanges(ofAlphabet::Latin);
settings.addRanges(ofAlphabet::Greek);
settings.addRanges(ofAlphabet::Cyrillic);
settings.addRange(ofUnicode::Space);
settings.addRange(ofUnicode::IdeographicSpace);
settings.addRange(ofUnicode::Latin);
settings.addRange(ofUnicode::Latin1Supplement);
settings.addRange(ofUnicode::LatinA);
settings.addRange(ofUnicode::Greek);
settings.addRange(ofUnicode::Cyrillic);
settings.addRange(ofUnicode::Arabic);
settings.addRange(ofUnicode::ArabicSupplement);
settings.addRange(ofUnicode::ArabicExtendedA);
settings.addRange(ofUnicode::Devanagari);
settings.addRange(ofUnicode::HangulJamo);
settings.addRange(ofUnicode::VedicExtensions);
settings.addRange(ofUnicode::LatinExtendedAdditional);
settings.addRange(ofUnicode::GreekExtended);
settings.addRange(ofUnicode::GeneralPunctuation);
settings.addRange(ofUnicode::SuperAndSubScripts);
settings.addRange(ofUnicode::CurrencySymbols);
settings.addRange(ofUnicode::LetterLikeSymbols);
settings.addRange(ofUnicode::NumberForms);
settings.addRange(ofUnicode::Arrows);
settings.addRange(ofUnicode::MathOperators);
settings.addRange(ofUnicode::MiscTechnical);
settings.addRange(ofUnicode::BoxDrawing);
settings.addRange(ofUnicode::BlockElement);
settings.addRange(ofUnicode::GeometricShapes);
settings.addRange(ofUnicode::MiscSymbols);
settings.addRange(ofUnicode::Dingbats);
settings.addRange(ofUnicode::Hiragana);
settings.addRange(ofUnicode::Katakana);
settings.addRange(ofUnicode::HangulCompatJamo);
settings.addRange(ofUnicode::KatakanaPhoneticExtensions);
settings.addRange(ofUnicode::CJKLettersAndMonths);
settings.addRange(ofUnicode::CJKUnified);
settings.addRange(ofUnicode::DevanagariExtended);
settings.addRange(ofUnicode::HangulExtendedA);
settings.addRange(ofUnicode::HangulSyllables);
settings.addRange(ofUnicode::HangulExtendedB);
settings.addRange(ofUnicode::AlphabeticPresentationForms);
settings.addRange(ofUnicode::ArabicPresFormsA);
settings.addRange(ofUnicode::ArabicPresFormsB);
settings.addRange(ofUnicode::KatakanaHalfAndFullwidthForms);
settings.addRange(ofUnicode::KanaSupplement);
settings.addRange(ofUnicode::RumiNumericalSymbols);
settings.addRange(ofUnicode::ArabicMath);
settings.addRange(ofUnicode::MiscSymbolsAndPictographs);
settings.addRange(ofUnicode::Emoticons);
settings.addRange(ofUnicode::TransportAndMap);
settings.addRange(ofUnicode::EnclosedCharacters);
settings.addRange(ofUnicode::Uncategorized);
settings.addRange(ofUnicode::AdditionalEmoticons);
settings.addRange(ofUnicode::AdditionalTransportAndMap);

font.load(settings);

ofSetColor(255, 255, 0);
font.drawString(u8"ー〜", 50, 200);

it’s source

Adding all ranges probably won’t work cause there won’t be enough space to add them all in a texture. You need to pick only the alphabet you want to use and sometimes even specific characters or ranges if an alphabet is too big.

Do you know the code for that glyph? If you do you can check the ranges for each alphabet to see in which alphabet it’s included: https://github.com/openframeworks/openFrameworks/blob/master/libs/openFrameworks/graphics/ofTrueTypeFont.cpp#L23-L75

If it’s not in any of those let me know and i’ll include it as an extra range for next release but by now you can add it by calling:

settings.addRange(ofUnicode::range{glyphCode, glyphCode+1));