From f32f82d27b425b0f0347b599d9cc72913e56fbb1 Mon Sep 17 00:00:00 2001 From: Adrian Cochrane Date: Tue, 20 Dec 2022 11:47:19 +1300 Subject: [PATCH] Document FcCharSet language bindings. --- Graphics/Text/Font/Choose/CharSet.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Graphics/Text/Font/Choose/CharSet.hs b/Graphics/Text/Font/Choose/CharSet.hs index 2af63e3..ddc84f3 100644 --- a/Graphics/Text/Font/Choose/CharSet.hs +++ b/Graphics/Text/Font/Choose/CharSet.hs @@ -13,6 +13,7 @@ import GHC.Base (unsafeChr) import Data.Char (ord, isHexDigit) import Numeric (readHex) +-- | An FcCharSet is a set of Unicode chars. type CharSet = Set Char parseChar :: String -> Char @@ -21,6 +22,7 @@ replaceWild ch ('?':rest) = ch:replaceWild ch rest replaceWild ch (c:cs) = c:replaceWild ch cs replaceWild _ "" = "" parseWild ch str = parseChar $ replaceWild ch str +-- | Utility for parsing "unicode-range" @font-face property. parseCharSet ('U':rest) = parseCharSet ('u':rest) -- lowercase initial "u" parseCharSet ('u':'+':cs) | (start@(_:_), '-':ends) <- span isHexDigit cs, -- 2.30.2