From b712c914c9bdf482e3178d5983bbe36d89e30cdf Mon Sep 17 00:00:00 2001 From: Adrian Cochrane Date: Fri, 2 Dec 2022 13:05:40 +1300 Subject: [PATCH] Parse font-feature-settings for @font-face rules. --- Graphics/Text/Font/Choose/FontSet.hs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Graphics/Text/Font/Choose/FontSet.hs b/Graphics/Text/Font/Choose/FontSet.hs index c5d41ef..582b0c3 100644 --- a/Graphics/Text/Font/Choose/FontSet.hs +++ b/Graphics/Text/Font/Choose/FontSet.hs @@ -16,6 +16,7 @@ import Stylist.Parse (StyleSheet(..), parseProperties) import Data.CSS.Syntax.Tokens (Token(..)) import Data.Text (unpack, Text) import Graphics.Text.Font.Choose.Range (iRange) +import Data.List (intercalate) type FontSet = [Pattern] @@ -87,6 +88,11 @@ properties2font (("font-weight", [start, end]):props) | Just x <- parseFontStretch start, Just y <- parseFontStretch end = setValue "weight" Strong (x `iRange` y) $ properties2font props +properties2font (("font-feature-settings", toks):props) + | (features, True, []) <- parseFontFeatures toks = + setValue "fontfeatures" Strong (intercalate "," $ map fst features) $ + properties2font props + properties2font (_:props) = properties2font props properties2font [] = [] -- 2.30.2