Browse Source

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

Aliaksandr Kalenik 1 year ago
parent
commit
51ecfdf71f
1 changed files with 2 additions and 0 deletions
  1. 2 0
      Userland/Libraries/LibWeb/CSS/StyleComputer.cpp

+ 2 - 0
Userland/Libraries/LibWeb/CSS/StyleComputer.cpp

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