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

Function GetFontCacheFontName

src/fontcache.cpp:211–217  ·  view source on GitHub ↗

* Get font to use for a given font size. * @param fs Font size. * @return If configured, the font name to use, or the path of the default TrueType font if sprites are not preferred. */

Source from the content-addressed store, hash-verified

209 * @return If configured, the font name to use, or the path of the default TrueType font if sprites are not preferred.
210 */
211std::string GetFontCacheFontName(FontSize fs)
212{
213 const FontCacheSubSetting *settings = GetFontCacheSubSetting(fs);
214 if (!settings->font.empty()) return settings->font;
215 if (_fcsettings.prefer_sprite) return {};
216 return GetDefaultTruetypeFontFile(fs);
217}
218
219/**
220 * Register a FontCache for its font size.

Callers 3

LoadFontMethod · 0.85
LoadFontMethod · 0.85
LoadFontMethod · 0.85

Calls 3

GetFontCacheSubSettingFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected