فهرست منبع

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).
Andreas Kling 3 سال پیش
والد
کامیت
a5c2ab69ec
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      Userland/Libraries/LibWeb/CSS/StyleComputer.cpp

+ 1 - 1
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))
         if (auto found_font = FontCache::the().get(font_selector))
             return found_font;
             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 found_font;
 
 
         return {};
         return {};