From dce76468821c5bfce1e99ee1d2889b6b79118a9f Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 19 Nov 2019 18:23:58 +0100 Subject: [PATCH] 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. --- Libraries/LibHTML/CSS/StyleProperties.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Libraries/LibHTML/CSS/StyleProperties.cpp b/Libraries/LibHTML/CSS/StyleProperties.cpp index 512bce4bbc..d179ce9718 100644 --- a/Libraries/LibHTML/CSS/StyleProperties.cpp +++ b/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; }