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

Function LoadStringWidthTable

src/gfx.cpp:1256–1265  ·  view source on GitHub ↗

* Initialize _stringwidth_table cache for the specified font sizes. * @param fontsizes Font sizes to initialise. */

Source from the content-addressed store, hash-verified

1254 * @param fontsizes Font sizes to initialise.
1255 */
1256void LoadStringWidthTable(FontSizes fontsizes)
1257{
1258 FontCache::ClearFontCaches(fontsizes);
1259
1260 for (FontSize fs : fontsizes) {
1261 for (uint i = 0; i != 224; i++) {
1262 _stringwidth_table[fs][i] = GetGlyphWidth(fs, i + 32);
1263 }
1264 }
1265}
1266
1267/**
1268 * Return width of character glyph.

Callers 6

AdjustGUIZoomFunction · 0.85
SetFontFunction · 0.85
CheckForMissingGlyphsFunction · 0.85
GenerateWorldFunction · 0.85
AfterLoadGameFunction · 0.85
ReloadNewGRFDataFunction · 0.85

Calls 1

GetGlyphWidthFunction · 0.85

Tested by

no test coverage detected