From 073b66e243ec1ffa8f1627756a9bb8dcc533e677 Mon Sep 17 00:00:00 2001 From: Jaro Date: Fri, 19 May 2023 13:48:09 +0200 Subject: [PATCH] Move ScriptCode to appropriate module. --- src/Data/Text/ParagraphLayout/Internal/Run.hs | 4 +--- src/Data/Text/ParagraphLayout/Internal/Script.hs | 8 +++++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Data/Text/ParagraphLayout/Internal/Run.hs b/src/Data/Text/ParagraphLayout/Internal/Run.hs index aeeedce..e048c91 100644 --- a/src/Data/Text/ParagraphLayout/Internal/Run.hs +++ b/src/Data/Text/ParagraphLayout/Internal/Run.hs @@ -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. diff --git a/src/Data/Text/ParagraphLayout/Internal/Script.hs b/src/Data/Text/ParagraphLayout/Internal/Script.hs index 2b6ea4b..0ddb18b 100644 --- a/src/Data/Text/ParagraphLayout/Internal/Script.hs +++ b/src/Data/Text/ParagraphLayout/Internal/Script.hs @@ -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" -- 2.30.2