~jaro/balkon

9a50eaaafe1332a75bd40ec463a599b3c7fae67c — Jaro 1 year, 9 months ago a4ff739
Clarify spanLanguage and add basic ICU conversion.
M src/Data/Text/ParagraphLayout/Internal/Plain.hs => src/Data/Text/ParagraphLayout/Internal/Plain.hs +3 -2
@@ 263,6 263,7 @@ runBreaksFromSpan run spanBreaks =
isEndSpace :: Char -> Bool
isEndSpace c = c `elem` [' ', '\t', '\x1680']

-- TODO: Identify and correct for differences between the two.
-- TODO: Convert from IETF BCP 47 language tag to ICU locale identifier,
--       possibly with an algorithm to find the best matching available locale.
localeFromLanguage :: String -> LocaleName
localeFromLanguage x = Locale x
localeFromLanguage x = Locale $ map (\c -> if c == '-' then '_' else c) x

M src/Data/Text/ParagraphLayout/Internal/Span.hs => src/Data/Text/ParagraphLayout/Internal/Span.hs +3 -1
@@ 30,7 30,9 @@ data Span = Span
data SpanOptions = SpanOptions

    { spanLanguage :: String
    -- ^ Used for selecting the appropriate glyphs and line breaking rules.
    -- ^ IETF BCP 47 language tag, such as the value expected to be found in
    -- the HTML @lang@ attribute.
    -- Used for selecting the appropriate glyphs and line breaking rules.

    }
    deriving (Eq, Read, Show)