From 82ddc813d52b8314f63c583a90953ae5ac607ffd Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 24 May 2023 19:59:49 +0200 Subject: [PATCH] LibWeb: Stop aggressively quantizing font-weight values Before this change, we were quantizing to either 400, 700 or 900. This caused us to treat 100/200/300 weighted fonts as if they were interchangeable. --- Userland/Libraries/LibWeb/CSS/StyleValue.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Userland/Libraries/LibWeb/CSS/StyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValue.cpp index 85122b3393..276effe1c3 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValue.cpp @@ -389,12 +389,7 @@ int StyleValue::to_font_weight() const } } if (has_integer()) { - int font_weight_integer = to_integer(); - if (font_weight_integer <= Gfx::FontWeight::Regular) - return Gfx::FontWeight::Regular; - if (font_weight_integer <= Gfx::FontWeight::Bold) - return Gfx::FontWeight::Bold; - return Gfx::FontWeight::Black; + return to_integer(); } if (is_calculated()) { auto maybe_weight = const_cast(as_calculated()).resolve_integer();