MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / MapCharToGlyph

Method MapCharToGlyph

src/fontcache/freetypefontcache.cpp:197–208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

195
196
197GlyphID FreeTypeFontCache::MapCharToGlyph(char32_t key, bool allow_fallback)
198{
199 assert(IsPrintable(key));
200
201 FT_UInt glyph = FT_Get_Char_Index(this->face, key);
202
203 if (glyph == 0 && allow_fallback && key >= SCC_SPRITE_START && key <= SCC_SPRITE_END) {
204 return this->parent->MapCharToGlyph(key);
205 }
206
207 return glyph;
208}
209
210FT_Library _ft_library = nullptr;
211

Callers

nothing calls this directly

Calls 1

IsPrintableFunction · 0.85

Tested by

no test coverage detected