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

Function GetUnicodeGlyph

src/fontcache/spritefontcache.cpp:43–48  ·  view source on GitHub ↗

* Get SpriteID associated with a character. * @param key Character to find. * @return SpriteID for character, or 0 if not present. */

Source from the content-addressed store, hash-verified

41 * @return SpriteID for character, or 0 if not present.
42 */
43static SpriteID GetUnicodeGlyph(FontSize fs, char32_t key)
44{
45 auto found = _char_maps[fs].find(key);
46 if (found != std::end(_char_maps[fs])) return found->second;
47 return 0;
48}
49
50/**
51 * Set the SpriteID for a unicode character.

Callers 3

GetGlyphMethod · 0.85
GetGlyphWidthMethod · 0.85
MapCharToGlyphMethod · 0.85

Calls 2

endFunction · 0.50
findMethod · 0.45

Tested by

no test coverage detected