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

Method GetGlyphWidth

src/fontcache/truetypefontcache.cpp:65–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65uint TrueTypeFontCache::GetGlyphWidth(GlyphID key)
66{
67 if ((key & SPRITE_GLYPH) != 0) return this->parent->GetGlyphWidth(key);
68
69 GlyphEntry *glyph = this->GetGlyphPtr(key);
70 if (glyph == nullptr || glyph->data == nullptr) {
71 this->GetGlyph(key);
72 glyph = this->GetGlyphPtr(key);
73 }
74
75 return glyph->width;
76}
77
78const Sprite *TrueTypeFontCache::GetGlyph(GlyphID key)
79{

Callers

nothing calls this directly

Calls 2

GetGlyphPtrMethod · 0.95
GetGlyphMethod · 0.95

Tested by

no test coverage detected