Переглянути джерело

LibHTML: Failed font lookups should use a bold fallback when fitting

If we fail to find the font specified by a page, but we do have some
font-weight information, use a bold fallback font for bold weights.
Andreas Kling 5 роки тому
батько
коміт
dce7646882
1 змінених файлів з 5 додано та 1 видалено
  1. 5 1
      Libraries/LibHTML/CSS/StyleProperties.cpp

+ 5 - 1
Libraries/LibHTML/CSS/StyleProperties.cpp

@@ -89,7 +89,11 @@ void StyleProperties::load_font() const
 
     if (file_name.is_null()) {
         dbg() << "Failed to find a font for family " << font_family << " weight " << font_weight;
-        m_font = Font::default_font();
+
+        if (font_weight == "bold")
+            m_font = Font::default_bold_font();
+        else
+            m_font = Font::default_font();
         return;
     }