Change: Support side-by-side fallback FontCaches instead of hierarchical. (#13303)

The text layouter system can now support using different fonts for different glyphs, including mixing scalable and sprite glyphs.
This commit is contained in:
Peter Nelson
2025-12-06 10:47:12 +00:00
committed by dP
parent a616855649
commit 5be16a658a
32 changed files with 784 additions and 481 deletions

View File

@@ -303,10 +303,16 @@ void SurveyConfiguration(nlohmann::json &survey)
*/
void SurveyFont(nlohmann::json &survey)
{
survey["small"] = FontCache::Get(FS_SMALL)->GetFontName();
survey["medium"] = FontCache::Get(FS_NORMAL)->GetFontName();
survey["large"] = FontCache::Get(FS_LARGE)->GetFontName();
survey["mono"] = FontCache::Get(FS_MONO)->GetFontName();
for (FontSize fs = FS_BEGIN; fs < FS_END; fs++) {
const FontCacheSubSetting *setting = GetFontCacheSubSetting(fs);
auto &font = survey[std::string(FontSizeToName(fs))];
font["configured"]["font"] = setting->font;
font["configured"]["size"] = setting->size;
}
for (const auto &fc : FontCache::Get()) {
auto &font = survey[std::string(FontSizeToName(fc->GetSize()))];
font["active"].push_back(fc->GetFontName());
}
}
/**