From 55b1018f43f6e8e8f3be0ed947796449d766e418 Mon Sep 17 00:00:00 2001 From: Adrian Cochrane Date: Thu, 1 Jun 2023 16:10:09 +1200 Subject: [PATCH] Fix fontsize handling. --- Graphics/Layout/CSS/Font.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Graphics/Layout/CSS/Font.hs b/Graphics/Layout/CSS/Font.hs index 7a4db40..7c6ac5b 100644 --- a/Graphics/Layout/CSS/Font.hs +++ b/Graphics/Layout/CSS/Font.hs @@ -63,7 +63,7 @@ pattern2font pat styles parent root = Font' { height' (Just x) = fromIntegral $ HB.height x height' Nothing = fontSize' lineheight' | snd (cssLineheight styles) == "normal", - Just extents <- fontHExtents font' = (fromIntegral $ lineGap extents)/scale' + Just extents <- fontHExtents font' = (fromIntegral $ lineGap extents)/hbUnit | otherwise = lowerLength' (cssLineheight styles) parent fontSize' = lowerLength' (cssFontSize styles) parent lowerLength' a = lowerLength (fontSize parent) . finalizeLength a @@ -75,7 +75,7 @@ pattern2font pat styles parent root = Font' { Just (font:_, _) -> fontRenderPrepare' q font _ -> error "TODO: Set fallback font!" font' = pattern2hbfont font (round scale') $ variations' fontSize' styles - scale' = hbUnit -- Better way of handling this? + scale' = fontSize' * hbUnit -- | Parsed CSS font properties, excluding the FontConfig query. data CSSFont = CSSFont { -- 2.30.2