LibWeb: Add unscaled fallback font in case Font::with_size() failed

This commit is contained in:
Aliaksandr Kalenik 2023-12-13 18:41:37 +01:00 committed by Andreas Kling
commit 51ecfdf71f
Notes: sideshowbarker 2024-07-16 23:59:28 +09:00

View file

@ -1894,6 +1894,8 @@ RefPtr<Gfx::FontCascadeList const> StyleComputer::compute_font_for_style_values(
auto found_font = StyleProperties::font_fallback(monospace, bold);
if (auto scaled_fallback_font = found_font->with_size(font_size_in_pt)) {
font_list->add(*scaled_fallback_font);
} else {
font_list->add(*found_font);
}
return font_list;