diff options
author | Andreas Kling <kling@serenityos.org> | 2022-02-25 13:40:26 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-02-25 19:38:31 +0100 |
commit | a5c2ab69ecac082357a47d15acb64ae7d13d4d6e (patch) | |
tree | eb5743bbc1036049a20ebe9562e2fcedaae59e24 /Userland | |
parent | 4dd9e2df7846ab3a5656b78665d3806c31985653 (diff) | |
download | serenity-a5c2ab69ecac082357a47d15acb64ae7d13d4d6e.zip |
LibWeb: Look for nearest available size when using bitmap fonts
Use the new Gfx::Font::AllowInexactSizeMatch parameter when doing CSS
font lookups. This fixes a long-standing issue where text with e.g text
with "font-size:12px" would be larger than "font-size:13px" since there
was an exact match for 12, but none for 13 (so we'd fall back to 10).
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/StyleComputer.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp index 7e0a490f8f..8ef6a74ae8 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp @@ -841,7 +841,7 @@ void StyleComputer::compute_font(StyleProperties& style, DOM::Element const* ele if (auto found_font = FontCache::the().get(font_selector)) return found_font; - if (auto found_font = Gfx::FontDatabase::the().get(family, size, weight, slope)) + if (auto found_font = Gfx::FontDatabase::the().get(family, size, weight, slope, Gfx::Font::AllowInexactSizeMatch::Yes)) return found_font; return {}; |