From 0d72266e5d47c25e293c8eda1478e4be140f68ef Mon Sep 17 00:00:00 2001 From: Rhiannon Morris Date: Fri, 30 Apr 2021 13:46:47 +0200 Subject: [PATCH 01/13] add qR and qA --- laantas-script/Svg.hs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/laantas-script/Svg.hs b/laantas-script/Svg.hs index 6f53a8c..743e050 100644 --- a/laantas-script/Svg.hs +++ b/laantas-script/Svg.hs @@ -9,7 +9,7 @@ where import Control.Monad.Reader import Control.Monad.State import qualified Graphics.Svg as Base -import Graphics.Svg hiding (mA, mR, lA, lR, cA, cR, sA, sR, aA, aR) +import Graphics.Svg hiding (mA, mR, lA, lR, cA, cR, sA, sR, aA, aR, qA, qR) import Data.Text (Text, pack) @@ -66,6 +66,18 @@ cR (x1, y1) (x2, y2) (x3, y3) = (x3 * size) (y3 * size) <> " " -- lmao +qA :: Point -> Point -> M Text +qA (x1, y1) (x2, y2) = + reader \E {size} -> + Base.qA (x1 * size) (y1 * size) + (x2 * size) (y2 * size) + +qR :: Point -> Point -> M Text +qR (x1, y1) (x2, y2) = + reader \E {size} -> + Base.qR (x1 * size) (y1 * size) + (x2 * size) (y2 * size) + data Arc = Large | Small data Sweep = CW | CCW -- 2.39.2 From 8e2f92a8b624f6ec59f4d30d2b0b6c0ffceeab76 Mon Sep 17 00:00:00 2001 From: Rhiannon Morris Date: Fri, 30 Apr 2021 13:45:18 +0200 Subject: [PATCH 02/13] round line join --- laantas-script/GlyphsBase.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/laantas-script/GlyphsBase.hs b/laantas-script/GlyphsBase.hs index 0ac2421..83c3606 100644 --- a/laantas-script/GlyphsBase.hs +++ b/laantas-script/GlyphsBase.hs @@ -82,7 +82,8 @@ doGlyphs gs e = wrap $ run act e where act = do E {stroke, color} <- ask let gattrs = [Stroke_ <<- color, Stroke_width_ <<- toPx stroke, - Stroke_linecap_ <<- "round", Fill_ <<- "none"] + Stroke_linecap_ <<- "round", Stroke_linejoin_ <<- "round", + Fill_ <<- "none"] g_ gattrs . mconcat <$> traverse placeWord gs <* newline wrap (content, T {width, height}) = let sattrs = [Height_ <<- toPx height, Width_ <<- toPx width] in -- 2.39.2 From c1c5b787d87dbd08139ef3e218c48e2367e8c905 Mon Sep 17 00:00:00 2001 From: Rhiannon Morris Date: Thu, 29 Apr 2021 12:17:19 +0200 Subject: [PATCH 03/13] improve virama lines --- laantas-script/Glyphs.hs | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/laantas-script/Glyphs.hs b/laantas-script/Glyphs.hs index 47cbfa0..255a6cb 100644 --- a/laantas-script/Glyphs.hs +++ b/laantas-script/Glyphs.hs @@ -88,7 +88,8 @@ thPath = tPart 4 <> shiftX 4 hPath tfPath = tPart 4 <> shiftX 4 fPath tjPath = P [mA (2,0), lR (0,5), mA (0,0), lR (4,0), mA (0,-3), lR (5,0), lR (0,8)] -t0Path = tPath <> P [mA (1.5,7), lR (3.5,0)] +t0Path = tPath <> P [mA (1.5,7), cR (1.8,-0.25) (3.1,0) (3.5,0.5)] +-- t0Path = tPath <> P [mA (1.5,7), lR (3.5,0)] -- straight forme kGlyphs = [("k", k), ("kk", kk), ("ks", ks)] @@ -166,7 +167,8 @@ dLong = dFree <> shiftX 1.5 dJoin ƶhPath = dPart <> shiftX 5 hPath ƶfPath = dFree <> shiftX 4 fPath ƶjPath = dFree <> shiftX 4 fPath -ƶ0Path = dFree <> P [mA (0,7), lR (3.5,0)] +ƶ0Path = dFree <> P [mA (1,7), cR (1.8,-0.25) (2.2,0) (2.5,0.5)] +-- ƶ0Path = dFree <> P [mA (1,7), lR (2.5,0)] -- straight forme pGlyphs = [("p", p), ("pp", pp), ("ps", ps), ("pj", pj)] @@ -243,7 +245,8 @@ shPath = sPart <> shiftX 5 hPath sfPath = sPart <> shiftX 4 fPath sjPath = P [mA (0,0), lR (0,3.5), aR 1.5 1.5 0 Small CCW (3,0), lR (0,-1.5), mA (3,0), lR (3,0), lR (0,5), mA (3,2), lR (3,0)] -s0Path = sPath <> P [mA (0.5,7), lR (4,0)] +-- s0Path = sPath <> P [mA (1.5,7), lR (3,0)] -- straight +s0Path = sPath <> P [mA (1.5,7), cR (1.8,-0.25) (2.6,0) (3,0.5)] šGlyphs = [("š",š), ("št",št), ("šk",šk), ("šg",šg), ("šd",šd), ("šƶ",šƶ), @@ -342,7 +345,8 @@ lwPath = lPart <> shiftX 5 wPath lhPath = lPart <> shiftX 5 hPath lfPath = lFree <> shiftX 5 fPath ljPath = lPartFlat <> P [mA (4,0), lR (2,0), lR (0,5)] -l0Path = lFree <> P [mA (0.25,7), lR (3.5,0)] +-- l0Path = lFree <> P [mA (0.75,7), lR (3,0)] -- straight +l0Path = lFree <> P [mA (1.25,7), cR (1.8,-0.25) (2.2,0) (2.5,0.5)] mGlyphs = [("m",m), ("mt",mt), ("mk",mk), ("mg",mg), ("md",md), ("mƶ",mƶ), @@ -396,7 +400,8 @@ mwPath = mPart <> shiftX 6 wPath mhPath = mPart <> shiftX 6 hPath mfPath = ḿPath <> shiftX 7 fPath mjPath = ḿPath <> P [mA (5.5,0), lR (3.5,0), lR (0,5)] -m0Path = ḿPath <> P [mA (0.5,7), lR (5,0)] +-- m0Path = ḿPath <> P [mA (1,7), lR (4.5,0)] +m0Path = ḿPath <> P [mA (1.25,7), cR (3.55,-0.3) (3.8,0) (4,0.5)] nGlyphs = [("n", n), ("nt", nt), ("nk", nk), ("ng", ng), ("nd", nd), ("nƶ", nƶ), @@ -452,7 +457,8 @@ nwPath = nFlat <> P [mA (5,0), lR (2,0)] <> shiftX 5 wPath nhPath = nFlat <> shiftX 5 hPath nfPath = ńPath <> shiftX 4.5 fPath njPath = ńPath <> P [mA (1,-3), lR (4,0), lR (0,8)] -n0Path = ńPath <> P [mA (0.5,7), lR (3,0)] +-- n0Path = ńPath <> P [mA (0.5,7), lR (3,0)] +n0Path = ńPath <> P [mA (1,7), cR (1.8,-0.25) (2.2,0) (2.5,0.5)] rGlyphs = [("r", r), ("rt", rt), ("rk", rk), ("rg", rg), ("rd", rd), ("rƶ", rƶ), @@ -509,7 +515,8 @@ rhPath = rMid <> shiftX 4.5 hPath rfPath = rMid <> shiftX 4.5 fPath rjPath = rMid <> P [mA (3.5,0), lR (4,0), lR (0,5)] rMid = rPartMid <> P [mA (3.5,0), lR (0,5)] -r0Path = ŕPath <> P [mA (0.5,7), lR (4,0)] +-- r0Path = ŕPath <> P [mA (0.5,7), lR (4,0)] +r0Path = ŕPath <> P [mA (1.25,7), cR (2.2,-0.25) (2.8,0) (3,0.5)] čGlyphs = [("č", č), ("čs", čs), ("čč", čč)] @@ -576,7 +583,8 @@ fPart = P [mA (3.5,2.5), lR (-1, 0), lR (0,2.5), aR 2.5 2.5 0 Small CW (2.5, 2.5)] fnPath = fPath <> shiftX 7 nPath fmPath = fPart <> P [lR (0,1)] <> mBump <> mBump' <> P [mA (12,0), lR (0,5)] -f0Path = fPath <> P [mA (0.5,7), lR (5,0)] +-- f0Path = fPath <> P [mA (0.5,7), lR (5,0)] +f0Path = fPath <> P [mA (1.5,7), cR (2.8,-0.35) (3.1,0) (3.5,0.5)] j = G {path = jPath, width = 5} @@ -607,10 +615,9 @@ aPath = P [mA (0,0), lR (0,5)] íPath = P [mA (0,0), lR (3,0), lR (0,5), mR (0,-5), lR (2,0), lR (0,5)] uPath = P $ circA 2.5 (2.5,2.5) úPath = P $ ellipseA 1.5 2.5 (1.5,2.5) <> ellipseA 1.5 2.5 (4.5,2.5) -aiPath = P [mA (0,0), lR (0,5), mR (2,-5), lR (3,0), lR (0,5), - mA (2.5,7), lR (2,0)] +aiPath = P [mA (0,0), lR (0,5), mR (2,-5), lR (3,0), lR (0,5)] auPath = P $ - [mA (0,0), lR (0,5)] <> ellipseA 1.5 2.5 (3.5,2.5) <> [mA (2.5,7), lR (2,0)] + [mA (0,0), lR (0,5)] <> ellipseA 1.5 2.5 (3.5,2.5) iaPath = P [mA (0,0), lR (3,0), lR (0,5), mA (5,0), lR (0,5)] uaPath = P $ ellipseA 1.5 2.5 (1.5,2.5) <> [mA (5,0), lR (0,5)] ḿPath = P [mA (0.5,0), cR (-0.25,0.2) (-0.5,2.25) (-0.5,3.5), -- 2.39.2 From e0cad78abe2a95c47867286ee733f815cc4f9a28 Mon Sep 17 00:00:00 2001 From: Rhiannon Morris Date: Thu, 29 Apr 2021 18:07:10 +0200 Subject: [PATCH 04/13] improve some more glyphs --- laantas-script/Glyphs.hs | 61 ++++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 31 deletions(-) diff --git a/laantas-script/Glyphs.hs b/laantas-script/Glyphs.hs index 255a6cb..1551e1b 100644 --- a/laantas-script/Glyphs.hs +++ b/laantas-script/Glyphs.hs @@ -43,7 +43,7 @@ tGlyphs = [("t",t), ("tt",tt), ("tk",tk), ("tg",tg), ("td",td), ("tƶ",tƶ), ("tn",tn), ("tr",tr), ("tč",tč), ("tǧ",tǧ), ("tw",tw), ("th",th), ("tf",tf), ("tj",tj)] -t = G {path = tPath, width = 5} +t = G {path = tPath, width = 5.5} tt = G {path = ttPath, width = 6} tk = G {path = tkPath, width = 9} tg = G {path = tgPath, width = 9} @@ -65,7 +65,7 @@ tf = G {path = tfPath, width = 10} tj = G {path = tjPath, width = 5} t0 = G {path = t0Path, width = 5} -tPath = P [mA (1.5,0), lR (0,5), mA (0,0), lR (5,0), lR (0,5)] +tPath = P [mA (0,0), lA (5.5,0)] <> shiftX 1.25 aPath <> shiftX 5.25 aPath tPart ℓ = P [mA (2,0), lR (0,5), mA (0,0), lR (ℓ,0)] ttPath = P [mA (1,0), lR (0,5), mA (3,0), lR (0,5), mA (5,0), lR (0,5), mA (0,0), lR (7,0), lR (0,5)] @@ -89,7 +89,6 @@ tfPath = tPart 4 <> shiftX 4 fPath tjPath = P [mA (2,0), lR (0,5), mA (0,0), lR (4,0), mA (0,-3), lR (5,0), lR (0,8)] t0Path = tPath <> P [mA (1.5,7), cR (1.8,-0.25) (3.1,0) (3.5,0.5)] --- t0Path = tPath <> P [mA (1.5,7), lR (3.5,0)] -- straight forme kGlyphs = [("k", k), ("kk", kk), ("ks", ks)] @@ -168,7 +167,6 @@ dLong = dFree <> shiftX 1.5 dJoin ƶfPath = dFree <> shiftX 4 fPath ƶjPath = dFree <> shiftX 4 fPath ƶ0Path = dFree <> P [mA (1,7), cR (1.8,-0.25) (2.2,0) (2.5,0.5)] --- ƶ0Path = dFree <> P [mA (1,7), lR (2.5,0)] -- straight forme pGlyphs = [("p", p), ("pp", pp), ("ps", ps), ("pj", pj)] @@ -245,7 +243,6 @@ shPath = sPart <> shiftX 5 hPath sfPath = sPart <> shiftX 4 fPath sjPath = P [mA (0,0), lR (0,3.5), aR 1.5 1.5 0 Small CCW (3,0), lR (0,-1.5), mA (3,0), lR (3,0), lR (0,5), mA (3,2), lR (3,0)] --- s0Path = sPath <> P [mA (1.5,7), lR (3,0)] -- straight s0Path = sPath <> P [mA (1.5,7), cR (1.8,-0.25) (2.6,0) (3,0.5)] @@ -345,7 +342,6 @@ lwPath = lPart <> shiftX 5 wPath lhPath = lPart <> shiftX 5 hPath lfPath = lFree <> shiftX 5 fPath ljPath = lPartFlat <> P [mA (4,0), lR (2,0), lR (0,5)] --- l0Path = lFree <> P [mA (0.75,7), lR (3,0)] -- straight l0Path = lFree <> P [mA (1.25,7), cR (1.8,-0.25) (2.2,0) (2.5,0.5)] @@ -400,7 +396,6 @@ mwPath = mPart <> shiftX 6 wPath mhPath = mPart <> shiftX 6 hPath mfPath = ḿPath <> shiftX 7 fPath mjPath = ḿPath <> P [mA (5.5,0), lR (3.5,0), lR (0,5)] --- m0Path = ḿPath <> P [mA (1,7), lR (4.5,0)] m0Path = ḿPath <> P [mA (1.25,7), cR (3.55,-0.3) (3.8,0) (4,0.5)] @@ -457,7 +452,6 @@ nwPath = nFlat <> P [mA (5,0), lR (2,0)] <> shiftX 5 wPath nhPath = nFlat <> shiftX 5 hPath nfPath = ńPath <> shiftX 4.5 fPath njPath = ńPath <> P [mA (1,-3), lR (4,0), lR (0,8)] --- n0Path = ńPath <> P [mA (0.5,7), lR (3,0)] n0Path = ńPath <> P [mA (1,7), cR (1.8,-0.25) (2.2,0) (2.5,0.5)] @@ -515,7 +509,6 @@ rhPath = rMid <> shiftX 4.5 hPath rfPath = rMid <> shiftX 4.5 fPath rjPath = rMid <> P [mA (3.5,0), lR (4,0), lR (0,5)] rMid = rPartMid <> P [mA (3.5,0), lR (0,5)] --- r0Path = ŕPath <> P [mA (0.5,7), lR (4,0)] r0Path = ŕPath <> P [mA (1.25,7), cR (2.2,-0.25) (2.8,0) (3,0.5)] @@ -529,7 +522,7 @@ r0Path = ŕPath <> P [mA (1.25,7), cR (2.2,-0.25) (2.8,0) (3,0.5)] čPart = P [mA (0,0.5), cR (2.25,-0.75) (2.55,-0.5) (2.75,-0.5)] <> čPart' čPart' = P [aR 1.25 1.25 0 Small CW (0,2.5), lR (-2,0), mR (2,0), aR 1.25 1.25 0 Small CW (0,2.5), - cR (-0.2,0.25) (-2.25,0) (-2.75,-0.5)] -- FIXME? + cR (-0.2,0.25) (-2.25,0) (-2.75,-0.5)] čJoin = P [mA (2.5,5), cR (1.5,0) (2.5,-0.5) (2.5,-1)] čPartFlat = P [mA (0,0), lR (3.5,0)] <> čPart' čFlat = čPartFlat <> shiftX 1 čJoin <> P [mA (6,0), lR (0,5)] @@ -551,8 +544,8 @@ r0Path = ŕPath <> P [mA (1.25,7), cR (2.2,-0.25) (2.8,0) (3,0.5)] w = G {path = wPath, width = 6} -wPath = wPart <> P [mA (6,0), lR (0,5)] -wPart = P $ circA 2.5 (2.5,2.5) <> [mA (2.5,0), lR (3.5,0)] +wPath = wPart <> shiftX 5.75 aPath +wPart = uPath <> P [mA (2.5,0), lR (3.5,0)] hGlyphs = [("h", h), ("hh", hh), ("hn", hn), ("hm", hm)] @@ -583,43 +576,46 @@ fPart = P [mA (3.5,2.5), lR (-1, 0), lR (0,2.5), aR 2.5 2.5 0 Small CW (2.5, 2.5)] fnPath = fPath <> shiftX 7 nPath fmPath = fPart <> P [lR (0,1)] <> mBump <> mBump' <> P [mA (12,0), lR (0,5)] --- f0Path = fPath <> P [mA (0.5,7), lR (5,0)] f0Path = fPath <> P [mA (1.5,7), cR (2.8,-0.35) (3.1,0) (3.5,0.5)] j = G {path = jPath, width = 5} -jPath = P [mA (0,0), lR (5,0), lR (0,5)] +jPath = P [mA (0,0), lR (5,0)] <> shiftX 4.75 aPath vGlyphs = [("a", a), ("á", á), ("i", i), ("í", í), ("u", u), ("ú", ú), ("ai", ai), ("au", au), ("ia", ia), ("ua", ua), ("ḿ", ḿ), ("ń", ń), ("ł", ł), ("ŕ", ŕ)] -a = G {path = aPath, width = 0} -á = G {path = áPath, width = 3} +a = G {path = aPath, width = 0.125} +á = G {path = áPath, width = 2.125} i = j í = G {path = íPath, width = 5} -u = G {path = uPath, width = 5} -ú = G {path = úPath, width = 6} +u = G {path = uPath, width = 4.5} +ú = G {path = úPath, width = 4} ai = G {path = aiPath, width = 5} -au = G {path = auPath, width = 5} +au = G {path = auPath, width = 4.5} ia = G {path = iaPath, width = 5} -ua = G {path = uaPath, width = 5} +ua = G {path = uaPath, width = 4.5} ḿ = G {path = ḿPath, width = 6} ń = G {path = ńPath, width = 3} ł = G {path = łPath, width = 4} ŕ = G {path = ŕPath, width = 5} -aPath = P [mA (0,0), lR (0,5)] -áPath = P [mA (0,0), lR (0,5), mA (3,0), lR (0,5)] -íPath = P [mA (0,0), lR (3,0), lR (0,5), mR (0,-5), lR (2,0), lR (0,5)] -uPath = P $ circA 2.5 (2.5,2.5) -úPath = P $ ellipseA 1.5 2.5 (1.5,2.5) <> ellipseA 1.5 2.5 (4.5,2.5) -aiPath = P [mA (0,0), lR (0,5), mR (2,-5), lR (3,0), lR (0,5)] -auPath = P $ - [mA (0,0), lR (0,5)] <> ellipseA 1.5 2.5 (3.5,2.5) -iaPath = P [mA (0,0), lR (3,0), lR (0,5), mA (5,0), lR (0,5)] -uaPath = P $ ellipseA 1.5 2.5 (1.5,2.5) <> [mA (5,0), lR (0,5)] +aPath = P [mA (0.25,0), cR (-0.25,1) (-0.25,2) (-0.25,5)] +áPath = aPath <> shiftX 2 aPath +íPath = P [mA (0,0), lR (5,0)] <> shiftX 2.75 aPath <> shiftX 4.75 aPath +uPath = P [mA (2.25,0), + cR (-3.2,0.5) (-3.2,5.5) (0,5), + cR (3.2,-0.5) (3.2,-5.5) (0,-5)] +uNarrow = P [mA (1.5,0), + cR (-2.2,0.25) (-2.2,5.25) (0,5), + cR (2.2,-0.25) (2.2,-5.25) (0,-5)] +úPath = uPath <> P [mA (4.25,-3), cR (-1.5,3) (-3.2,8) (-2.8,12)] +aiPath = aPath <> P [mR (2,-5), lR (3,0)] <> shiftX 4.75 aPath +auPath = aPath <> shiftX 1.5 uNarrow +iaPath = P [mA (0,0), lR (3,0)] <> shiftX 2.75 aPath <> shiftX 5 aPath +uaPath = uNarrow <> shiftX 4.5 aPath ḿPath = P [mA (0.5,0), cR (-0.25,0.2) (-0.5,2.25) (-0.5,3.5), aR 1.5 1.5 0 Small CCW (3,0), lR (0,-2), mA (5.5,0), cR (0.25,0.2) (0.5,2.25) (0.5,3.5), @@ -641,7 +637,10 @@ du = da <> P [lR (-4,0)] dú = du <> P [mR (4,-3), lR (-3,0)] dai = da <> P [mR (-4,-3), lR (2.5,0), lR (0,3)] -dau = da <> P (circR 1.5 (-3,-2)) <> P [mR (1.5,-1.5), lR (3,0)] +dau = da <> P [mR (-3,-3.5), + cR (-1.5,0.25) (-1.5,3.25) (0,3), + cR (1.5,-0.25) (1.5,-3.25) (0,-3), + cR (1,-0.25) (2,0.5) (3,0)] dia = di <> adot (-1.5,0) dua = du <> adot (2,-2) -- 2.39.2 From 37789cec4b58d1f8817f8972d434c9832abb625d Mon Sep 17 00:00:00 2001 From: Rhiannon Morris Date: Thu, 29 Apr 2021 19:42:06 +0200 Subject: [PATCH 05/13] =?UTF-8?q?fix=20=C6=B6j?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- laantas-script/Glyphs.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/laantas-script/Glyphs.hs b/laantas-script/Glyphs.hs index 1551e1b..22731b8 100644 --- a/laantas-script/Glyphs.hs +++ b/laantas-script/Glyphs.hs @@ -165,7 +165,7 @@ dLong = dFree <> shiftX 1.5 dJoin ƶwPath = dPart <> shiftX 5 wPath ƶhPath = dPart <> shiftX 5 hPath ƶfPath = dFree <> shiftX 4 fPath -ƶjPath = dFree <> shiftX 4 fPath +ƶjPath = dFree <> shiftX 2 jPath ƶ0Path = dFree <> P [mA (1,7), cR (1.8,-0.25) (2.2,0) (2.5,0.5)] -- 2.39.2 From f8c3cfa4f6f1fb66f8f0de86d5c4b643b71b1c64 Mon Sep 17 00:00:00 2001 From: Rhiannon Morris Date: Fri, 30 Apr 2021 13:46:57 +0200 Subject: [PATCH 06/13] more glyph updates --- laantas-script/Glyphs.hs | 88 ++++++++++++++++++++++------------------ 1 file changed, 48 insertions(+), 40 deletions(-) diff --git a/laantas-script/Glyphs.hs b/laantas-script/Glyphs.hs index 22731b8..00c2334 100644 --- a/laantas-script/Glyphs.hs +++ b/laantas-script/Glyphs.hs @@ -44,12 +44,12 @@ tGlyphs = [("t",t), ("tt",tt), ("tk",tk), ("tg",tg), ("td",td), ("tƶ",tƶ), ("tf",tf), ("tj",tj)] t = G {path = tPath, width = 5.5} -tt = G {path = ttPath, width = 6} +tt = G {path = ttPath, width = 7} tk = G {path = tkPath, width = 9} tg = G {path = tgPath, width = 9} td = G {path = tdPath, width = 9} tƶ = G {path = tƶPath, width = 9} -tp = G {path = tpPath, width = 9} +tp = G {path = tpPath, width = 9.5} tb = G {path = tbPath, width = 10} ts = G {path = tsPath, width = 9} tš = G {path = tšPath, width = 9} @@ -65,12 +65,15 @@ tf = G {path = tfPath, width = 10} tj = G {path = tjPath, width = 5} t0 = G {path = t0Path, width = 5} -tPath = P [mA (0,0), lA (5.5,0)] <> shiftX 1.25 aPath <> shiftX 5.25 aPath -tPart ℓ = P [mA (2,0), lR (0,5), mA (0,0), lR (ℓ,0)] -ttPath = P [mA (1,0), lR (0,5), mA (3,0), lR (0,5), mA (5,0), lR (0,5), - mA (0,0), lR (7,0), lR (0,5)] -tkPath = tPart 5 <> shiftX 5 kShort -tgPath = tPart 5 <> shiftX 5 gShort +tPath = P [mA (0,0), lA (5.5,0)] <> shiftX 1.5 aPath <> shiftX 5.25 aPath +tPart ℓ = shiftX 1.5 aPath <> P [mA (0,0), lR (ℓ,0)] +ttPath = P [mA (0,0), lR (7,0)] + <> shiftX 0.75 aPath + <> shiftX 2.75 aPath + <> shiftX 4.75 aPath + <> shiftX 6.75 aPath +tkPath = tPart 5 <> shiftX 5 (aPath <> kBottomShort <> P [mA (4,-3), lR (0,8)]) +tgPath = shiftX 5 gShortHat <> tkPath -- tPart 5 <> shiftX 5 gShort tdPath = tPart 4 <> shiftX 4 dPath tƶPath = tdPath <> P [mA (6,-3), lR (3,0)] tpPath = P [mA (2,-3), lR (0,8), mA (0,-3), lR (5.5,0)] <> shiftX 4 pPath @@ -97,8 +100,11 @@ k = G {path = kPath, width = 5} kk = G {path = kkPath, width = 8} ks = G {path = ksPath, width = 9} -kPath = P [mA (0,0), lR (0,5), sR (3,0) (5,-0.5), mA (5,-3), lR (0,8)] -kShortPart = P [mA (0,0), lR (0,5), sR (2.6,0) (4,-0.5)] +kLeft = P [mA (0,0), cR (0.3,0.5) (0,3) (0,5)] +kBottomShort = P [cR (0,0) (2.6,0) (4,-0.5)] +kPath = kLeft <> kBottom <> P [mA (5,-3), lR (0,8)] +kBottom = P [cR (0,0) (3,0) (5,-0.5)] +kShortPart = kLeft <> kBottomShort kShort = kShortPart <> P [mA (4,-3), lR (0,8)] kkPath = kShortPart <> shiftX 4 kShort ksPath = kShortPart <> shiftX 4 sPath @@ -106,8 +112,10 @@ ksPath = kShortPart <> shiftX 4 sPath g = G {path = gPath, width = 5} -gPath = kPath <> P [mA (2,-3), lR (3,0), mA (5,5)] -gShort = kShort <> P [mA (1.5,-3), lR (2.5,0), mA (4,5)] +gPath = gHat <> kPath +gHat = P [mA (1.5,-2.75), qR (1.5,0.125) (3.5,-0.25)] +gShort = gShortHat <> kShort +gShortHat = P [mA (1.25,-2.75), qR (1.25,0.125) (2.75,-0.25)] d = G {path = dPath, width = 5} @@ -125,12 +133,12 @@ dLong = dFree <> shiftX 1.5 dJoin ("ƶh",ƶh), ("ƶf",ƶf), ("ƶj",ƶj)] ƶ = G {path = ƶPath, width = 5} -ƶt = G {path = ƶtPath, width = 10} +ƶt = G {path = ƶtPath, width = 10.5} ƶk = G {path = ƶkPath, width = 9} ƶg = G {path = ƶgPath, width = 9} ƶd = G {path = ƶdPath, width = 10} ƶƶ = G {path = ƶƶPath, width = 10} -ƶp = G {path = ƶpPath, width = 10} +ƶp = G {path = ƶpPath, width = 10.5} ƶb = G {path = ƶbPath, width = 11} ƶs = G {path = ƶsPath, width = 10} ƶš = G {path = ƶšPath, width = 10} @@ -171,16 +179,18 @@ dLong = dFree <> shiftX 1.5 dJoin pGlyphs = [("p", p), ("pp", pp), ("ps", ps), ("pj", pj)] -p = G {path = pPath, width = 5} +p = G {path = pPath, width = 5.5} pp = G {path = ppPath, width = 8} -ps = G {path = psPath, width = 10} -pj = G {path = pjPath, width = 9} +ps = G {path = psPath, width = 10.5} +pj = G {path = pjPath, width = 9.5} -pPath = P [mA (1.5,-3), lR (0,8), sR (-1.5,-3) (-1.5,-5), lR (5,0), lR (0,5)] +pPart = + Shift 1.5 (-3) aPath <> + P [lR (0,3), cR (-1,-3) (-2,-4) (0,-5), cR (1,-0.5) (2.5,-0.5) (4,0)] +pPath = pPart <> shiftX 5.25 aPath ppPath = P [mA (1.5,-3), lR (0,8), sR (-1.5,-3) (-1.5,-5), mA (4,-3), lR (0,8), mA (0,0), lR (8,0), lR (0,5)] -psPath = P [mA (1.5,-3), lR (0,8), sR (-1.5,-3) (-1.5,-5), lR (5,0)] - <> shiftX 5 sPath +psPath = pPart <> shiftX 5.5 sPath pjPath = pPath <> P [mA (5,0), lR (4,0), lR (0,5)] @@ -189,8 +199,8 @@ bGlyphs = [("b", b), ("bj", bj)] b = G {path = bPath, width = 6} bj = G {path = bjPath, width = 9} -bPath = wPart <> P [mA (2,-3), lR (4,0), lR (0,8)] -bjPath = bPath <> P [mA (6,-3), lR (3,0), lR (0,8)] +bPath = shiftX 1 gHat <> wPart <> P [mA (6,-3), lR (0,8)] +bjPath = bPath <> P [mA (6,1), cR (0.25,-2) (3,-2.5) (3,-1), lR (0,5)] sGlyphs = [("s",s), ("st",st), ("sk",sk), ("sg",sg), ("sd",sd), ("sƶ",sƶ), @@ -198,13 +208,13 @@ sGlyphs = [("s",s), ("st",st), ("sk",sk), ("sg",sg), ("sd",sd), ("sƶ",sƶ), ("sn",sn), ("sr",sr), ("sč",sč), ("sǧ",sǧ), ("sw",sw), ("sh",sh), ("sf",sf), ("sj",sj)] -s = G {path = sPath, width = 5} -st = G {path = stPath, width = 9} +s = G {path = sPath, width = 5.125} +st = G {path = stPath, width = 9.5} sk = G {path = skPath, width = 9} sg = G {path = sgPath, width = 9} sd = G {path = sdPath, width = 9} sƶ = G {path = sƶPath, width = 9} -sp = G {path = spPath, width = 10} +sp = G {path = spPath, width = 9.5} sb = G {path = sbPath, width = 10} ss = G {path = ssPath, width = 10} sš = G {path = sšPath, width = 10} @@ -220,7 +230,7 @@ sf = G {path = sfPath, width = 10} sj = G {path = sjPath, width = 6} s0 = G {path = s0Path, width = 5} -sPath = sPartLine <> P [mA (5,0), lR (0,5)] +sPath = sPartLine <> shiftX 5 aPath sPart = P [mA (0, 0), lR (0, 3.5), aR 1.5 1.5 0 Small CCW (3,0), lR (0,-3.5)] sPartLine = sPart <> P [mA (3,0), lR (2,0)] stPath = sPartLine <> shiftX 4 tPath @@ -228,7 +238,7 @@ skPath = sPartLine <> shiftX 5 kShort sgPath = sPartLine <> shiftX 5 gShort sdPath = sPart <> P [mA (3,0), lR (1,0)] <> shiftX 4 dPath sƶPath = sPart <> P [mA (3,0), lR (1,0)] <> shiftX 4 ƶPath -spPath = sPart <> P [mA (3,0), lR (3.5,0)] <> shiftX 5 pPath +spPath = sPart <> shiftX 4 pPath sbPath = sPart <> shiftX 4 bPath <> P [mA (3,0), lR (0,-3), lR (3.5,0), mA (10,5)] ssPath = sPartLine <> shiftX 5 sPath sšPath = sPartLine <> shiftX 5 šPath @@ -251,7 +261,7 @@ s0Path = sPath <> P [mA (1.5,7), cR (1.8,-0.25) (2.6,0) (3,0.5)] ("šn",šn), ("šr",šr), ("šč",šč), ("šǧ",šǧ), ("šw",šw), ("šh",šh), ("šf",šf), ("šj",šj)] -š = G {path = šPath, width = 5} +š@(G {path = šPath}) = s2š s šš = ss {path = ššPath} šp = sp {path = špPath} šb = sb {path = šbPath} @@ -273,13 +283,11 @@ s0Path = sPath <> P [mA (1.5,7), cR (1.8,-0.25) (2.6,0) (3,0.5)] šj = s2š sj š0 = s2š s0 -šPath = sPath <> šLine <> P [mA (5,5)] šLine = P [mA (0.5,-1.5), lR (2,0)] ššPath = ssPath <> P [mA (1,-2), lR (7,0), mA (10,5)] -špPath = spPath <> P [mA (0,-3), lR (3,0)] +špPath = šLine <> spPath šbPath = sPart <> šLine <> P [mA (3,0), lR (4,0)] <> shiftX 4 bPath -s2š g@(G {path, width}) = - g {path = path <> šLine <> P [mA (width,5)]} +s2š g@(G {path}) = g {path = šLine <> path} lGlyphs = [("l",l), ("ll", ll), ("lt",lt), ("lk",lk), ("lg",lg), ("ld",ld), @@ -289,12 +297,12 @@ lGlyphs = [("l",l), ("ll", ll), ("lt",lt), ("lk",lk), ("lg",lg), ("ld",ld), l = G {path = lPath, width = 5} ll = G {path = llPath, width = 10} -lt = G {path = ltPath, width = 10} +lt = G {path = ltPath, width = 10.5} lk = G {path = lkPath, width = 9} lg = G {path = lgPath, width = 9} ld = G {path = ldPath, width = 10} lƶ = G {path = lƶPath, width = 10} -lp = G {path = lpPath, width = 10} +lp = G {path = lpPath, width = 10.5} lb = G {path = lbPath, width = 11} ls = G {path = lsPath, width = 10} lš = G {path = lšPath, width = 10} @@ -351,12 +359,12 @@ mGlyphs = [("m",m), ("mt",mt), ("mk",mk), ("mg",mg), ("md",md), ("mƶ",mƶ), ("mf",mf), ("mj",mj)] m = G {path = mPath, width = 6} -mt = G {path = mtPath, width = 9.5} +mt = G {path = mtPath, width = 10} mk = G {path = mkPath, width = 10} mg = G {path = mgPath, width = 10} md = G {path = mdPath, width = 12} mƶ = G {path = mƶPath, width = 12} -mp = G {path = mpPath, width = 12} +mp = G {path = mpPath, width = 12.5} mb = G {path = mbPath, width = 12} ms = G {path = msPath, width = 11} mš = G {path = mšPath, width = 11} @@ -405,12 +413,12 @@ nGlyphs = [("n", n), ("nt", nt), ("nk", nk), ("ng", ng), ("nd", nd), ("nƶ", nƶ ("nw", nw), ("nh", nh), ("nf", nf), ("nj", nj)] n = G {path = nPath, width = 5} -nt = G {path = ntPath, width = 10} +nt = G {path = ntPath, width = 10.5} nk = G {path = nkPath, width = 9} ng = G {path = ngPath, width = 9} nd = G {path = ndPath, width = 10} nƶ = G {path = nƶPath, width = 10} -np = G {path = npPath, width = 9.5} +np = G {path = npPath, width = 10} nb = G {path = nbPath, width = 11} ns = G {path = nsPath, width = 10} nš = G {path = nšPath, width = 10} @@ -461,12 +469,12 @@ rGlyphs = [("r", r), ("rt", rt), ("rk", rk), ("rg", rg), ("rd", rd), ("rƶ", rƶ ("rw", rw), ("rh", rh), ("rf", rf), ("rj", rj)] r = G {path = rPath, width = 5} -rt = G {path = rtPath, width = 7} +rt = G {path = rtPath, width = 7.5} rk = G {path = rkPath, width = 7} rg = G {path = rgPath, width = 7} rd = G {path = rdPath, width = 9.5} rƶ = G {path = rƶPath, width = 9.5} -rp = G {path = rpPath, width = 9.5} +rp = G {path = rpPath, width = 10} rb = G {path = rbPath, width = 10.5} rs = G {path = rsPath, width = 9.5} rš = G {path = ršPath, width = 9.5} -- 2.39.2 From 5d44043bfea4580ec5bece5dee4789bf141b9117 Mon Sep 17 00:00:00 2001 From: Rhiannon Morris Date: Sun, 2 May 2021 11:22:28 +0200 Subject: [PATCH 07/13] more new glyphs --- laantas-script/Glyphs.hs | 218 +++++++++++++++++++++------------------ 1 file changed, 120 insertions(+), 98 deletions(-) diff --git a/laantas-script/Glyphs.hs b/laantas-script/Glyphs.hs index 00c2334..622b8df 100644 --- a/laantas-script/Glyphs.hs +++ b/laantas-script/Glyphs.hs @@ -53,7 +53,7 @@ tp = G {path = tpPath, width = 9.5} tb = G {path = tbPath, width = 10} ts = G {path = tsPath, width = 9} tš = G {path = tšPath, width = 9} -tl = G {path = tlPath, width = 9} +tl = G {path = tlPath, width = 8.5} tm = G {path = tmPath, width = 10} tn = G {path = tnPath, width = 9} tr = G {path = trPath, width = 7} @@ -76,11 +76,11 @@ tkPath = tPart 5 <> shiftX 5 (aPath <> kBottomShort <> P [mA (4,-3), lR (0,8)]) tgPath = shiftX 5 gShortHat <> tkPath -- tPart 5 <> shiftX 5 gShort tdPath = tPart 4 <> shiftX 4 dPath tƶPath = tdPath <> P [mA (6,-3), lR (3,0)] -tpPath = P [mA (2,-3), lR (0,8), mA (0,-3), lR (5.5,0)] <> shiftX 4 pPath +tpPath = P [mA (2,-3), lR (0,8), mA (0,-3), lR (6,0)] <> shiftX 4 pPath tbPath = tPart 6 <> shiftX 4 bPath tsPath = tPart 4 <> shiftX 4 sPath tšPath = tPart 4 <> shiftX 4 šPath -tlPath = tPart 5 <> shiftX 4 lPath +tlPath = tPart 5 <> shiftX 3.5 lPath tmPath = tPart 4.5 <> shiftX 4 mPath tnPath = tPart 6 <> shiftX 4 nPath trPath = tPart 7 <> shiftX 4 rShort @@ -100,7 +100,7 @@ k = G {path = kPath, width = 5} kk = G {path = kkPath, width = 8} ks = G {path = ksPath, width = 9} -kLeft = P [mA (0,0), cR (0.3,0.5) (0,3) (0,5)] +kLeft = P [mA (0,0), cR (0.5,0.75) (0,3) (0,5)] kBottomShort = P [cR (0,0) (2.6,0) (4,-0.5)] kPath = kLeft <> kBottom <> P [mA (5,-3), lR (0,8)] kBottom = P [cR (0,0) (3,0) (5,-0.5)] @@ -121,8 +121,10 @@ gShortHat = P [mA (1.25,-2.75), qR (1.25,0.125) (2.75,-0.25)] d = G {path = dPath, width = 5} dPath = dPart <> P [mA (5,-3), lR (0,8)] +dPart' = dBase <> dJoin' dPart = dBase <> dJoin -dJoin = P [mA (2,5), cR (2,0) (3,-1) (3,-2)] +dJoin = P [{-mA (2,5),-} cR (2,0) (3,-0.75) (3,-1.5)] +dJoin' = P [{-mA (2,5),-} cR (1.75,0) (2.5,-0.75) (2.85,-2.5)] dBase = P [mA (0,0), lR (3.5,0), cR (0,1.5) (-3.5,3.5) (-3.5,5), lR (2,0)] dFree = dBase <> P [mA (2,5), lR (1.5,0)] dLong = dFree <> shiftX 1.5 dJoin @@ -154,23 +156,23 @@ dLong = dFree <> shiftX 1.5 dJoin ƶj = G {path = ƶjPath, width = 7} ƶ0 = G {path = ƶ0Path, width = 3.5} -ƶPath = dPath <> P [mA (1,-3), lR (4,0), mA (5,5)] +ƶPath = gHat <> dPath ƶtPath = dLong <> shiftX 5 tPath ƶkPath = dPart <> shiftX 5 kShort ƶgPath = dPart <> shiftX 5 gShort -ƶdPath = dFree <> shiftX 5 dPath <> P [mA (1,-2), lR (2,0)] +ƶdPath = dFree <> shiftX 5 dPath ƶƶPath = dFree <> shiftX 5 ƶPath ƶpPath = dFree <> shiftX 5 pPath -ƶbPath = dPart <> shiftX 5 bPath +ƶbPath = dPart' <> shiftX 5 bPath ƶsPath = dPart <> shiftX 5 sPath ƶšPath = dPart <> shiftX 5 šPath ƶlPath = dPart <> shiftX 5 lPath ƶmPath = dPart <> shiftX 5 mPath -ƶnPath = dPart <> shiftX 5 nPath +ƶnPath = dPart' <> shiftX 5 nPath -- TODO dPart or dPart'? ƶrPath = dPart <> shiftX 5 rCursive ƶčPath = dFree <> shiftX 5 čPath ƶǧPath = dFree <> shiftX 5 ǧPath -ƶwPath = dPart <> shiftX 5 wPath +ƶwPath = dPart' <> shiftX 5 wPath ƶhPath = dPart <> shiftX 5 hPath ƶfPath = dFree <> shiftX 4 fPath ƶjPath = dFree <> shiftX 2 jPath @@ -182,16 +184,26 @@ pGlyphs = [("p", p), ("pp", pp), ("ps", ps), ("pj", pj)] p = G {path = pPath, width = 5.5} pp = G {path = ppPath, width = 8} ps = G {path = psPath, width = 10.5} -pj = G {path = pjPath, width = 9.5} +pj = G {path = pjPath, width = 10} +pInit = + P [mA (0,-3), cR (-1,1) (-0.5,6) (-0.5,8)] pPart = - Shift 1.5 (-3) aPath <> - P [lR (0,3), cR (-1,-3) (-2,-4) (0,-5), cR (1,-0.5) (2.5,-0.5) (4,0)] + shiftX 2 pInit <> + P [cR (-1,-3) (-2,-4) (0,-5), cR (1,-0.5) (2.5,-0.5) (4,0)] pPath = pPart <> shiftX 5.25 aPath -ppPath = P [mA (1.5,-3), lR (0,8), sR (-1.5,-3) (-1.5,-5), - mA (4,-3), lR (0,8), mA (0,0), lR (8,0), lR (0,5)] +ppPath = + shiftX 2 pInit <> shiftX 4.5 pInit <> + P [mA (1.5,5), cR (-1,-3) (-2,-4) (0,-5), cR (1,-0.5) (2.5,-0.5) (7.5,0)] <> + shiftX 8.75 aPath psPath = pPart <> shiftX 5.5 sPath -pjPath = pPath <> P [mA (5,0), lR (4,0), lR (0,5)] +-- pjPath = pPath <> shiftX 7 jPath +pjPath = + shiftX 2 pInit <> + P [cR (-1,-3) (-2,-4) (0,-5), cR (1,-0.5) (4,-1) (4,1), + lR (0,4), mR (0,-4), + cR (0,-2) (3.5,-1) (4.5,-1)] <> + shiftX 9.75 aPath bGlyphs = [("b", b), ("bj", bj)] @@ -200,7 +212,10 @@ b = G {path = bPath, width = 6} bj = G {path = bjPath, width = 9} bPath = shiftX 1 gHat <> wPart <> P [mA (6,-3), lR (0,8)] -bjPath = bPath <> P [mA (6,1), cR (0.25,-2) (3,-2.5) (3,-1), lR (0,5)] +bjPath = + bPath <> + P [mA (6,0.5), qR (1.5,0) (3,-0.5)] <> + shiftX 8.75 aPath sGlyphs = [("s",s), ("st",st), ("sk",sk), ("sg",sg), ("sd",sd), ("sƶ",sƶ), @@ -218,7 +233,7 @@ sp = G {path = spPath, width = 9.5} sb = G {path = sbPath, width = 10} ss = G {path = ssPath, width = 10} sš = G {path = sšPath, width = 10} -sl = G {path = slPath, width = 10} +sl = G {path = slPath, width = 9.5} sm = G {path = smPath, width = 11} sn = G {path = snPath, width = 10} sr = G {path = srPath, width = 9} @@ -231,26 +246,35 @@ sj = G {path = sjPath, width = 6} s0 = G {path = s0Path, width = 5} sPath = sPartLine <> shiftX 5 aPath -sPart = P [mA (0, 0), lR (0, 3.5), aR 1.5 1.5 0 Small CCW (3,0), lR (0,-3.5)] -sPartLine = sPart <> P [mA (3,0), lR (2,0)] +-- sPart = P [mA (0, 0), lR (0, 3.5), aR 1.5 1.5 0 Small CCW (3,0), lR (0,-3.5)] +sPart = P [mA (0, 0), + cR (0.15,0.5) (0,2.5) (0,3.5), + aR 1.5 1.5 0 Small CCW (3,0), + qR (0,-3) (-0.5, -3.5)] +sPartIso = P [mA (0, 0), + cR (0.15,0.5) (0,2.5) (0,3.5), + aR 1.5 1.5 0 Small CCW (3,0), + cR (0,-0.5) (-0.15,-2.5) (0,-3.5)] +sPartLine = sPart <> P [mA (2.5,0), lR (2.5,0)] stPath = sPartLine <> shiftX 4 tPath skPath = sPartLine <> shiftX 5 kShort sgPath = sPartLine <> shiftX 5 gShort -sdPath = sPart <> P [mA (3,0), lR (1,0)] <> shiftX 4 dPath -sƶPath = sPart <> P [mA (3,0), lR (1,0)] <> shiftX 4 ƶPath -spPath = sPart <> shiftX 4 pPath -sbPath = sPart <> shiftX 4 bPath <> P [mA (3,0), lR (0,-3), lR (3.5,0), mA (10,5)] +sdPath = sPart <> P [mA (2.5,0), lR (1.5,0)] <> shiftX 4 dPath +sƶPath = sPart <> P [mA (2.5,0), lR (1.5,0)] <> shiftX 4 ƶPath +spPath = sPartIso <> shiftX 4 pPath +-- TODO +sbPath = sPartIso <> shiftX 4 bPath <> P [mA (3,0), lR (0,-3), lR (3.5,0), mA (10,5)] ssPath = sPartLine <> shiftX 5 sPath sšPath = sPartLine <> shiftX 5 šPath -slPath = sPart <> P [mA (3,0), lR (3,0)] <> shiftX 5 lPath -smPath = sPart <> P [mA (3,0), lR (2.5,0)] <> shiftX 5 mPath -snPath = sPart <> P [mA (3,0), lR (4,0)] <> shiftX 5 nPath -srPath = sPart <> P [mA (3,0), lR (4,0)] <> shiftX 4 rShort -sčPath = sPart <> shiftX 3 čFlat -sǧPath = sPart <> shiftX 4 ǧPath -swPath = sPart <> P [mA (3,0), lR (3.5,0)] <> shiftX 4 wPath -shPath = sPart <> shiftX 5 hPath -sfPath = sPart <> shiftX 4 fPath +slPath = sPart <> P [mA (2.5,0), lR (3.5,0)] <> shiftX 4.5 lPath +smPath = sPart <> P [mA (2.5,0), lR (3,0)] <> shiftX 5 mPath +snPath = sPart <> P [mA (2.5,0), lR (4.5,0)] <> shiftX 5 nPath +srPath = sPart <> P [mA (2.5,0), lR (4.5,0)] <> shiftX 4 rShort +sčPath = sPart <> P [mA (2.5,0), lR (1.5,0)] <> shiftX 3 čFlat +sǧPath = sPartIso <> shiftX 4 ǧPath +swPath = sPart <> P [mA (2.5,0), lR (4,0)] <> shiftX 4 wPath +shPath = sPartIso <> shiftX 5 hPath +sfPath = sPartIso <> shiftX 4 fPath sjPath = P [mA (0,0), lR (0,3.5), aR 1.5 1.5 0 Small CCW (3,0), lR (0,-1.5), mA (3,0), lR (3,0), lR (0,5), mA (3,2), lR (3,0)] s0Path = sPath <> P [mA (1.5,7), cR (1.8,-0.25) (2.6,0) (3,0.5)] @@ -295,61 +319,58 @@ lGlyphs = [("l",l), ("ll", ll), ("lt",lt), ("lk",lk), ("lg",lg), ("ld",ld), ("ln",ln), ("lr",lr), ("lč",lč), ("lǧ",lǧ), ("lw",lw), ("lh",lh), ("lf",lf), ("lj",lj)] -l = G {path = lPath, width = 5} -ll = G {path = llPath, width = 10} -lt = G {path = ltPath, width = 10.5} -lk = G {path = lkPath, width = 9} -lg = G {path = lgPath, width = 9} -ld = G {path = ldPath, width = 10} -lƶ = G {path = lƶPath, width = 10} -lp = G {path = lpPath, width = 10.5} -lb = G {path = lbPath, width = 11} -ls = G {path = lsPath, width = 10} -lš = G {path = lšPath, width = 10} -lm = G {path = lmPath, width = 11} -ln = G {path = lnPath, width = 10} -lr = G {path = lrPath, width = 10} -lč = G {path = lčPath, width = 10} -lǧ = G {path = lǧPath, width = 10} -lw = G {path = lwPath, width = 11} -lh = G {path = lhPath, width = 13} -lf = G {path = lfPath, width = 11} -lj = G {path = ljPath, width = 6} -l0 = G {path = l0Path, width = 4} +l = G {path = lPath, width = 4.5} +ll = G {path = llPath, width = 9} +lt = G {path = ltPath, width = 10} +lk = G {path = lkPath, width = 8.5} +lg = G {path = lgPath, width = 8.5} +ld = G {path = ldPath, width = 9.5} +lƶ = G {path = lƶPath, width = 9.5} +lp = G {path = lpPath, width = 10} +lb = G {path = lbPath, width = 10.5} +ls = G {path = lsPath, width = 9.5} +lš = G {path = lšPath, width = 9.5} +lm = G {path = lmPath, width = 10.5} +ln = G {path = lnPath, width = 9.5} +lr = G {path = lrPath, width = 9.5} +lč = G {path = lčPath, width = 9.5} +lǧ = G {path = lǧPath, width = 9.5} +lw = G {path = lwPath, width = 10.5} +lh = G {path = lhPath, width = 12.5} +lf = G {path = lfPath, width = 10.5} +lj = G {path = ljPath, width = 4.5} +l0 = G {path = l0Path, width = 3.75} -lPath = lPart <> P [mA (4,4.5), lR (1,-0.7), mA (5,0), lR (0,5)] -lBase = P [mA (4,0.5), cR (-2.25,-0.75) (-2.55,-0.5) (-2.75,-0.5), - aR 1.25 1.25 0 Small CCW (0,2.5), lR (2,0), mR (-2,0), - aR 1.25 1.25 0 Small CCW (0,2.5), lR (0.75,0)] -lPart = lBase <> dJoin -lPartFlat = lBaseFlat <> shiftX 1 dJoin -lBaseFlat = P [mA (4,0), lR (-2.75,0), - aR 1.25 1.25 0 Small CCW (0,2.5), lR (2,0), mR (-2,0), - aR 1.25 1.25 0 Small CCW (0,2.5), lR (2,0)] -lFree = P [mA (4,0.5), cR (-2.25,-0.75) (-2.55,-0.5) (-2.75,-0.5), - aR 1.25 1.25 0 Small CCW (0,2.5), lR (2,0), mR (-2,0), - aR 1.25 1.25 0 Small CCW (0,2.5), - cR (0.2,0.25) (2.25,0) (2.75,-0.5)] -lLong = lBase <> P [mA (2,5), lR (2,0)] <> shiftX 1.5 dJoin -llPath = lPart <> shiftX 5 lPath -ltPath = lLong <> shiftX 5 tPath -lkPath = lPart <> shiftX 5 kShort -lgPath = lPart <> shiftX 5 gShort -ldPath = lFree <> shiftX 5 dPath -lƶPath = lFree <> shiftX 5 ƶPath -lpPath = lFree <> shiftX 5 pPath -lbPath = lPart <> shiftX 5 bPath -lsPath = lPart <> shiftX 5 sPath -lšPath = lPart <> shiftX 5 šPath -lmPath = lPart <> shiftX 5 mPath -lnPath = lPart <> shiftX 5 nPath -lrPath = lPart <> shiftX 5 rCursive -lčPath = lFree <> shiftX 5 čPath -lǧPath = lFree <> shiftX 5 ǧPath -lwPath = lPart <> shiftX 5 wPath -lhPath = lPart <> shiftX 5 hPath -lfPath = lFree <> shiftX 5 fPath -ljPath = lPartFlat <> P [mA (4,0), lR (2,0), lR (0,5)] +lPath = lPart <> P [mA (4.5,0), lR (0,5)] +lBase = P [mA (3,0.5), cR (0.25,-0.25) (0,-0.75) (-1.25,-0.5), + cR (-1.5,0.3) (-2,2.5) (0,2.5), + lR (0.75,0), mR (-1.25,0), + cR (-1.5,0.3) (-2,2.5) (0,2.5)] +lJoin = P [lR (0.25,0)] <> dJoin +lJoin' = P [lR (0.25,0)] <> dJoin' +lPart = lBase <> lJoin +lPart' = lBase <> lJoin' +lFree = lBase <> P [qR (2.25,0) (2.5,-0.5)] +lFree' = lBase <> P [qR (2,0) (2.25,-0.75)] +llPath = lPart <> shiftX 4.5 lPath +ltPath = lBase <> P [qR (4.5,0) (4.75,-3)] <> shiftX 4.5 tPath +lkPath = lPart <> shiftX 4.5 kShort +lgPath = lPart <> shiftX 4.5 gShort +ldPath = lFree' <> shiftX 4.5 dPath +lƶPath = lFree' <> shiftX 4.5 ƶPath +lpPath = lFree' <> shiftX 4.5 pPath +lbPath = lPart' <> shiftX 4.5 bPath +lsPath = lPart <> shiftX 4.5 sPath +lšPath = lPart <> shiftX 4.5 šPath +lmPath = lPart <> shiftX 4.5 mPath +lnPath = lPart' <> shiftX 4.5 nPath -- TODO lPart or lPart'? +lrPath = lPart <> shiftX 4.5 rCursive +lčPath = lFree' <> shiftX 4.5 čPath +lǧPath = lFree' <> shiftX 4.5 ǧPath +lwPath = lPart' <> shiftX 4.5 wPath +lhPath = lPart <> shiftX 4.5 hPath +lfPath = lFree' <> shiftX 4.5 fPath +ljPath = lPart <> shiftX 0.5 gShortHat <> P [mA (4.5,-3), lR (0,8)] l0Path = lFree <> P [mA (1.25,7), cR (1.8,-0.25) (2.2,0) (2.5,0.5)] @@ -558,17 +579,18 @@ wPart = uPath <> P [mA (2.5,0), lR (3.5,0)] hGlyphs = [("h", h), ("hh", hh), ("hn", hn), ("hm", hm)] -h = G {path = hPath, width = 8} -hh = G {path = hhPath, width = 16} -hn = G {path = hnPath, width = 14} -hm = G {path = hmPath, width = 15} +h = G {path = hPath, width = 8.5} +hh = G {path = hhPath, width = 16.5} +hn = G {path = hnPath, width = 15} +hm = G {path = hmPath, width = 16} -hPath = hPart <> P [mA (5,-3), lR (3,0), lR (0,8)] -hPart = sPart <> P [mA (3,0), lR (1,0)] <> shiftX 4 sPart -hhPath = hPart <> P [mA (7,0), lR (1,0)] <> shiftX 8 hPart <> - P [mA (12,-3), lR (4,0), lR (0,8)] -hnPath = hPath <> shiftX 9 nPath -hmPath = hPath <> shiftX 9 mPath +hPath = hPart <> shiftX 3.5 gHat <> P [mA (8.5,-3), lR (0,8)] +hPart' x = sPart <> P [mA (2.5,0), lR (1.5,0)] <> shiftX 4 x +hPart = hPart' sPartIso +hhPath = hPart' sPart <> P [mA (6.5,0), lR (1.5,0)] <> shiftX 8 hPart <> + shiftX 11.5 gHat <> P [mA (16.5,-3), lR (0,8)] +hnPath = hPath <> shiftX 10 nPath +hmPath = hPath <> shiftX 10 mPath fGlyphs = [("f", f), ("fn", fn), ("fm", fm)] @@ -607,7 +629,7 @@ ia = G {path = iaPath, width = 5} ua = G {path = uaPath, width = 4.5} ḿ = G {path = ḿPath, width = 6} ń = G {path = ńPath, width = 3} -ł = G {path = łPath, width = 4} +ł = G {path = łPath, width = 3.75} ŕ = G {path = ŕPath, width = 5} aPath = P [mA (0.25,0), cR (-0.25,1) (-0.25,2) (-0.25,5)] -- 2.39.2 From 9c7077e098c5919e06b8e6fc3cb1e6abc5c461e9 Mon Sep 17 00:00:00 2001 From: Rhiannon Morris Date: Mon, 3 May 2021 18:46:26 +0200 Subject: [PATCH 08/13] adjust writing system page --- pages/laantas/writing.md | 58 ++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/pages/laantas/writing.md b/pages/laantas/writing.md index 8c4a3b2..bb5907e 100644 --- a/pages/laantas/writing.md +++ b/pages/laantas/writing.md @@ -40,9 +40,9 @@ In other cases, vowels are attached to the letter for the previous consonant. The basic consonant shapes are: :::letter-list -`{!t\}` `{!k\}` `{!g\}` `{!d\}` `{!ƶ\}` `{!p\}` `{!b\}` -`{!s\}` `{!š\}` `{!l\}` `{!m\}` `{!n\}` `{!č\}` `{!ǧ\}` -`{!w\}` `{!h\}` `{!f\}` `{!j\}` `{!r\}` +`{!ta}` `{!ka}` `{!ga}` `{!da}` `{!ƶa}` `{!pa}` `{!ba}` +`{!sa}` `{!ša}` `{!la}` `{!ma}` `{!na}` `{!ča}` `{!ǧa}` +`{!wa}` `{!ha}` `{!fa}` `{!ja}` `{!ra}` ::: Clusters are written with a single glyph called a 'conjunct'. These aren't @@ -61,54 +61,54 @@ surprising. ::: {.letter-list #conj-t} -`{!tt\}` `{!tk\}` `{!tg\}` `{!td\}` `{!tƶ\}` `{!tp\}` `{!tb\}` `{!ts\}` -`{!tš\}` `{!tl\}` `{!tm\}` `{!tn\}` `{!tr\}` `{!tč\}` `{!tǧ\}` `{!tw\}` -`{!th\}` `{!tf\}` `{!tj\}` +`{!tta}` `{!tka}` `{!tga}` `{!tda}` `{!tƶa}` `{!tpa}` `{!tba}` `{!tsa}` +`{!tla}` `{!tma}` `{!tna}` `{!tra}` `{!tča}` `{!tǧa}` `{!twa}` `{!tha}` +`{!tfa}` `{!tja}` ::: ::: {.letter-list #conj-ƶ} -`{!ƶt\}` `{!ƶk\}` `{!ƶg\}` `{!ƶd\}` `{!ƶƶ\}` `{!ƶp\}` `{!ƶb\}` `{!ƶs\}` -`{!ƶš\}` `{!ƶl\}` `{!ƶm\}` `{!ƶn\}` `{!ƶr\}` `{!ƶč\}` `{!ƶǧ\}` `{!ƶw\}` -`{!ƶh\}` `{!ƶf\}` `{!ƶj\}` +`{!ƶta}` `{!ƶka}` `{!ƶga}` `{!ƶda}` `{!ƶƶa}` `{!ƶpa}` `{!ƶba}` `{!ƶsa}` +`{!ƶla}` `{!ƶma}` `{!ƶna}` `{!ƶra}` `{!ƶča}` `{!ƶǧa}` `{!ƶwa}` `{!ƶha}` +`{!ƶfa}` `{!ƶja}` ::: ::: {.letter-list #conj-s} -`{!st\}` `{!sk\}` `{!sg\}` `{!sd\}` `{!sƶ\}` `{!sp\}` `{!sb\}` `{!ss\}` -`{!sš\}` `{!sl\}` `{!sm\}` `{!sn\}` `{!sr\}` `{!sč\}` `{!sǧ\}` `{!sw\}` -`{!sh\}` `{!sf\}` `{!sj\}` `{!šš\}` +`{!sta}` `{!ska}` `{!sga}` `{!sda}` `{!sƶa}` `{!spa}` `{!sba}` `{!ssa}` +`{!sla}` `{!sma}` `{!sna}` `{!sra}` `{!sča}` `{!sǧa}` `{!swa}` `{!sha}` +`{!sfa}` `{!sja}` `{!šša}` ::: -Conjuncts with `{!š\}` are the same as with `{!s\}`, but with the line above. In -the case of `{!šš\}` the lines join up. +Conjuncts with `{!ša}` are the same as with `{!sa}`, but with the line above. In +the case of `{!šša}` the lines join up. ::: {.letter-list #conj-l} -`{!lt\}` `{!lk\}` `{!lg\}` `{!ld\}` `{!lƶ\}` `{!lp\}` `{!lb\}` `{!ls\}` -`{!lš\}` `{!ll\}` `{!lm\}` `{!ln\}` `{!lr\}` `{!lč\}` `{!lǧ\}` `{!lw\}` -`{!lh\}` `{!lf\}` `{!lj\}` +`{!lta}` `{!lka}` `{!lga}` `{!lda}` `{!lƶa}` `{!lpa}` `{!lba}` `{!lsa}` +`{!lla}` `{!lma}` `{!lna}` `{!lra}` `{!lča}` `{!lǧa}` `{!lwa}` `{!lha}` +`{!lfa}` `{!lja}` ::: ::: {.letter-list #conj-m} -`{!mt\}` `{!mk\}` `{!mg\}` `{!md\}` `{!mƶ\}` `{!mp\}` `{!mb\}` `{!ms\}` -`{!mš\}` `{!ml\}` `{!mm\}` `{!mn\}` `{!mr\}` `{!mč\}` `{!mǧ\}` `{!mw\}` -`{!mh\}` `{!mf\}` `{!mj\}` +`{!mta}` `{!mka}` `{!mga}` `{!mda}` `{!mƶa}` `{!mpa}` `{!mba}` `{!msa}` +`{!mla}` `{!mma}` `{!mna}` `{!mra}` `{!mča}` `{!mǧa}` `{!mwa}` `{!mha}` +`{!mfa}` `{!mja}` ::: ::: {.letter-list #conj-n} -`{!nt\}` `{!nk\}` `{!ng\}` `{!nd\}` `{!nƶ\}` `{!np\}` `{!nb\}` `{!ns\}` -`{!nš\}` `{!nl\}` `{!nm\}` `{!nn\}` `{!nr\}` `{!nč\}` `{!nǧ\}` `{!nw\}` -`{!nh\}` `{!nf\}` `{!nj\}` +`{!nta}` `{!nka}` `{!nga}` `{!nda}` `{!nƶa}` `{!npa}` `{!nba}` `{!nsa}` +`{!nla}` `{!nma}` `{!nna}` `{!nra}` `{!nča}` `{!nǧa}` `{!nwa}` `{!nha}` +`{!nfa}` `{!nja}` ::: ::: {.letter-list #conj-r} -`{!rt\}` `{!rk\}` `{!rg\}` `{!rd\}` `{!rƶ\}` `{!rp\}` `{!rb\}` `{!rs\}` -`{!rš\}` `{!rl\}` `{!rm\}` `{!rn\}` `{!rr\}` `{!rč\}` `{!rǧ\}` `{!rw\}` -`{!rh\}` `{!rf\}` `{!rj\}` +`{!rta}` `{!rka}` `{!rga}` `{!rda}` `{!rƶa}` `{!rpa}` `{!rba}` `{!rsa}` +`{!rla}` `{!rma}` `{!rna}` `{!rra}` `{!rča}` `{!rǧa}` `{!rwa}` `{!rha}` +`{!rfa}` `{!rja}` ::: ::: {.letter-list #conj-o} -`{!kk\}` `{!ks\}` `{!pp\}` `{!ps\}` `{!pj\}` -`{!bj\}` `{!čs\}` `{!čč\}` `{!hh\}` -`{!hn\}` `{!hm\}` `{!fn\}` `{!fm\}` +`{!kka}` `{!ksa}` `{!ppa}` `{!psa}` `{!pja}` +`{!bja}` `{!čsa}` `{!čča}` `{!hha}` +`{!hna}` `{!hma}` `{!fna}` `{!fma}` ::: If a word ends in a consnant, a horizontal line is drawn under it to specify -- 2.39.2 From b7617b9d9794670b8cc430d07e15dc8b875119fd Mon Sep 17 00:00:00 2001 From: Rhiannon Morris Date: Mon, 3 May 2021 18:47:34 +0200 Subject: [PATCH 09/13] more glyphs --- laantas-script/Glyphs.hs | 148 ++++++++++++++++++++------------------- 1 file changed, 75 insertions(+), 73 deletions(-) diff --git a/laantas-script/Glyphs.hs b/laantas-script/Glyphs.hs index 622b8df..0884ebe 100644 --- a/laantas-script/Glyphs.hs +++ b/laantas-script/Glyphs.hs @@ -62,10 +62,11 @@ tǧ = G {path = tǧPath, width = 10} tw = G {path = twPath, width = 10} th = G {path = thPath, width = 12} tf = G {path = tfPath, width = 10} -tj = G {path = tjPath, width = 5} +tj = G {path = tjPath, width = 4.75} t0 = G {path = t0Path, width = 5} tPath = P [mA (0,0), lA (5.5,0)] <> shiftX 1.5 aPath <> shiftX 5.25 aPath +tNarrow = P [mA (0,0), lA (5,0)] <> shiftX 1.5 aPath <> shiftX 4.75 aPath tPart ℓ = shiftX 1.5 aPath <> P [mA (0,0), lR (ℓ,0)] ttPath = P [mA (0,0), lR (7,0)] <> shiftX 0.75 aPath @@ -73,7 +74,7 @@ ttPath = P [mA (0,0), lR (7,0)] <> shiftX 4.75 aPath <> shiftX 6.75 aPath tkPath = tPart 5 <> shiftX 5 (aPath <> kBottomShort <> P [mA (4,-3), lR (0,8)]) -tgPath = shiftX 5 gShortHat <> tkPath -- tPart 5 <> shiftX 5 gShort +tgPath = shiftX 5 gShortHat <> tkPath tdPath = tPart 4 <> shiftX 4 dPath tƶPath = tdPath <> P [mA (6,-3), lR (3,0)] tpPath = P [mA (2,-3), lR (0,8), mA (0,-3), lR (6,0)] <> shiftX 4 pPath @@ -89,8 +90,7 @@ tǧPath = tPart 4 <> shiftX 5 ǧPath twPath = tPart 6 <> shiftX 4 wPath thPath = tPart 4 <> shiftX 4 hPath tfPath = tPart 4 <> shiftX 4 fPath -tjPath = P [mA (2,0), lR (0,5), mA (0,0), lR (4,0), mA (0,-3), - lR (5,0), lR (0,8)] +tjPath = tPart 3.5 <> shiftX (-0.5) jTall t0Path = tPath <> P [mA (1.5,7), cR (1.8,-0.25) (3.1,0) (3.5,0.5)] @@ -146,14 +146,14 @@ dLong = dFree <> shiftX 1.5 dJoin ƶš = G {path = ƶšPath, width = 10} ƶl = G {path = ƶlPath, width = 10} ƶm = G {path = ƶmPath, width = 11} -ƶn = G {path = ƶnPath, width = 10} +ƶn = G {path = ƶnPath, width = 9.75} ƶr = G {path = ƶrPath, width = 10} ƶč = G {path = ƶčPath, width = 10} ƶǧ = G {path = ƶǧPath, width = 10} ƶw = G {path = ƶwPath, width = 11} ƶh = G {path = ƶhPath, width = 13} ƶf = G {path = ƶfPath, width = 11} -ƶj = G {path = ƶjPath, width = 7} +ƶj = G {path = ƶjPath, width = 7.5} ƶ0 = G {path = ƶ0Path, width = 3.5} ƶPath = gHat <> dPath @@ -168,21 +168,21 @@ dLong = dFree <> shiftX 1.5 dJoin ƶšPath = dPart <> shiftX 5 šPath ƶlPath = dPart <> shiftX 5 lPath ƶmPath = dPart <> shiftX 5 mPath -ƶnPath = dPart' <> shiftX 5 nPath -- TODO dPart or dPart'? +ƶnPath = dPart' <> shiftX 4.75 nPath ƶrPath = dPart <> shiftX 5 rCursive ƶčPath = dFree <> shiftX 5 čPath ƶǧPath = dFree <> shiftX 5 ǧPath ƶwPath = dPart' <> shiftX 5 wPath ƶhPath = dPart <> shiftX 5 hPath ƶfPath = dFree <> shiftX 4 fPath -ƶjPath = dFree <> shiftX 2 jPath +ƶjPath = dFree <> shiftX 4.5 jPathShort ƶ0Path = dFree <> P [mA (1,7), cR (1.8,-0.25) (2.2,0) (2.5,0.5)] pGlyphs = [("p", p), ("pp", pp), ("ps", ps), ("pj", pj)] p = G {path = pPath, width = 5.5} -pp = G {path = ppPath, width = 8} +pp = G {path = ppPath, width = 9} ps = G {path = psPath, width = 10.5} pj = G {path = pjPath, width = 10} @@ -197,7 +197,6 @@ ppPath = P [mA (1.5,5), cR (-1,-3) (-2,-4) (0,-5), cR (1,-0.5) (2.5,-0.5) (7.5,0)] <> shiftX 8.75 aPath psPath = pPart <> shiftX 5.5 sPath --- pjPath = pPath <> shiftX 7 jPath pjPath = shiftX 2 pInit <> P [cR (-1,-3) (-2,-4) (0,-5), cR (1,-0.5) (4,-1) (4,1), @@ -224,59 +223,55 @@ sGlyphs = [("s",s), ("st",st), ("sk",sk), ("sg",sg), ("sd",sd), ("sƶ",sƶ), ("sf",sf), ("sj",sj)] s = G {path = sPath, width = 5.125} -st = G {path = stPath, width = 9.5} +st = G {path = stPath, width = 8.5} sk = G {path = skPath, width = 9} sg = G {path = sgPath, width = 9} sd = G {path = sdPath, width = 9} sƶ = G {path = sƶPath, width = 9} sp = G {path = spPath, width = 9.5} -sb = G {path = sbPath, width = 10} +sb = G {path = sbPath, width = 10.5} ss = G {path = ssPath, width = 10} sš = G {path = sšPath, width = 10} -sl = G {path = slPath, width = 9.5} -sm = G {path = smPath, width = 11} -sn = G {path = snPath, width = 10} -sr = G {path = srPath, width = 9} +sl = G {path = slPath, width = 9} +sm = G {path = smPath, width = 10.5} +sn = G {path = snPath, width = 9.5} +sr = G {path = srPath, width = 7} sč = G {path = sčPath, width = 9} sǧ = G {path = sǧPath, width = 10} sw = G {path = swPath, width = 10} sh = G {path = shPath, width = 13} -sf = G {path = sfPath, width = 10} -sj = G {path = sjPath, width = 6} +sf = G {path = sfPath, width = 10.25} +sj = G {path = sjPath, width = 5} s0 = G {path = s0Path, width = 5} -sPath = sPartLine <> shiftX 5 aPath --- sPart = P [mA (0, 0), lR (0, 3.5), aR 1.5 1.5 0 Small CCW (3,0), lR (0,-3.5)] -sPart = P [mA (0, 0), +sPath = sPartLine <> shiftX 4.75 aPath +sPart' = P [mA (0, 0), cR (0.15,0.5) (0,2.5) (0,3.5), - aR 1.5 1.5 0 Small CCW (3,0), - qR (0,-3) (-0.5, -3.5)] -sPartIso = P [mA (0, 0), - cR (0.15,0.5) (0,2.5) (0,3.5), - aR 1.5 1.5 0 Small CCW (3,0), - cR (0,-0.5) (-0.15,-2.5) (0,-3.5)] -sPartLine = sPart <> P [mA (2.5,0), lR (2.5,0)] -stPath = sPartLine <> shiftX 4 tPath + aR 1.5 1.5 0 Small CCW (3,0)] +sPart = sPart' <> P [qR (0,-3) (-0.5,-3.5)] +sPartIso = sPart' <> P [cR (0,-0.5) (-0.15,-2.5) (0,-3.5)] +sPartLine = sPart <> P [mA (2.5,0), qR (1,0.25) (2.5,0)] +stPath = sPart <> P [lR (1,0)] <> shiftX 3.5 tNarrow skPath = sPartLine <> shiftX 5 kShort sgPath = sPartLine <> shiftX 5 gShort sdPath = sPart <> P [mA (2.5,0), lR (1.5,0)] <> shiftX 4 dPath sƶPath = sPart <> P [mA (2.5,0), lR (1.5,0)] <> shiftX 4 ƶPath spPath = sPartIso <> shiftX 4 pPath --- TODO -sbPath = sPartIso <> shiftX 4 bPath <> P [mA (3,0), lR (0,-3), lR (3.5,0), mA (10,5)] +sbPath = sPart' <> + P [cR (0,-2.5) (-0.25,-2.5) (0,-6.5), qR (2,0.5) (7.5,0), lR (0,8)] <> + shiftX 4.5 wPart <> P [mA (10.5,5)] ssPath = sPartLine <> shiftX 5 sPath sšPath = sPartLine <> shiftX 5 šPath -slPath = sPart <> P [mA (2.5,0), lR (3.5,0)] <> shiftX 4.5 lPath -smPath = sPart <> P [mA (2.5,0), lR (3,0)] <> shiftX 5 mPath -snPath = sPart <> P [mA (2.5,0), lR (4.5,0)] <> shiftX 5 nPath -srPath = sPart <> P [mA (2.5,0), lR (4.5,0)] <> shiftX 4 rShort +slPath = sPart <> P [mA (2.5,0), qR (1.25,0.5) (3.5,0)] <> shiftX 4.5 lPath +smPath = sPartLine <> shiftX 4.5 mPath +snPath = sPart <> P [mA (2.5,0), qR (1.5,0.5) (4.5,0)] <> shiftX 4.5 nPath +srPath = sPart <> P [mA (2.5,0), qR (2,0.75) (4.5,0.25)] <> shiftX 4 rShort sčPath = sPart <> P [mA (2.5,0), lR (1.5,0)] <> shiftX 3 čFlat sǧPath = sPartIso <> shiftX 4 ǧPath swPath = sPart <> P [mA (2.5,0), lR (4,0)] <> shiftX 4 wPath shPath = sPartIso <> shiftX 5 hPath -sfPath = sPartIso <> shiftX 4 fPath -sjPath = P [mA (0,0), lR (0,3.5), aR 1.5 1.5 0 Small CCW (3,0), lR (0,-1.5), - mA (3,0), lR (3,0), lR (0,5), mA (3,2), lR (3,0)] +sfPath = sPartIso <> shiftX 4.25 fPath +sjPath = sPartLine <> jTall s0Path = sPath <> P [mA (1.5,7), cR (1.8,-0.25) (2.6,0) (3,0.5)] @@ -307,8 +302,8 @@ s0Path = sPath <> P [mA (1.5,7), cR (1.8,-0.25) (2.6,0) (3,0.5)] šj = s2š sj š0 = s2š s0 -šLine = P [mA (0.5,-1.5), lR (2,0)] -ššPath = ssPath <> P [mA (1,-2), lR (7,0), mA (10,5)] +šLine = P [mA (0.5,-2.25), qR (1.5,-0.25) (2,0.25)] +ššPath = P [mA (0.5,-2), cR (2,-1) (5,1) (7,0)] <> ssPath špPath = šLine <> spPath šbPath = sPart <> šLine <> P [mA (3,0), lR (4,0)] <> shiftX 4 bPath s2š g@(G {path}) = g {path = šLine <> path} @@ -331,14 +326,14 @@ lb = G {path = lbPath, width = 10.5} ls = G {path = lsPath, width = 9.5} lš = G {path = lšPath, width = 9.5} lm = G {path = lmPath, width = 10.5} -ln = G {path = lnPath, width = 9.5} -lr = G {path = lrPath, width = 9.5} +ln = G {path = lnPath, width = 9.25} +lr = G {path = lrPath, width = 8} lč = G {path = lčPath, width = 9.5} lǧ = G {path = lǧPath, width = 9.5} lw = G {path = lwPath, width = 10.5} lh = G {path = lhPath, width = 12.5} lf = G {path = lfPath, width = 10.5} -lj = G {path = ljPath, width = 4.5} +lj = G {path = ljPath, width = 5} l0 = G {path = l0Path, width = 3.75} lPath = lPart <> P [mA (4.5,0), lR (0,5)] @@ -363,14 +358,14 @@ lbPath = lPart' <> shiftX 4.5 bPath lsPath = lPart <> shiftX 4.5 sPath lšPath = lPart <> shiftX 4.5 šPath lmPath = lPart <> shiftX 4.5 mPath -lnPath = lPart' <> shiftX 4.5 nPath -- TODO lPart or lPart'? -lrPath = lPart <> shiftX 4.5 rCursive +lnPath = lPart' <> shiftX 4.25 nPath +lrPath = lPart <> P [qR (0,1.5) (1,1.5), qR (2,0) (2,-2), mR (0,-6), lR (0,8)] lčPath = lFree' <> shiftX 4.5 čPath lǧPath = lFree' <> shiftX 4.5 ǧPath lwPath = lPart' <> shiftX 4.5 wPath lhPath = lPart <> shiftX 4.5 hPath lfPath = lFree' <> shiftX 4.5 fPath -ljPath = lPart <> shiftX 0.5 gShortHat <> P [mA (4.5,-3), lR (0,8)] +ljPath = lFree' <> jTall l0Path = lFree <> P [mA (1.25,7), cR (1.8,-0.25) (2.2,0) (2.5,0.5)] @@ -439,49 +434,51 @@ nk = G {path = nkPath, width = 9} ng = G {path = ngPath, width = 9} nd = G {path = ndPath, width = 10} nƶ = G {path = nƶPath, width = 10} -np = G {path = npPath, width = 10} +np = G {path = npPath, width = 10.25} nb = G {path = nbPath, width = 11} ns = G {path = nsPath, width = 10} nš = G {path = nšPath, width = 10} nl = G {path = nlPath, width = 10} nm = G {path = nmPath, width = 11} nn = G {path = nnPath, width = 10} -nr = G {path = nrPath, width = 6} +nr = G {path = nrPath, width = 6.5} nč = G {path = nčPath, width = 10} -nǧ = G {path = nǧPath, width = 9.5} +nǧ = G {path = nǧPath, width = 9.75} nw = G {path = nwPath, width = 11} nh = G {path = nhPath, width = 13} -nf = G {path = nfPath, width = 10.5} -nj = G {path = njPath, width = 5} +nf = G {path = nfPath, width = 10.75} +nj = G {path = njPath, width = 5.25} n0 = G {path = n0Path, width = 3.5} nPath = nPart <> P [mA (5,0), lR (0,5)] -nPart = nPart' <> dJoin -nPart' = P [mA (3.5,1.5), cR (0,-1) (-0.5,-1.5) (-1,-1.5), - aR 2.5 2.5 0 Large CCW (0,5)] -nLong = nPart' <> P [mA (2.5,5), lR (1.5,0)] <> shiftX 1.5 dJoin +nPart = nPart' <> P [cR (1.6,-0.25) (2.5,-1.75) (2.5,-2.5)] +nPart' = P [mA (3.5,1), cR (0.5,-1) (-0.5,-1.125) (-1,-1), + cR (-3.2,0.5) (-3.2,5.5) (0,5)] +nLong = nPart' <> P [cR (1.6,-0.25) (4,-1) (4,-2.5)] nFlat = P [mA (5,0), lR (-2.5,0), aR 2.5 2.5 0 Large CCW (0,5), cR (0.5,0) (1,-0.5) (1,-1.5)] +nFree = nPart' <> P [qR (0.8,-0.125) (1.5,-1)] +nFree' = nPart' <> P [qR (0.8,-0.125) (1,-1)] ntPath = nLong <> shiftX 5 tPath nkPath = nFlat <> shiftX 5 kShort ngPath = nFlat <> shiftX 5 gShort ndPath = nFlat <> shiftX 5 dPath nƶPath = nFlat <> shiftX 5 ƶPath -npPath = ńPath <> shiftX 4.5 pPath +npPath = nFree <> shiftX 4.75 pPath nbPath = nFlat <> P [mA (5,0), lR (2,0)] <> shiftX 5 bPath nsPath = nFlat <> shiftX 5 sPath nšPath = nFlat <> shiftX 5 šPath nlPath = nFlat <> P [mA (5,0), lR (1,0)] <> shiftX 5 lPath nmPath = nFlat <> P [mA (5,0), lR (0.5,0)] <> shiftX 5 mPath nnPath = nFlat <> P [mA (5,0), lR (2,0)] <> shiftX 5 nPath -nrPath = nPart' <> P [mA (2.5,5), lR (0.5,0)] <> shiftX 3 rShort +nrPath = nFree' <> P [qR (0,1) (1,1), qR (2,0) (2,-2), mR (0,-6), lR (0,8)] nčPath = nFlat <> shiftX 4 čFlat -nǧPath = ńPath <> shiftX 4.5 ǧPath +nǧPath = nFree' <> shiftX 4.75 ǧPath nwPath = nFlat <> P [mA (5,0), lR (2,0)] <> shiftX 5 wPath nhPath = nFlat <> shiftX 5 hPath -nfPath = ńPath <> shiftX 4.5 fPath -njPath = ńPath <> P [mA (1,-3), lR (4,0), lR (0,8)] -n0Path = ńPath <> P [mA (1,7), cR (1.8,-0.25) (2.2,0) (2.5,0.5)] +nfPath = nFree' <> shiftX 4.75 fPath +njPath = nFree' <> jTall +n0Path = nFree <> P [mA (1,7), cR (1.8,-0.25) (2.2,0) (2.5,0.5)] rGlyphs = [("r", r), ("rt", rt), ("rk", rk), ("rg", rg), ("rd", rd), ("rƶ", rƶ), @@ -608,9 +605,11 @@ fnPath = fPath <> shiftX 7 nPath fmPath = fPart <> P [lR (0,1)] <> mBump <> mBump' <> P [mA (12,0), lR (0,5)] f0Path = fPath <> P [mA (1.5,7), cR (2.8,-0.35) (3.1,0) (3.5,0.5)] -j = G {path = jPath, width = 5} +j = G {path = jPath, width = 4} -jPath = P [mA (0,0), lR (5,0)] <> shiftX 4.75 aPath +jPath = P [mA (0,0), qR (1.25,0.5) (4,0)] <> shiftX 3.75 aPath +jPathShort = P [mA (0,0), qR (1,0.25) (3,0)] <> shiftX 2.75 aPath +jTall = gHat <> P [lR (0,8)] vGlyphs = [("a", a), ("á", á), ("i", i), ("í", í), ("u", u), ("ú", ú), @@ -628,7 +627,7 @@ au = G {path = auPath, width = 4.5} ia = G {path = iaPath, width = 5} ua = G {path = uaPath, width = 4.5} ḿ = G {path = ḿPath, width = 6} -ń = G {path = ńPath, width = 3} +ń = G {path = ńPath, width = 4} ł = G {path = łPath, width = 3.75} ŕ = G {path = ŕPath, width = 5} @@ -650,9 +649,7 @@ uaPath = uNarrow <> shiftX 4.5 aPath aR 1.5 1.5 0 Small CCW (3,0), lR (0,-2), mA (5.5,0), cR (0.25,0.2) (0.5,2.25) (0.5,3.5), aR 1.5 1.5 0 Small CW (-3,0)] -ńPath = P [mA (3.5,1.5), cR (0,-1) (-0.5,-1.5) (-1,-1.5), - aR 2.5 2.5 0 Large CCW (0,5), - cR (0.5,0) (1,-0.5) (1,-1.5)] +ńPath = nFree łPath = lFree ŕPath = rPart <> P [mA (5,0), lR (0,5)] @@ -679,12 +676,17 @@ dḿ = da <> P [mR (-4,-3), cR (-0.375,1.125) (-0.25,1.275) (-0.25,1.375), lR (0,-1), mR (0,1), aR 0.625 0.625 0 Small CCW (1.5,0), cR (0.125,-0.1) (0,-1.125) (-0.25,-1.375)] -dń = da <> P [mR (-3,-2.5), aR 1 1 0 Small CCW (0,2)] -dł = da <> P [mR (-1.5,-3.5), cR (-1.125,-0.375) (-1.275,-0.25) (-1.375,-0.25), - aR 0.625 0.625 0 Small CCW (0,1.5), - lR (1,0), mR (-1,0), - aR 0.625 0.625 0 Small CCW (0,1.5), - cR (0.1,0.125) (1.125,0) (1.375,-0.25)] +dń = da <> P [mR (-2,-2.5), + qR (0.25,-0.625) (-0.5,-0.5), + cR (-1.5,0.25) (-1.5,2.75) (0,2.5), + qR (0.375,-0.0625) (0.5,-0.3)] +dł = da <> + P [mR (-2,-2.75), + cR (0.125,-0.125) (0,-0.375) (-0.625,-0.25), + cR (-0.75,0.15) (-1,1.25) (0,1.25), + lR (0.375,0), mR (-0.625,0), + cR (-0.75,0.15) (-1,1.25) (0,1.25), + qR (1,0) (1.125,-0.375)] dŕ = da <> P [mR (-3,0), cR (1,0) (3,-1) (3,-2)] punctuation :: Map Text Glyph -- 2.39.2 From acc07cf6aaa7b75a35638e0caed589442ec48aed Mon Sep 17 00:00:00 2001 From: Rhiannon Morris Date: Mon, 10 May 2021 16:16:03 +0200 Subject: [PATCH 10/13] more glyphs --- laantas-script/Glyphs.hs | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/laantas-script/Glyphs.hs b/laantas-script/Glyphs.hs index 0884ebe..e0de361 100644 --- a/laantas-script/Glyphs.hs +++ b/laantas-script/Glyphs.hs @@ -123,8 +123,8 @@ d = G {path = dPath, width = 5} dPath = dPart <> P [mA (5,-3), lR (0,8)] dPart' = dBase <> dJoin' dPart = dBase <> dJoin -dJoin = P [{-mA (2,5),-} cR (2,0) (3,-0.75) (3,-1.5)] -dJoin' = P [{-mA (2,5),-} cR (1.75,0) (2.5,-0.75) (2.85,-2.5)] +dJoin = P [cR (2,0) (3,-0.75) (3,-1.5)] +dJoin' = P [cR (1.75,0) (2.5,-0.75) (2.85,-2.5)] dBase = P [mA (0,0), lR (3.5,0), cR (0,1.5) (-3.5,3.5) (-3.5,5), lR (2,0)] dFree = dBase <> P [mA (2,5), lR (1.5,0)] dLong = dFree <> shiftX 1.5 dJoin @@ -147,12 +147,12 @@ dLong = dFree <> shiftX 1.5 dJoin ƶl = G {path = ƶlPath, width = 10} ƶm = G {path = ƶmPath, width = 11} ƶn = G {path = ƶnPath, width = 9.75} -ƶr = G {path = ƶrPath, width = 10} +ƶr = G {path = ƶrPath, width = 8} ƶč = G {path = ƶčPath, width = 10} ƶǧ = G {path = ƶǧPath, width = 10} ƶw = G {path = ƶwPath, width = 11} ƶh = G {path = ƶhPath, width = 13} -ƶf = G {path = ƶfPath, width = 11} +ƶf = G {path = ƶfPath, width = 10} ƶj = G {path = ƶjPath, width = 7.5} ƶ0 = G {path = ƶ0Path, width = 3.5} @@ -169,7 +169,7 @@ dLong = dFree <> shiftX 1.5 dJoin ƶlPath = dPart <> shiftX 5 lPath ƶmPath = dPart <> shiftX 5 mPath ƶnPath = dPart' <> shiftX 4.75 nPath -ƶrPath = dPart <> shiftX 5 rCursive +ƶrPath = dPart <> P [qR (0,1.5) (1,1.5), qR (2,0) (2,-2), mR (0,-6), lR (0,8)] ƶčPath = dFree <> shiftX 5 čPath ƶǧPath = dFree <> shiftX 5 ǧPath ƶwPath = dPart' <> shiftX 5 wPath @@ -327,7 +327,7 @@ ls = G {path = lsPath, width = 9.5} lš = G {path = lšPath, width = 9.5} lm = G {path = lmPath, width = 10.5} ln = G {path = lnPath, width = 9.25} -lr = G {path = lrPath, width = 8} +lr = G {path = lrPath, width = 7.5} lč = G {path = lčPath, width = 9.5} lǧ = G {path = lǧPath, width = 9.5} lw = G {path = lwPath, width = 10.5} @@ -510,8 +510,6 @@ r0 = G {path = r0Path, width = 5} rPath = rPart <> P [mA (5,-3), lR (0,8)] rPart = P [mA (0,5), cR (3.5,0) (5,-1) (5,-2)] -rPartCursive = P [mA (0,3), cR (0,1) (1,2) (3,2), cR (1,0) (2,-1) (2,-2)] -rCursive = rPartCursive <> P [mA (5,-3), lR (0,8)] rPartMid = P [mA (0,5), cR (1.25,0) (3.5,-1) (3.5,-2)] rPartShort = P [mA (0,5), cR (1,0) (3,-1) (3,-2)] rShort = rPartShort <> P [mA (3,-3), lR (0,8)] @@ -598,9 +596,13 @@ fm = G {path = fmPath, width = 12} f0 = G {path = f0Path, width = 6} fPath = fPart <> P [lR (0,2.5)] -fPart = P [mA (3.5,2.5), lR (-1, 0), lR (0,2.5), - aR 2.5 2.5 0 Large CW (0,-5), lR (1,0), - aR 2.5 2.5 0 Small CW (2.5, 2.5)] +fPart = P [mA (4.25,2.5), + cR (0.5,-1) (-1.75,-1) (-1.75, 0), + cR (0,1) (1.75,0.75) (1.75,1.75), + cR (0,0.35) (-0.15,0.65) (-1.75,0.75), + cR (-3.2,0.5) (-3.2,-5) (1,-5.5), + cR (1.6,-0.25) (2.5,1) (2.5,3) + ] fnPath = fPath <> shiftX 7 nPath fmPath = fPart <> P [lR (0,1)] <> mBump <> mBump' <> P [mA (12,0), lR (0,5)] f0Path = fPath <> P [mA (1.5,7), cR (2.8,-0.35) (3.1,0) (3.5,0.5)] -- 2.39.2 From 284094ec4fbfb92cc7519173d047e2af2e68510b Mon Sep 17 00:00:00 2001 From: Rhiannon Morris Date: Tue, 11 May 2021 00:52:17 +0200 Subject: [PATCH 11/13] make diacritics width-aware --- laantas-script/Glyphs.hs | 69 +++++++++++++++++++----------------- laantas-script/GlyphsBase.hs | 37 +++++++++++++------ laantas-script/Split.hs | 18 +++++----- 3 files changed, 72 insertions(+), 52 deletions(-) diff --git a/laantas-script/Glyphs.hs b/laantas-script/Glyphs.hs index e0de361..b5b1cf8 100644 --- a/laantas-script/Glyphs.hs +++ b/laantas-script/Glyphs.hs @@ -1,7 +1,7 @@ {-# OPTIONS_GHC -Wno-missing-signatures -Wno-name-shadowing #-} module Glyphs - (Glyph (..), Segs (..), Piece, doGlyphs, + (Glyph (..), Diacritic, simpleDia, Segs (..), EGlyph, Word, doGlyphs, withSize, charHeight', lineHeight', spaceWidth', gap', charHeight, lineHeight, spaceWidth, gap, @@ -9,13 +9,12 @@ module Glyphs initials, finals, vowels, medials, num, numbers, punctuation, wave) where +import Prelude hiding (Word) import Data.Map (Map) import qualified Data.Map.Strict as Map import GlyphsBase -type Piece = (Glyph, [Segs]) - initials :: Map Text Glyph initials = Map.fromList $ tGlyphs <> kGlyphs <> ƶGlyphs <> sGlyphs <> šGlyphs <> lGlyphs <> @@ -28,7 +27,7 @@ finals = Map.fromList $ [("t",t0), ("ƶ", ƶ0), ("s",s0), ("š",š0), ("l",l0), ("m",m0), ("n", n0), ("r", r0), ("f", f0)] -medials :: Map Text Segs +medials :: Map Text [Diacritic] medials = Map.fromList $ [("a", da), ("á", dá), ("i", di), ("í", dí), ("u", du), ("ú", dú), ("ai", dai), ("au", dau), ("ia", dia), ("ua", dua), ("ḿ", dḿ), @@ -658,38 +657,42 @@ uaPath = uNarrow <> shiftX 4.5 aPath adot = P . circR 0.2 -da = P [lR (0,5)] -dá = da <> adot (-3.5,-3) <> adot (2,0) -di = da <> P [cR (1,-2) (3,-3) (0,-3)] -dí = da <> P [cR (1,-2) (4,-3) (-4,-3)] -du = da <> P [lR (-4,0)] -dú = du <> P [mR (4,-3), lR (-3,0)] +withWidth f w = (f w, w) +sP = simpleDia . P -dai = da <> P [mR (-4,-3), lR (2.5,0), lR (0,3)] -dau = da <> P [mR (-3,-3.5), - cR (-1.5,0.25) (-1.5,3.25) (0,3), - cR (1.5,-0.25) (1.5,-3.25) (0,-3), - cR (1,-0.25) (2,0.5) (3,0)] -dia = di <> adot (-1.5,0) -dua = du <> adot (2,-2) +-- dont move because letters like t have the join not quite at the edge +da = [sP [lR (0,5)]] +dá = da <> [withWidth \w -> P [mA (w/2-1,8), cR (0.75,-0.5) (1.25,0.5) (2,0)]] +di = da <> [sP [cR (1,-2) (3,-3) (0,-3)]] +dí = da <> [sP [cR (1,-2) (4,-3) (-4,-3)]] +du = da <> [sP [lR (-4,0)]] +dú = du <> [sP [mR (4,-3), lR (-3,0)]] -dḿ = da <> P [mR (-4,-3), cR (-0.375,1.125) (-0.25,1.275) (-0.25,1.375), - aR 0.625 0.625 0 Small CCW (1.5,0), - lR (0,-1), mR (0,1), - aR 0.625 0.625 0 Small CCW (1.5,0), - cR (0.125,-0.1) (0,-1.125) (-0.25,-1.375)] -dń = da <> P [mR (-2,-2.5), - qR (0.25,-0.625) (-0.5,-0.5), - cR (-1.5,0.25) (-1.5,2.75) (0,2.5), - qR (0.375,-0.0625) (0.5,-0.3)] +dai = da <> [sP [mR (-4,-3), lR (2.5,0), lR (0,3)]] +dau = da <> [sP [mR (-3,-3.5), + cR (-1.5,0.25) (-1.5,3.25) (0,3), + cR (1.5,-0.25) (1.5,-3.25) (0,-3), + cR (1,-0.25) (2,0.5) (3,0)]] +dia = di <> [withWidth \w -> adot (-w/2,0)] +dua = du <> [withWidth \w -> P [mA (w/2,7)] <> adot (0,0)] + +dḿ = da <> [sP [mR (-4,-3), cR (-0.375,1.125) (-0.25,1.275) (-0.25,1.375), + aR 0.625 0.625 0 Small CCW (1.5,0), + lR (0,-1), mR (0,1), + aR 0.625 0.625 0 Small CCW (1.5,0), + cR (0.125,-0.1) (0,-1.125) (-0.25,-1.375)]] +dń = da <> [sP [mR (-2,-2.5), + qR (0.25,-0.625) (-0.5,-0.5), + cR (-1.5,0.25) (-1.5,2.75) (0,2.5), + qR (0.375,-0.0625) (0.5,-0.3)]] dł = da <> - P [mR (-2,-2.75), - cR (0.125,-0.125) (0,-0.375) (-0.625,-0.25), - cR (-0.75,0.15) (-1,1.25) (0,1.25), - lR (0.375,0), mR (-0.625,0), - cR (-0.75,0.15) (-1,1.25) (0,1.25), - qR (1,0) (1.125,-0.375)] -dŕ = da <> P [mR (-3,0), cR (1,0) (3,-1) (3,-2)] + [sP [mR (-2,-2.75), + cR (0.125,-0.125) (0,-0.375) (-0.625,-0.25), + cR (-0.75,0.15) (-1,1.25) (0,1.25), + lR (0.375,0), mR (-0.625,0), + cR (-0.75,0.15) (-1,1.25) (0,1.25), + qR (1,0) (1.125,-0.375)]] +dŕ = da <> [sP [mR (-3,0), cR (1,0) (3,-1) (3,-2)]] punctuation :: Map Text Glyph punctuation = Map.fromList diff --git a/laantas-script/GlyphsBase.hs b/laantas-script/GlyphsBase.hs index 83c3606..e0e986d 100644 --- a/laantas-script/GlyphsBase.hs +++ b/laantas-script/GlyphsBase.hs @@ -3,8 +3,8 @@ module GlyphsBase (module GlyphsBase, module Svg) where import Svg hiding (shiftX, shiftY, shift, width, size) import qualified Svg -import Data.List.NonEmpty (NonEmpty (..)) -import Data.Semigroup (sconcat) +import Prelude hiding (Word) +import Data.Foldable import Numeric import Prelude hiding (Word) @@ -74,8 +74,14 @@ run m e@(E {size}) = textWidth = 0, textHeight = 0, firstOnLine = True} -type EGlyph = (Glyph, [Segs]) -type Word = [EGlyph] +type Word = [EGlyph] + +type EGlyph = (Glyph, [Diacritic]) + +type Diacritic = Double -> (Segs, Double) + +simpleDia :: Segs -> Diacritic +simpleDia ss w = (ss, w) doGlyphs :: [Word] -> Env -> Element doGlyphs gs e = wrap $ run act e where @@ -91,7 +97,12 @@ doGlyphs gs e = wrap $ run act e where glyphWidth :: EGlyph -> M Double -glyphWidth (G {width}, _) = (+) <$> withSize (* width) <*> gap +glyphWidth (G {width}, ss) = + let w = foldl (\x f -> snd $ f x) width ss in + (+) <$> withSize (* w) <*> gap + +totalWidth :: Double -> M Double +totalWidth width = (+) <$> withSize (* width) <*> gap wordWidth :: Word -> M Double wordWidth = fmap sum . traverse glyphWidth @@ -111,11 +122,17 @@ placeWord w = do pure e placeGlyph :: EGlyph -> M Element -placeGlyph g@(G {path = path1}, segss) = do - gwidth <- glyphWidth g - path' <- joinSegs $ sconcat (path1 :| segss) - modify \s@(S {x}) -> s {x = x + gwidth} - pure $ path_ [D_ <<- path'] +placeGlyph (G {path = path1, width = width1}, dias) = do + let (segs', width') = placeDia width1 dias + path <- joinSegs $ path1 <> segs' + width <- totalWidth width' + modify \s@(S {x}) -> s {x = x + width} + pure $ path_ [D_ <<- path] + +placeDia :: Double -> [Diacritic] -> (Segs, Double) +placeDia w dias = + flip runState w $ + fold <$> traverse state dias newline :: M () newline = do diff --git a/laantas-script/Split.hs b/laantas-script/Split.hs index 8a05280..a904453 100644 --- a/laantas-script/Split.hs +++ b/laantas-script/Split.hs @@ -29,8 +29,8 @@ maxFrom name i = longestWith name \x -> Map.lookup x i initial :: P Glyph initial = maxFrom "initial" initials -medial :: P Segs -medial = P [] <$ chunk "\\" <|> maxFrom "medial" medials +medial :: P [Diacritic] +medial = [] <$ chunk "\\" <|> maxFrom "medial" medials final :: P Glyph final = maxFrom "final" finals @@ -38,29 +38,29 @@ final = maxFrom "final" finals ivowel :: P Glyph ivowel = maxFrom "vowel" vowels -word :: P [Piece] +word :: P [EGlyph] word = [is <> f <> concat p | is <- some initMed, f <- fin, p <- many punct] where initMed = try $ - [(i, [m]) | i <- initial, m <- medial] <|> + (,) <$> initial <*> medial <|> [(v, []) | v <- ivowel] <|> dash fin = maybe [] (\x -> [(x, [])]) <$> optional final -number :: P [Piece] +number :: P [EGlyph] number = some (digit <|> hash) where hash = (num, []) <$ chunk "#" digit = [(numbers ! Char.digitToInt i, []) | i <- digitChar] -punct :: P [Piece] +punct :: P [EGlyph] punct = [[(p, [])] | p <- maxFrom "punctuation" punctuation] <* space -dash :: P Piece +dash :: P EGlyph dash = (wave, []) <$ chunk "–" -text :: P [[Piece]] +text :: P [[EGlyph]] text = space *> many (segment <* space) <* eof where segment = punct <|> number <|> word -split :: Text -> [[Piece]] +split :: Text -> [[EGlyph]] split = either (error . errorBundlePretty) id . parse text "" -- 2.39.2 From b5fde8f20568b895ad7f076b9f48c50f4b72f1df Mon Sep 17 00:00:00 2001 From: Rhiannon Morris Date: Thu, 20 May 2021 22:49:16 +0200 Subject: [PATCH 12/13] add glyph fields for vowel attachment points [not used yet] --- laantas-script/Glyphs.hs | 403 ++++++++++++++-------------- laantas-script/GlyphsBase.hs | 38 ++- laantas-script/Svg.hs | 13 +- laantas-script/laantas-script.cabal | 3 +- 4 files changed, 242 insertions(+), 215 deletions(-) diff --git a/laantas-script/Glyphs.hs b/laantas-script/Glyphs.hs index b5b1cf8..d2be880 100644 --- a/laantas-script/Glyphs.hs +++ b/laantas-script/Glyphs.hs @@ -42,27 +42,27 @@ tGlyphs = [("t",t), ("tt",tt), ("tk",tk), ("tg",tg), ("td",td), ("tƶ",tƶ), ("tn",tn), ("tr",tr), ("tč",tč), ("tǧ",tǧ), ("tw",tw), ("th",th), ("tf",tf), ("tj",tj)] -t = G {path = tPath, width = 5.5} -tt = G {path = ttPath, width = 7} -tk = G {path = tkPath, width = 9} -tg = G {path = tgPath, width = 9} -td = G {path = tdPath, width = 9} -tƶ = G {path = tƶPath, width = 9} -tp = G {path = tpPath, width = 9.5} -tb = G {path = tbPath, width = 10} -ts = G {path = tsPath, width = 9} -tš = G {path = tšPath, width = 9} -tl = G {path = tlPath, width = 8.5} -tm = G {path = tmPath, width = 10} -tn = G {path = tnPath, width = 9} -tr = G {path = trPath, width = 7} -tč = G {path = tčPath, width = 9} -tǧ = G {path = tǧPath, width = 10} -tw = G {path = twPath, width = 10} -th = G {path = thPath, width = 12} -tf = G {path = tfPath, width = 10} -tj = G {path = tjPath, width = 4.75} -t0 = G {path = t0Path, width = 5} +t = simpleG tPath 5.5 +tt = simpleG ttPath 7 +tk = simpleG tkPath 9 +tg = simpleG tgPath 9 +td = simpleG tdPath 9 +tƶ = simpleG tƶPath 9 +tp = simpleG tpPath 9.5 +tb = simpleG tbPath 10 +ts = simpleG tsPath 9 +tš = simpleG tšPath 9 +tl = simpleG tlPath 8.5 +tm = simpleG tmPath 10 +tn = simpleG tnPath 9 +tr = simpleG trPath 7 +tč = simpleG tčPath 9 +tǧ = simpleG tǧPath 10 +tw = simpleG twPath 10 +th = simpleG thPath 12 +tf = simpleG tfPath 10 +tj = simpleG tjPath 4.75 +t0 = simpleG t0Path 5 tPath = P [mA (0,0), lA (5.5,0)] <> shiftX 1.5 aPath <> shiftX 5.25 aPath tNarrow = P [mA (0,0), lA (5,0)] <> shiftX 1.5 aPath <> shiftX 4.75 aPath @@ -95,9 +95,9 @@ t0Path = tPath <> P [mA (1.5,7), cR (1.8,-0.25) (3.1,0) (3.5,0.5)] kGlyphs = [("k", k), ("kk", kk), ("ks", ks)] -k = G {path = kPath, width = 5} -kk = G {path = kkPath, width = 8} -ks = G {path = ksPath, width = 9} +k = simpleG kPath 5 +kk = simpleG kkPath 8 +ks = simpleG ksPath 9 kLeft = P [mA (0,0), cR (0.5,0.75) (0,3) (0,5)] kBottomShort = P [cR (0,0) (2.6,0) (4,-0.5)] @@ -109,7 +109,7 @@ kkPath = kShortPart <> shiftX 4 kShort ksPath = kShortPart <> shiftX 4 sPath -g = G {path = gPath, width = 5} +g = simpleG gPath 5 gPath = gHat <> kPath gHat = P [mA (1.5,-2.75), qR (1.5,0.125) (3.5,-0.25)] @@ -117,7 +117,7 @@ gShort = gShortHat <> kShort gShortHat = P [mA (1.25,-2.75), qR (1.25,0.125) (2.75,-0.25)] -d = G {path = dPath, width = 5} +d = simpleG dPath 5 dPath = dPart <> P [mA (5,-3), lR (0,8)] dPart' = dBase <> dJoin' @@ -133,27 +133,27 @@ dLong = dFree <> shiftX 1.5 dJoin ("ƶm",ƶm), ("ƶn",ƶn), ("ƶr",ƶr), ("ƶč",ƶč), ("ƶǧ",ƶǧ), ("ƶw",ƶw), ("ƶh",ƶh), ("ƶf",ƶf), ("ƶj",ƶj)] -ƶ = G {path = ƶPath, width = 5} -ƶt = G {path = ƶtPath, width = 10.5} -ƶk = G {path = ƶkPath, width = 9} -ƶg = G {path = ƶgPath, width = 9} -ƶd = G {path = ƶdPath, width = 10} -ƶƶ = G {path = ƶƶPath, width = 10} -ƶp = G {path = ƶpPath, width = 10.5} -ƶb = G {path = ƶbPath, width = 11} -ƶs = G {path = ƶsPath, width = 10} -ƶš = G {path = ƶšPath, width = 10} -ƶl = G {path = ƶlPath, width = 10} -ƶm = G {path = ƶmPath, width = 11} -ƶn = G {path = ƶnPath, width = 9.75} -ƶr = G {path = ƶrPath, width = 8} -ƶč = G {path = ƶčPath, width = 10} -ƶǧ = G {path = ƶǧPath, width = 10} -ƶw = G {path = ƶwPath, width = 11} -ƶh = G {path = ƶhPath, width = 13} -ƶf = G {path = ƶfPath, width = 10} -ƶj = G {path = ƶjPath, width = 7.5} -ƶ0 = G {path = ƶ0Path, width = 3.5} +ƶ = simpleG ƶPath 5 +ƶt = simpleG ƶtPath 10.5 +ƶk = simpleG ƶkPath 9 +ƶg = simpleG ƶgPath 9 +ƶd = simpleG ƶdPath 10 +ƶƶ = simpleG ƶƶPath 10 +ƶp = simpleG ƶpPath 10.5 +ƶb = simpleG ƶbPath 11 +ƶs = simpleG ƶsPath 10 +ƶš = simpleG ƶšPath 10 +ƶl = simpleG ƶlPath 10 +ƶm = simpleG ƶmPath 11 +ƶn = simpleG ƶnPath 9.75 +ƶr = simpleG ƶrPath 8 +ƶč = simpleG ƶčPath 10 +ƶǧ = simpleG ƶǧPath 10 +ƶw = simpleG ƶwPath 11 +ƶh = simpleG ƶhPath 13 +ƶf = simpleG ƶfPath 10 +ƶj = simpleG ƶjPath 7.5 +ƶ0 = simpleG ƶ0Path 3.5 ƶPath = gHat <> dPath ƶtPath = dLong <> shiftX 5 tPath @@ -180,10 +180,10 @@ dLong = dFree <> shiftX 1.5 dJoin pGlyphs = [("p", p), ("pp", pp), ("ps", ps), ("pj", pj)] -p = G {path = pPath, width = 5.5} -pp = G {path = ppPath, width = 9} -ps = G {path = psPath, width = 10.5} -pj = G {path = pjPath, width = 10} +p = simpleG pPath 5.5 +pp = simpleG ppPath 9 +ps = simpleG psPath 10.5 +pj = simpleG pjPath 10 pInit = P [mA (0,-3), cR (-1,1) (-0.5,6) (-0.5,8)] @@ -206,8 +206,8 @@ pjPath = bGlyphs = [("b", b), ("bj", bj)] -b = G {path = bPath, width = 6} -bj = G {path = bjPath, width = 9} +b = simpleG bPath 6 +bj = simpleG bjPath 9 bPath = shiftX 1 gHat <> wPart <> P [mA (6,-3), lR (0,8)] bjPath = @@ -221,27 +221,27 @@ sGlyphs = [("s",s), ("st",st), ("sk",sk), ("sg",sg), ("sd",sd), ("sƶ",sƶ), ("sn",sn), ("sr",sr), ("sč",sč), ("sǧ",sǧ), ("sw",sw), ("sh",sh), ("sf",sf), ("sj",sj)] -s = G {path = sPath, width = 5.125} -st = G {path = stPath, width = 8.5} -sk = G {path = skPath, width = 9} -sg = G {path = sgPath, width = 9} -sd = G {path = sdPath, width = 9} -sƶ = G {path = sƶPath, width = 9} -sp = G {path = spPath, width = 9.5} -sb = G {path = sbPath, width = 10.5} -ss = G {path = ssPath, width = 10} -sš = G {path = sšPath, width = 10} -sl = G {path = slPath, width = 9} -sm = G {path = smPath, width = 10.5} -sn = G {path = snPath, width = 9.5} -sr = G {path = srPath, width = 7} -sč = G {path = sčPath, width = 9} -sǧ = G {path = sǧPath, width = 10} -sw = G {path = swPath, width = 10} -sh = G {path = shPath, width = 13} -sf = G {path = sfPath, width = 10.25} -sj = G {path = sjPath, width = 5} -s0 = G {path = s0Path, width = 5} +s = simpleG sPath 5.125 +st = simpleG stPath 8.5 +sk = simpleG skPath 9 +sg = simpleG sgPath 9 +sd = simpleG sdPath 9 +sƶ = simpleG sƶPath 9 +sp = simpleG spPath 9.5 +sb = simpleG sbPath 10.5 +ss = simpleG ssPath 10 +sš = simpleG sšPath 10 +sl = simpleG slPath 9 +sm = simpleG smPath 10.5 +sn = simpleG snPath 9.5 +sr = simpleG srPath 7 +sč = simpleG sčPath 9 +sǧ = simpleG sǧPath 10 +sw = simpleG swPath 10 +sh = simpleG shPath 13 +sf = simpleG sfPath 10.25 +sj = simpleG sjPath 5 +s0 = simpleG s0Path 5 sPath = sPartLine <> shiftX 4.75 aPath sPart' = P [mA (0, 0), @@ -313,29 +313,29 @@ lGlyphs = [("l",l), ("ll", ll), ("lt",lt), ("lk",lk), ("lg",lg), ("ld",ld), ("ln",ln), ("lr",lr), ("lč",lč), ("lǧ",lǧ), ("lw",lw), ("lh",lh), ("lf",lf), ("lj",lj)] -l = G {path = lPath, width = 4.5} -ll = G {path = llPath, width = 9} -lt = G {path = ltPath, width = 10} -lk = G {path = lkPath, width = 8.5} -lg = G {path = lgPath, width = 8.5} -ld = G {path = ldPath, width = 9.5} -lƶ = G {path = lƶPath, width = 9.5} -lp = G {path = lpPath, width = 10} -lb = G {path = lbPath, width = 10.5} -ls = G {path = lsPath, width = 9.5} -lš = G {path = lšPath, width = 9.5} -lm = G {path = lmPath, width = 10.5} -ln = G {path = lnPath, width = 9.25} -lr = G {path = lrPath, width = 7.5} -lč = G {path = lčPath, width = 9.5} -lǧ = G {path = lǧPath, width = 9.5} -lw = G {path = lwPath, width = 10.5} -lh = G {path = lhPath, width = 12.5} -lf = G {path = lfPath, width = 10.5} -lj = G {path = ljPath, width = 5} -l0 = G {path = l0Path, width = 3.75} +l = simpleG lPath 4.625 +ll = simpleG llPath 9 +lt = simpleG ltPath 10 +lk = simpleG lkPath 8.5 +lg = simpleG lgPath 8.5 +ld = simpleG ldPath 9.5 +lƶ = simpleG lƶPath 9.5 +lp = simpleG lpPath 10 +lb = simpleG lbPath 10.5 +ls = simpleG lsPath 9.5 +lš = simpleG lšPath 9.5 +lm = simpleG lmPath 10.5 +ln = simpleG lnPath 9.25 +lr = simpleG lrPath 7.5 +lč = simpleG lčPath 9.5 +lǧ = simpleG lǧPath 9.5 +lw = simpleG lwPath 10.5 +lh = simpleG lhPath 12.5 +lf = simpleG lfPath 10.5 +lj = simpleG ljPath 5 +l0 = simpleG l0Path 3.75 -lPath = lPart <> P [mA (4.5,0), lR (0,5)] +lPath = lPart <> shiftX 4.5 aPath lBase = P [mA (3,0.5), cR (0.25,-0.25) (0,-0.75) (-1.25,-0.5), cR (-1.5,0.3) (-2,2.5) (0,2.5), lR (0.75,0), mR (-1.25,0), @@ -373,27 +373,27 @@ mGlyphs = [("m",m), ("mt",mt), ("mk",mk), ("mg",mg), ("md",md), ("mƶ",mƶ), ("mn",mn), ("mr",mr), ("mč",mč), ("mǧ",mǧ), ("mw",mw), ("mh",mh), ("mf",mf), ("mj",mj)] -m = G {path = mPath, width = 6} -mt = G {path = mtPath, width = 10} -mk = G {path = mkPath, width = 10} -mg = G {path = mgPath, width = 10} -md = G {path = mdPath, width = 12} -mƶ = G {path = mƶPath, width = 12} -mp = G {path = mpPath, width = 12.5} -mb = G {path = mbPath, width = 12} -ms = G {path = msPath, width = 11} -mš = G {path = mšPath, width = 11} -ml = G {path = mlPath, width = 11} -mm = G {path = mmPath, width = 12} -mn = G {path = mnPath, width = 11} -mr = G {path = mrPath, width = 9} -mč = G {path = mčPath, width = 12} -mǧ = G {path = mǧPath, width = 12} -mw = G {path = mwPath, width = 12} -mh = G {path = mhPath, width = 14} -mf = G {path = mfPath, width = 13} -mj = G {path = mjPath, width = 9} -m0 = G {path = m0Path, width = 6} +m = simpleG mPath 6 +mt = simpleG mtPath 10 +mk = simpleG mkPath 10 +mg = simpleG mgPath 10 +md = simpleG mdPath 12 +mƶ = simpleG mƶPath 12 +mp = simpleG mpPath 12.5 +mb = simpleG mbPath 12 +ms = simpleG msPath 11 +mš = simpleG mšPath 11 +ml = simpleG mlPath 11 +mm = simpleG mmPath 12 +mn = simpleG mnPath 11 +mr = simpleG mrPath 9 +mč = simpleG mčPath 12 +mǧ = simpleG mǧPath 12 +mw = simpleG mwPath 12 +mh = simpleG mhPath 14 +mf = simpleG mfPath 13 +mj = simpleG mjPath 9 +m0 = simpleG m0Path 6 mPath = mPart <> P [mA (6,0), lR (0,5)] mInit = P [mA (0.5,0), cR (-0.25,0.2) (-0.5,2.25) (-0.5,3.5)] @@ -427,33 +427,33 @@ nGlyphs = [("n", n), ("nt", nt), ("nk", nk), ("ng", ng), ("nd", nd), ("nƶ", nƶ ("nm", nm), ("nn", nn), ("nr", nr), ("nč", nč), ("nǧ", nǧ), ("nw", nw), ("nh", nh), ("nf", nf), ("nj", nj)] -n = G {path = nPath, width = 5} -nt = G {path = ntPath, width = 10.5} -nk = G {path = nkPath, width = 9} -ng = G {path = ngPath, width = 9} -nd = G {path = ndPath, width = 10} -nƶ = G {path = nƶPath, width = 10} -np = G {path = npPath, width = 10.25} -nb = G {path = nbPath, width = 11} -ns = G {path = nsPath, width = 10} -nš = G {path = nšPath, width = 10} -nl = G {path = nlPath, width = 10} -nm = G {path = nmPath, width = 11} -nn = G {path = nnPath, width = 10} -nr = G {path = nrPath, width = 6.5} -nč = G {path = nčPath, width = 10} -nǧ = G {path = nǧPath, width = 9.75} -nw = G {path = nwPath, width = 11} -nh = G {path = nhPath, width = 13} -nf = G {path = nfPath, width = 10.75} -nj = G {path = njPath, width = 5.25} -n0 = G {path = n0Path, width = 3.5} +n = simpleG nPath 5.125 +nt = simpleG ntPath 10.5 +nk = simpleG nkPath 9 +ng = simpleG ngPath 9 +nd = simpleG ndPath 10 +nƶ = simpleG nƶPath 10 +np = simpleG npPath 10.25 +nb = simpleG nbPath 11 +ns = simpleG nsPath 10 +nš = simpleG nšPath 10 +nl = simpleG nlPath 10 +nm = simpleG nmPath 11 +nn = simpleG nnPath 10 +nr = simpleG nrPath 6.5 +nč = simpleG nčPath 10 +nǧ = simpleG nǧPath 9.75 +nw = simpleG nwPath 11 +nh = simpleG nhPath 13 +nf = simpleG nfPath 10.75 +nj = simpleG njPath 5.25 +n0 = simpleG n0Path 3.5 -nPath = nPart <> P [mA (5,0), lR (0,5)] +nPath = nPart <> shiftX 5 aPath nPart = nPart' <> P [cR (1.6,-0.25) (2.5,-1.75) (2.5,-2.5)] nPart' = P [mA (3.5,1), cR (0.5,-1) (-0.5,-1.125) (-1,-1), cR (-3.2,0.5) (-3.2,5.5) (0,5)] -nLong = nPart' <> P [cR (1.6,-0.25) (4,-1) (4,-2.5)] +nLong = nPart' <> P [cR (3.2,-0.5) (4,-1.5) (4,-2.5)] nFlat = P [mA (5,0), lR (-2.5,0), aR 2.5 2.5 0 Large CCW (0,5), cR (0.5,0) (1,-0.5) (1,-1.5)] nFree = nPart' <> P [qR (0.8,-0.125) (1.5,-1)] @@ -485,27 +485,27 @@ rGlyphs = [("r", r), ("rt", rt), ("rk", rk), ("rg", rg), ("rd", rd), ("rƶ", rƶ ("rm", rm), ("rn", rn), ("rr", rr), ("rč", rč), ("rǧ", rǧ), ("rw", rw), ("rh", rh), ("rf", rf), ("rj", rj)] -r = G {path = rPath, width = 5} -rt = G {path = rtPath, width = 7.5} -rk = G {path = rkPath, width = 7} -rg = G {path = rgPath, width = 7} -rd = G {path = rdPath, width = 9.5} -rƶ = G {path = rƶPath, width = 9.5} -rp = G {path = rpPath, width = 10} -rb = G {path = rbPath, width = 10.5} -rs = G {path = rsPath, width = 9.5} -rš = G {path = ršPath, width = 9.5} -rl = G {path = rlPath, width = 9.5} -rm = G {path = rmPath, width = 10.5} -rr = G {path = rrPath, width = 6} -rn = G {path = rnPath, width = 9} -rč = G {path = rčPath, width = 9.5} -rǧ = G {path = rǧPath, width = 9.5} -rw = G {path = rwPath, width = 10.5} -rh = G {path = rhPath, width = 12.5} -rf = G {path = rfPath, width = 10.5} -rj = G {path = rjPath, width = 7.5} -r0 = G {path = r0Path, width = 5} +r = simpleG rPath 5 +rt = simpleG rtPath 7.5 +rk = simpleG rkPath 7 +rg = simpleG rgPath 7 +rd = simpleG rdPath 9.5 +rƶ = simpleG rƶPath 9.5 +rp = simpleG rpPath 10 +rb = simpleG rbPath 10.5 +rs = simpleG rsPath 9.5 +rš = simpleG ršPath 9.5 +rl = simpleG rlPath 9.5 +rm = simpleG rmPath 10.5 +rr = simpleG rrPath 6 +rn = simpleG rnPath 9 +rč = simpleG rčPath 9.5 +rǧ = simpleG rǧPath 9.5 +rw = simpleG rwPath 10.5 +rh = simpleG rhPath 12.5 +rf = simpleG rfPath 10.5 +rj = simpleG rjPath 7.5 +r0 = simpleG r0Path 5 rPath = rPart <> P [mA (5,-3), lR (0,8)] rPart = P [mA (0,5), cR (3.5,0) (5,-1) (5,-2)] @@ -537,9 +537,9 @@ r0Path = ŕPath <> P [mA (1.25,7), cR (2.2,-0.25) (2.8,0) (3,0.5)] čGlyphs = [("č", č), ("čs", čs), ("čč", čč)] -č = G {path = čPath, width = 5} -čs = G {path = čsPath, width = 10} -čč = G {path = ččPath, width = 10} +č = simpleG čPath 5 +čs = simpleG čsPath 10 +čč = simpleG ččPath 10 čPath = čPart <> čJoin <> P [mA (5,0), lR (0,5)] čPart = P [mA (0,0.5), cR (2.25,-0.75) (2.55,-0.5) (2.75,-0.5)] <> čPart' @@ -553,7 +553,7 @@ r0Path = ŕPath <> P [mA (1.25,7), cR (2.2,-0.25) (2.8,0) (3,0.5)] ččPath = čPart <> shiftX 5 čPath -ǧ = G {path = ǧPath, width = 5} +ǧ = simpleG ǧPath 5 ǧPath = ǧPart <> čJoin <> P [mA (5,-3), lR (0,8)] ǧPart = P [mA (0,-2), cR (2.25,-0.75) (2.55,-0.5) (2.75,-0.5), @@ -565,7 +565,7 @@ r0Path = ŕPath <> P [mA (1.25,7), cR (2.2,-0.25) (2.8,0) (3,0.5)] cR (-0.2,0.25) (-2.25,0) (-2.75,-0.5)] -w = G {path = wPath, width = 6} +w = simpleG wPath 6 wPath = wPart <> shiftX 5.75 aPath wPart = uPath <> P [mA (2.5,0), lR (3.5,0)] @@ -573,10 +573,10 @@ wPart = uPath <> P [mA (2.5,0), lR (3.5,0)] hGlyphs = [("h", h), ("hh", hh), ("hn", hn), ("hm", hm)] -h = G {path = hPath, width = 8.5} -hh = G {path = hhPath, width = 16.5} -hn = G {path = hnPath, width = 15} -hm = G {path = hmPath, width = 16} +h = simpleG hPath 8.5 +hh = simpleG hhPath 16.5 +hn = simpleG hnPath 15 +hm = simpleG hmPath 16 hPath = hPart <> shiftX 3.5 gHat <> P [mA (8.5,-3), lR (0,8)] hPart' x = sPart <> P [mA (2.5,0), lR (1.5,0)] <> shiftX 4 x @@ -589,10 +589,10 @@ hmPath = hPath <> shiftX 10 mPath fGlyphs = [("f", f), ("fn", fn), ("fm", fm)] -f = G {path = fPath, width = 6} -fn = G {path = fnPath, width = 12} -fm = G {path = fmPath, width = 12} -f0 = G {path = f0Path, width = 6} +f = simpleG fPath 6 +fn = simpleG fnPath 12 +fm = simpleG fmPath 12 +f0 = simpleG f0Path 6 fPath = fPart <> P [lR (0,2.5)] fPart = P [mA (4.25,2.5), @@ -606,7 +606,7 @@ fnPath = fPath <> shiftX 7 nPath fmPath = fPart <> P [lR (0,1)] <> mBump <> mBump' <> P [mA (12,0), lR (0,5)] f0Path = fPath <> P [mA (1.5,7), cR (2.8,-0.35) (3.1,0) (3.5,0.5)] -j = G {path = jPath, width = 4} +j = simpleG jPath 4 jPath = P [mA (0,0), qR (1.25,0.5) (4,0)] <> shiftX 3.75 aPath jPathShort = P [mA (0,0), qR (1,0.25) (3,0)] <> shiftX 2.75 aPath @@ -617,20 +617,20 @@ vGlyphs = [("a", a), ("á", á), ("i", i), ("í", í), ("u", u), ("ú", ú), ("ai", ai), ("au", au), ("ia", ia), ("ua", ua), ("ḿ", ḿ), ("ń", ń), ("ł", ł), ("ŕ", ŕ)] -a = G {path = aPath, width = 0.125} -á = G {path = áPath, width = 2.125} +a = simpleG aPath 0.125 +á = simpleG áPath 2.125 i = j -í = G {path = íPath, width = 5} -u = G {path = uPath, width = 4.5} -ú = G {path = úPath, width = 4} -ai = G {path = aiPath, width = 5} -au = G {path = auPath, width = 4.5} -ia = G {path = iaPath, width = 5} -ua = G {path = uaPath, width = 4.5} -ḿ = G {path = ḿPath, width = 6} -ń = G {path = ńPath, width = 4} -ł = G {path = łPath, width = 3.75} -ŕ = G {path = ŕPath, width = 5} +í = simpleG íPath 5 +u = simpleG uPath 4.5 +ú = simpleG úPath 4 +ai = simpleG aiPath 5 +au = simpleG auPath 4.5 +ia = simpleG iaPath 5 +ua = simpleG uaPath 4.5 +ḿ = simpleG ḿPath 6 +ń = simpleG ńPath 4 +ł = simpleG łPath 3.75 +ŕ = simpleG ŕPath 5 aPath = P [mA (0.25,0), cR (-0.25,1) (-0.25,2) (-0.25,5)] áPath = aPath <> shiftX 2 aPath @@ -657,10 +657,10 @@ uaPath = uNarrow <> shiftX 4.5 aPath adot = P . circR 0.2 -withWidth f w = (f w, w) +withWidth f (SI {width}) = (f width, width) sP = simpleDia . P --- dont move because letters like t have the join not quite at the edge +-- no @mA@ because letters like t have the join not quite at the edge da = [sP [lR (0,5)]] dá = da <> [withWidth \w -> P [mA (w/2-1,8), cR (0.75,-0.5) (1.25,0.5) (2,0)]] di = da <> [sP [cR (1,-2) (3,-3) (0,-3)]] @@ -699,28 +699,29 @@ punctuation = Map.fromList [(".", eos), ("?", eos), ("!", eos), (",", eop), (":", eop), (";", eop), ("…", ellipsis)] -eos = G {path = eosPath, width = 4} +eos = simpleG eosPath 4 eosPath = P $ circA 1 (4,1) <> circA 1 (4,4) -eop = G {path = eopPath, width = 2} +eop = simpleG eopPath 2 eopPath = P $ circA 1 (3,2.5) -num = G {path = P [mA (0,0), lR (0,5), mA (1,0), lR (0,5)], width = 1} +num = simpleG path 1 + where path = P [mA (0,0), lR (0,5), mA (1,0), lR (0,5)] numbers = Map.fromList $ - zip [0..9::Int] [u, t, n2, G dFree 3, n4, n5, ł, ḿ, ń, f] -n2 = G n2Path 5 + zip [0..9::Int] [u, t, n2, simpleG dFree 3, n4, n5, ł, ḿ, ń, f] +n2 = simpleG n2Path 5 n2Path = P [mA (0,0), lR (0,5), sR (3,0) (5,-0.5), mA (5,0), lR (0,5)] -n4 = G n4Path 5 +n4 = simpleG n4Path 5 n4Path = P [mA (1.5,0), lR (0,5), sR (-1.5,-3) (-1.5,-5), lR (5,0), lR (0,5)] -n5 = G n5Path 4 +n5 = simpleG n5Path 4 n5Path = P [mA (0,5), lR (0,-3.5), aR 1.5 1.5 0 Small CW (1.5,-1.5), lR (1,0), aR 1.5 1.5 0 Small CW (1.5,1.5), lR (0,3.5)] wave :: Glyph -wave = G {path = wavePath, width = 4} - -wavePath = P [mA (0,2.5), cR (1.5,-2) (2.5,2) (4,0)] +wave = simpleG wavePath 4 ellipsis :: Glyph -ellipsis = G {path = shiftX 3.5 wavePath, width = 6} +ellipsis = simpleG (shiftX 3.5 wavePath) 6 + +wavePath = P [mA (0,2.5), cR (1.5,-2) (2.5,2) (4,0)] diff --git a/laantas-script/GlyphsBase.hs b/laantas-script/GlyphsBase.hs index e0e986d..2bdceb7 100644 --- a/laantas-script/GlyphsBase.hs +++ b/laantas-script/GlyphsBase.hs @@ -9,7 +9,17 @@ import Numeric import Prelude hiding (Word) -data Glyph = G {path :: Segs, width :: Double} +data Glyph = G {path :: Segs, size :: SizeInfo} + +data SizeInfo = SI { + width :: Double, -- ^ total width + right :: Double, -- ^ attachment point for e.g. a + center :: Double -- ^ attachment point for e.g. á + } + +simpleG :: Segs -> Double -> Glyph +simpleG path width = + G {path, size = SI {width, right = width, center = width/2}} -- | base amounts charHeight', lineHeight', spaceWidth', gap' :: Double @@ -78,10 +88,11 @@ type Word = [EGlyph] type EGlyph = (Glyph, [Diacritic]) -type Diacritic = Double -> (Segs, Double) +type Diacritic' a = SizeInfo -> (Segs, a) +type Diacritic = Diacritic' Double simpleDia :: Segs -> Diacritic -simpleDia ss w = (ss, w) +simpleDia ss (SI {width}) = (ss, width) doGlyphs :: [Word] -> Env -> Element doGlyphs gs e = wrap $ run act e where @@ -96,10 +107,13 @@ doGlyphs gs e = wrap $ run act e where doctype <> svg11_ content `with` sattrs +liftDia :: Diacritic -> Diacritic' SizeInfo +liftDia f sz = let (x, w) = f sz in (x, sz {width = w} :: SizeInfo) + glyphWidth :: EGlyph -> M Double -glyphWidth (G {width}, ss) = - let w = foldl (\x f -> snd $ f x) width ss in - (+) <$> withSize (* w) <*> gap +glyphWidth (G {size}, ss) = + let SI {width} = foldl (\x f -> snd $ liftDia f x) size ss in + (+) <$> withSize (* width) <*> gap totalWidth :: Double -> M Double totalWidth width = (+) <$> withSize (* width) <*> gap @@ -122,17 +136,17 @@ placeWord w = do pure e placeGlyph :: EGlyph -> M Element -placeGlyph (G {path = path1, width = width1}, dias) = do - let (segs', width') = placeDia width1 dias +placeGlyph (G {path = path1, size}, dias) = do + let (segs', width') = placeDias size dias path <- joinSegs $ path1 <> segs' width <- totalWidth width' modify \s@(S {x}) -> s {x = x + width} pure $ path_ [D_ <<- path] -placeDia :: Double -> [Diacritic] -> (Segs, Double) -placeDia w dias = - flip runState w $ - fold <$> traverse state dias +placeDias :: SizeInfo -> [Diacritic] -> (Segs, Double) +placeDias sz = + unlift . flip runState sz . fmap fold . traverse (state . liftDia) + where unlift (x, SI {width}) = (x, width) newline :: M () newline = do diff --git a/laantas-script/Svg.hs b/laantas-script/Svg.hs index 743e050..296c7ed 100644 --- a/laantas-script/Svg.hs +++ b/laantas-script/Svg.hs @@ -9,7 +9,8 @@ where import Control.Monad.Reader import Control.Monad.State import qualified Graphics.Svg as Base -import Graphics.Svg hiding (mA, mR, lA, lR, cA, cR, sA, sR, aA, aR, qA, qR) +import Graphics.Svg + hiding (mA, mR, lA, lR, cA, cR, sA, sR, aA, aR, qA, qR, tA, tR) import Data.Text (Text, pack) @@ -78,6 +79,16 @@ qR (x1, y1) (x2, y2) = Base.qR (x1 * size) (y1 * size) (x2 * size) (y2 * size) +tA :: Point -> M Text +tA (x1, y1) = + reader \E {size} -> + Base.tA (x1 * size) (y1 * size) + +tR :: Point -> M Text +tR (x1, y1) = + reader \E {size} -> + Base.tR (x1 * size) (y1 * size) + data Arc = Large | Small data Sweep = CW | CCW diff --git a/laantas-script/laantas-script.cabal b/laantas-script/laantas-script.cabal index c9c853a..9e84e4c 100644 --- a/laantas-script/laantas-script.cabal +++ b/laantas-script/laantas-script.cabal @@ -27,7 +27,8 @@ executable laantas-script MultiWayIf, NamedFieldPuns, OverloadedStrings, - RecordWildCards + RecordWildCards, + ViewPatterns build-depends: base ^>= 4.14.0.0, containers ^>= 0.6.2.1, -- 2.39.2 From a5b55b6a57037c76939e82457c0288cacf42649a Mon Sep 17 00:00:00 2001 From: Rhiannon Morris Date: Sun, 20 Jun 2021 21:28:54 +0200 Subject: [PATCH 13/13] m glyphs --- laantas-script/Glyphs.hs | 42 +++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/laantas-script/Glyphs.hs b/laantas-script/Glyphs.hs index d2be880..78fc504 100644 --- a/laantas-script/Glyphs.hs +++ b/laantas-script/Glyphs.hs @@ -373,7 +373,7 @@ mGlyphs = [("m",m), ("mt",mt), ("mk",mk), ("mg",mg), ("md",md), ("mƶ",mƶ), ("mn",mn), ("mr",mr), ("mč",mč), ("mǧ",mǧ), ("mw",mw), ("mh",mh), ("mf",mf), ("mj",mj)] -m = simpleG mPath 6 +m = simpleG mPath 6.125 mt = simpleG mtPath 10 mk = simpleG mkPath 10 mg = simpleG mgPath 10 @@ -395,31 +395,36 @@ mf = simpleG mfPath 13 mj = simpleG mjPath 9 m0 = simpleG m0Path 6 -mPath = mPart <> P [mA (6,0), lR (0,5)] +mPath = mPart <> shiftX 6 aPath mInit = P [mA (0.5,0), cR (-0.25,0.2) (-0.5,2.25) (-0.5,3.5)] -mBump' = P [aR 1.5 1.5 0 Small CCW (3,0)] -mBump = mBump' <> P [lR (0,-2), mR (0,2)] -mPart = mInit <> mBump <> mBump' +mBumpI = P [cR (0,2) (2.5,2) (3,0)] <> mLine +mLine = P [qR (0.125,-1) (0.125,-2), mR (-0.125,2)] +mBumpF = P [cR (-0.5,2) (2.5,2) (3,0)] +mBumpM = mBumpF <> mLine +mBumpsN n = mconcat $ [mBumpI] <> replicate n mBumpM <> [mBumpF] +mBumps = mBumpsN 0 +mPart = mInit <> mBumps +mFree = mPart <> P [cR (0.5,-2) (-0.75,-4) (-1.5,-3.5)] mtPath = mPart <> shiftX 4.5 tPath mkPath = mPart <> shiftX 6 kShort mgPath = mPart <> shiftX 6 gShort -mdPath = ḿPath <> shiftX 7 dPath -mƶPath = ḿPath <> shiftX 7 ƶPath -mpPath = ḿPath <> shiftX 7 pPath +mdPath = mFree <> shiftX 7 dPath +mƶPath = mFree <> shiftX 7 ƶPath +mpPath = mFree <> shiftX 7 pPath mbPath = mPart <> shiftX 6 bPath msPath = mPart <> shiftX 6 sPath mšPath = mPart <> shiftX 6 šPath mlPath = mPart <> shiftX 6 lPath -mmPath = mInit <> mBump <> mBump <> mBump <> mBump' <> P [mR (0,-3.5), lR (0,5)] +mmPath = mInit <> mBumpsN 2 <> P [mR (0,-3.5), lR (0,5)] mnPath = mPart <> shiftX 6 nPath -mrPath = mInit <> mBump <> mBump <> mBump' <> P [mR (0,-6.5), lR (0,8)] -mčPath = ḿPath <> shiftX 7 čPath -mǧPath = ḿPath <> shiftX 7 ǧPath +mrPath = mInit <> mBumpsN 1 <> P [mR (0,-6.5), lR (0,8)] +mčPath = mFree <> shiftX 7 čPath +mǧPath = mFree <> shiftX 7 ǧPath mwPath = mPart <> shiftX 6 wPath mhPath = mPart <> shiftX 6 hPath -mfPath = ḿPath <> shiftX 7 fPath -mjPath = ḿPath <> P [mA (5.5,0), lR (3.5,0), lR (0,5)] -m0Path = ḿPath <> P [mA (1.25,7), cR (3.55,-0.3) (3.8,0) (4,0.5)] +mfPath = mFree <> shiftX 7 fPath +mjPath = mFree <> P [mA (5.5,0), lR (3.5,0), lR (0,5)] +m0Path = mFree <> P [mA (1.25,7), cR (3.55,-0.3) (3.8,0) (4,0.5)] nGlyphs = [("n", n), ("nt", nt), ("nk", nk), ("ng", ng), ("nd", nd), ("nƶ", nƶ), @@ -603,7 +608,7 @@ fPart = P [mA (4.25,2.5), cR (1.6,-0.25) (2.5,1) (2.5,3) ] fnPath = fPath <> shiftX 7 nPath -fmPath = fPart <> P [lR (0,1)] <> mBump <> mBump' <> P [mA (12,0), lR (0,5)] +fmPath = fPart <> P [lR (0,1)] <> mBumps <> P [mA (12,0), lR (0,5)] f0Path = fPath <> P [mA (1.5,7), cR (2.8,-0.35) (3.1,0) (3.5,0.5)] j = simpleG jPath 4 @@ -646,10 +651,7 @@ aiPath = aPath <> P [mR (2,-5), lR (3,0)] <> shiftX 4.75 aPath auPath = aPath <> shiftX 1.5 uNarrow iaPath = P [mA (0,0), lR (3,0)] <> shiftX 2.75 aPath <> shiftX 5 aPath uaPath = uNarrow <> shiftX 4.5 aPath -ḿPath = P [mA (0.5,0), cR (-0.25,0.2) (-0.5,2.25) (-0.5,3.5), - aR 1.5 1.5 0 Small CCW (3,0), lR (0,-2), - mA (5.5,0), cR (0.25,0.2) (0.5,2.25) (0.5,3.5), - aR 1.5 1.5 0 Small CW (-3,0)] +ḿPath = mFree ńPath = nFree łPath = lFree ŕPath = rPart <> P [mA (5,0), lR (0,5)] -- 2.39.2