MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / FontSpriteGetCodepointOffset

Function FontSpriteGetCodepointOffset

src/openrct2/drawing/Font.cpp:286–301  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

284}
285
286int32_t FontSpriteGetCodepointOffset(int32_t codepoint)
287{
288 // Only search the table when its in range of the map.
289 if (static_cast<char32_t>(codepoint) >= _smallestCodepointValue
290 && static_cast<char32_t>(codepoint) <= _biggestCodepointValue)
291 {
292 auto result = codepointOffsetMap.find(codepoint);
293 if (result != codepointOffsetMap.end())
294 return result->second;
295 }
296
297 if (codepoint < 32 || codepoint >= 256)
298 codepoint = '?';
299
300 return codepoint - 32;
301}
302
303int32_t FontSpriteGetCodepointWidth(FontStyle fontStyle, int32_t codepoint)
304{

Callers 3

Calls 2

findMethod · 0.80
endMethod · 0.65

Tested by

no test coverage detected