~alcinnz/fontconfig-pure

b712c914c9bdf482e3178d5983bbe36d89e30cdf — Adrian Cochrane 2 years ago 1c28add
Parse font-feature-settings for @font-face rules.
1 files changed, 6 insertions(+), 0 deletions(-)

M Graphics/Text/Font/Choose/FontSet.hs
M Graphics/Text/Font/Choose/FontSet.hs => Graphics/Text/Font/Choose/FontSet.hs +6 -0
@@ 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 [] = []