~jaro/balkon

073b66e243ec1ffa8f1627756a9bb8dcc533e677 — Jaro 1 year, 4 months ago 04fdd17
Move ScriptCode to appropriate module.
M src/Data/Text/ParagraphLayout/Internal/Run.hs => src/Data/Text/ParagraphLayout/Internal/Run.hs +1 -3
@@ 1,4 1,4 @@
module Data.Text.ParagraphLayout.Internal.Run (Run (..), ScriptCode, spanToRuns)
module Data.Text.ParagraphLayout.Internal.Run (Run (..), spanToRuns)
where

import Data.List (mapAccumL)


@@ 14,8 14,6 @@ import Data.Text.ParagraphLayout.Internal.Script
import Data.Text.ParagraphLayout.Internal.TextContainer
import Data.Text.ParagraphLayout.Internal.Zipper

type ScriptCode = String

-- | Each span can be broken into one or more runs by Balkón.
--
-- Each run could have a different script, language, or direction.

M src/Data/Text/ParagraphLayout/Internal/Script.hs => src/Data/Text/ParagraphLayout/Internal/Script.hs +5 -3
@@ 1,4 1,4 @@
module Data.Text.ParagraphLayout.Internal.Script (charScript)
module Data.Text.ParagraphLayout.Internal.Script (ScriptCode, charScript)
where

-- TODO: Use a direct interface to the ICU library, if possible.


@@ 6,12 6,14 @@ where
-- hardcoded ranges, which may get out of sync with ICU.
import Unicode.Char.General.Scripts

type ScriptCode = String

-- | A short script code for the given character, as expected by HarfBuzz.
charScript :: Char -> String
charScript :: Char -> ScriptCode
charScript = code . script

-- Hardcoded shortenings of script codes as of Unicode 15.0.0.
code :: Script -> String
code :: Script -> ScriptCode
code Adlam = "Adlm"
code Ahom = "Ahom"
code AnatolianHieroglyphs = "Hluw"