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

Method GetGlyphWidth

src/fontcache/spritefontcache.cpp:137–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135}
136
137uint SpriteFontCache::GetGlyphWidth(GlyphID key)
138{
139 SpriteID sprite = static_cast<SpriteID>(key & ~SPRITE_GLYPH);
140 if (sprite == 0) sprite = GetUnicodeGlyph(this->fs, '?');
141 return SpriteExists(sprite) ? GetSprite(sprite, SpriteType::Font)->width + ScaleFontTrad(this->fs != FS_NORMAL ? 1 : 0) : 0;
142}
143
144GlyphID SpriteFontCache::MapCharToGlyph(char32_t key, [[maybe_unused]] bool allow_fallback)
145{

Callers 4

FallbackVisualRunMethod · 0.45
GetGlyphWidthFunction · 0.45
ShapeMethod · 0.45
UniscribeShapeRunFunction · 0.45

Calls 4

GetUnicodeGlyphFunction · 0.85
SpriteExistsFunction · 0.85
GetSpriteFunction · 0.85
ScaleFontTradFunction · 0.85

Tested by

no test coverage detected