mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-10 08:17:05 +00:00
See also: #10836
This commit is contained in:
parent
1d902a97ce
commit
a6b625eea3
@ -183,10 +183,10 @@ void CrashLog::LogConfiguration(std::back_insert_iterator<std::string> &output_i
|
||||
" Medium: {}\n"
|
||||
" Large: {}\n"
|
||||
" Mono: {}\n\n",
|
||||
FontCache::Get(FS_SMALL)->GetFontName(),
|
||||
FontCache::Get(FS_NORMAL)->GetFontName(),
|
||||
FontCache::Get(FS_LARGE)->GetFontName(),
|
||||
FontCache::Get(FS_MONO)->GetFontName()
|
||||
FontCache::GetName(FS_SMALL),
|
||||
FontCache::GetName(FS_NORMAL),
|
||||
FontCache::GetName(FS_LARGE),
|
||||
FontCache::GetName(FS_MONO)
|
||||
);
|
||||
|
||||
fmt::format_to(output_iterator, "AI Configuration (local: {}) (current: {}):\n", _local_company, _current_company);
|
||||
|
@ -53,6 +53,21 @@ int FontCache::GetDefaultFontHeight(FontSize fs)
|
||||
return _default_font_height[fs];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the font name of a given font size.
|
||||
* @param fs The font size to look up.
|
||||
* @return The font name.
|
||||
*/
|
||||
std::string FontCache::GetName(FontSize fs)
|
||||
{
|
||||
FontCache *fc = FontCache::Get(fs);
|
||||
if (fc != nullptr) {
|
||||
return fc->GetFontName();
|
||||
} else {
|
||||
return "[NULL]";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get height of a character for a given font size.
|
||||
|
@ -147,6 +147,8 @@ public:
|
||||
return FontCache::caches[fs];
|
||||
}
|
||||
|
||||
static std::string GetName(FontSize fs);
|
||||
|
||||
/**
|
||||
* Check whether the font cache has a parent.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user