add glyph fields for vowel attachment points [not used yet]

This commit is contained in:
Rhiannon Morris 2021-05-20 22:49:16 +02:00
parent 10d0b11570
commit e095a9bbb2
4 changed files with 242 additions and 215 deletions

View file

@ -42,27 +42,27 @@ tGlyphs = [("t",t), ("tt",tt), ("tk",tk), ("tg",tg), ("td",td), ("tƶ",tƶ),
("tn",tn), ("tr",tr), ("",), ("",), ("tw",tw), ("th",th), ("tn",tn), ("tr",tr), ("",), ("",), ("tw",tw), ("th",th),
("tf",tf), ("tj",tj)] ("tf",tf), ("tj",tj)]
t = G {path = tPath, width = 5.5} t = simpleG tPath 5.5
tt = G {path = ttPath, width = 7} tt = simpleG ttPath 7
tk = G {path = tkPath, width = 9} tk = simpleG tkPath 9
tg = G {path = tgPath, width = 9} tg = simpleG tgPath 9
td = G {path = tdPath, width = 9} td = simpleG tdPath 9
= G {path = tƶPath, width = 9} = simpleG tƶPath 9
tp = G {path = tpPath, width = 9.5} tp = simpleG tpPath 9.5
tb = G {path = tbPath, width = 10} tb = simpleG tbPath 10
ts = G {path = tsPath, width = 9} ts = simpleG tsPath 9
= G {path = tšPath, width = 9} = simpleG tšPath 9
tl = G {path = tlPath, width = 8.5} tl = simpleG tlPath 8.5
tm = G {path = tmPath, width = 10} tm = simpleG tmPath 10
tn = G {path = tnPath, width = 9} tn = simpleG tnPath 9
tr = G {path = trPath, width = 7} tr = simpleG trPath 7
= G {path = tčPath, width = 9} = simpleG tčPath 9
= G {path = tǧPath, width = 10} = simpleG tǧPath 10
tw = G {path = twPath, width = 10} tw = simpleG twPath 10
th = G {path = thPath, width = 12} th = simpleG thPath 12
tf = G {path = tfPath, width = 10} tf = simpleG tfPath 10
tj = G {path = tjPath, width = 4.75} tj = simpleG tjPath 4.75
t0 = G {path = t0Path, width = 5} t0 = simpleG t0Path 5
tPath = P [mA (0,0), lA (5.5,0)] <> shiftX 1.5 aPath <> shiftX 5.25 aPath 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 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)] kGlyphs = [("k", k), ("kk", kk), ("ks", ks)]
k = G {path = kPath, width = 5} k = simpleG kPath 5
kk = G {path = kkPath, width = 8} kk = simpleG kkPath 8
ks = G {path = ksPath, width = 9} ks = simpleG ksPath 9
kLeft = P [mA (0,0), cR (0.5,0.75) (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)] 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 ksPath = kShortPart <> shiftX 4 sPath
g = G {path = gPath, width = 5} g = simpleG gPath 5
gPath = gHat <> kPath gPath = gHat <> kPath
gHat = P [mA (1.5,-2.75), qR (1.5,0.125) (3.5,-0.25)] 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)] 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)] dPath = dPart <> P [mA (5,-3), lR (0,8)]
dPart' = dBase <> dJoin' dPart' = dBase <> dJoin'
@ -133,27 +133,27 @@ dLong = dFree <> shiftX 1.5 dJoin
("ƶm",ƶm), ("ƶn",ƶn), ("ƶr",ƶr), ("ƶč",ƶč), ("ƶǧ",ƶǧ), ("ƶw",ƶw), ("ƶm",ƶm), ("ƶn",ƶn), ("ƶr",ƶr), ("ƶč",ƶč), ("ƶǧ",ƶǧ), ("ƶw",ƶw),
("ƶh",ƶh), ("ƶf",ƶf), ("ƶj",ƶj)] ("ƶh",ƶh), ("ƶf",ƶf), ("ƶj",ƶj)]
ƶ = G {path = ƶPath, width = 5} ƶ = simpleG ƶPath 5
ƶt = G {path = ƶtPath, width = 10.5} ƶt = simpleG ƶtPath 10.5
ƶk = G {path = ƶkPath, width = 9} ƶk = simpleG ƶkPath 9
ƶg = G {path = ƶgPath, width = 9} ƶg = simpleG ƶgPath 9
ƶd = G {path = ƶdPath, width = 10} ƶd = simpleG ƶdPath 10
ƶƶ = G {path = ƶƶPath, width = 10} ƶƶ = simpleG ƶƶPath 10
ƶp = G {path = ƶpPath, width = 10.5} ƶp = simpleG ƶpPath 10.5
ƶb = G {path = ƶbPath, width = 11} ƶb = simpleG ƶbPath 11
ƶs = G {path = ƶsPath, width = 10} ƶs = simpleG ƶsPath 10
ƶš = G {path = ƶšPath, width = 10} ƶš = simpleG ƶšPath 10
ƶl = G {path = ƶlPath, width = 10} ƶl = simpleG ƶlPath 10
ƶm = G {path = ƶmPath, width = 11} ƶm = simpleG ƶmPath 11
ƶn = G {path = ƶnPath, width = 9.75} ƶn = simpleG ƶnPath 9.75
ƶr = G {path = ƶrPath, width = 8} ƶr = simpleG ƶrPath 8
ƶč = G {path = ƶčPath, width = 10} ƶč = simpleG ƶčPath 10
ƶǧ = G {path = ƶǧPath, width = 10} ƶǧ = simpleG ƶǧPath 10
ƶw = G {path = ƶwPath, width = 11} ƶw = simpleG ƶwPath 11
ƶh = G {path = ƶhPath, width = 13} ƶh = simpleG ƶhPath 13
ƶf = G {path = ƶfPath, width = 10} ƶf = simpleG ƶfPath 10
ƶj = G {path = ƶjPath, width = 7.5} ƶj = simpleG ƶjPath 7.5
ƶ0 = G {path = ƶ0Path, width = 3.5} ƶ0 = simpleG ƶ0Path 3.5
ƶPath = gHat <> dPath ƶPath = gHat <> dPath
ƶtPath = dLong <> shiftX 5 tPath ƶtPath = dLong <> shiftX 5 tPath
@ -180,10 +180,10 @@ dLong = dFree <> shiftX 1.5 dJoin
pGlyphs = [("p", p), ("pp", pp), ("ps", ps), ("pj", pj)] pGlyphs = [("p", p), ("pp", pp), ("ps", ps), ("pj", pj)]
p = G {path = pPath, width = 5.5} p = simpleG pPath 5.5
pp = G {path = ppPath, width = 9} pp = simpleG ppPath 9
ps = G {path = psPath, width = 10.5} ps = simpleG psPath 10.5
pj = G {path = pjPath, width = 10} pj = simpleG pjPath 10
pInit = pInit =
P [mA (0,-3), cR (-1,1) (-0.5,6) (-0.5,8)] P [mA (0,-3), cR (-1,1) (-0.5,6) (-0.5,8)]
@ -206,8 +206,8 @@ pjPath =
bGlyphs = [("b", b), ("bj", bj)] bGlyphs = [("b", b), ("bj", bj)]
b = G {path = bPath, width = 6} b = simpleG bPath 6
bj = G {path = bjPath, width = 9} bj = simpleG bjPath 9
bPath = shiftX 1 gHat <> wPart <> P [mA (6,-3), lR (0,8)] bPath = shiftX 1 gHat <> wPart <> P [mA (6,-3), lR (0,8)]
bjPath = bjPath =
@ -221,27 +221,27 @@ sGlyphs = [("s",s), ("st",st), ("sk",sk), ("sg",sg), ("sd",sd), ("sƶ",sƶ),
("sn",sn), ("sr",sr), ("",), ("",), ("sw",sw), ("sh",sh), ("sn",sn), ("sr",sr), ("",), ("",), ("sw",sw), ("sh",sh),
("sf",sf), ("sj",sj)] ("sf",sf), ("sj",sj)]
s = G {path = sPath, width = 5.125} s = simpleG sPath 5.125
st = G {path = stPath, width = 8.5} st = simpleG stPath 8.5
sk = G {path = skPath, width = 9} sk = simpleG skPath 9
sg = G {path = sgPath, width = 9} sg = simpleG sgPath 9
sd = G {path = sdPath, width = 9} sd = simpleG sdPath 9
= G {path = sƶPath, width = 9} = simpleG sƶPath 9
sp = G {path = spPath, width = 9.5} sp = simpleG spPath 9.5
sb = G {path = sbPath, width = 10.5} sb = simpleG sbPath 10.5
ss = G {path = ssPath, width = 10} ss = simpleG ssPath 10
= G {path = sšPath, width = 10} = simpleG sšPath 10
sl = G {path = slPath, width = 9} sl = simpleG slPath 9
sm = G {path = smPath, width = 10.5} sm = simpleG smPath 10.5
sn = G {path = snPath, width = 9.5} sn = simpleG snPath 9.5
sr = G {path = srPath, width = 7} sr = simpleG srPath 7
= G {path = sčPath, width = 9} = simpleG sčPath 9
= G {path = sǧPath, width = 10} = simpleG sǧPath 10
sw = G {path = swPath, width = 10} sw = simpleG swPath 10
sh = G {path = shPath, width = 13} sh = simpleG shPath 13
sf = G {path = sfPath, width = 10.25} sf = simpleG sfPath 10.25
sj = G {path = sjPath, width = 5} sj = simpleG sjPath 5
s0 = G {path = s0Path, width = 5} s0 = simpleG s0Path 5
sPath = sPartLine <> shiftX 4.75 aPath sPath = sPartLine <> shiftX 4.75 aPath
sPart' = P [mA (0, 0), 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), ("",), ("",), ("lw",lw), ("lh",lh), ("ln",ln), ("lr",lr), ("",), ("",), ("lw",lw), ("lh",lh),
("lf",lf), ("lj",lj)] ("lf",lf), ("lj",lj)]
l = G {path = lPath, width = 4.5} l = simpleG lPath 4.625
ll = G {path = llPath, width = 9} ll = simpleG llPath 9
lt = G {path = ltPath, width = 10} lt = simpleG ltPath 10
lk = G {path = lkPath, width = 8.5} lk = simpleG lkPath 8.5
lg = G {path = lgPath, width = 8.5} lg = simpleG lgPath 8.5
ld = G {path = ldPath, width = 9.5} ld = simpleG ldPath 9.5
= G {path = lƶPath, width = 9.5} = simpleG lƶPath 9.5
lp = G {path = lpPath, width = 10} lp = simpleG lpPath 10
lb = G {path = lbPath, width = 10.5} lb = simpleG lbPath 10.5
ls = G {path = lsPath, width = 9.5} ls = simpleG lsPath 9.5
= G {path = lšPath, width = 9.5} = simpleG lšPath 9.5
lm = G {path = lmPath, width = 10.5} lm = simpleG lmPath 10.5
ln = G {path = lnPath, width = 9.25} ln = simpleG lnPath 9.25
lr = G {path = lrPath, width = 7.5} lr = simpleG lrPath 7.5
= G {path = lčPath, width = 9.5} = simpleG lčPath 9.5
= G {path = lǧPath, width = 9.5} = simpleG lǧPath 9.5
lw = G {path = lwPath, width = 10.5} lw = simpleG lwPath 10.5
lh = G {path = lhPath, width = 12.5} lh = simpleG lhPath 12.5
lf = G {path = lfPath, width = 10.5} lf = simpleG lfPath 10.5
lj = G {path = ljPath, width = 5} lj = simpleG ljPath 5
l0 = G {path = l0Path, width = 3.75} 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), 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), cR (-1.5,0.3) (-2,2.5) (0,2.5),
lR (0.75,0), mR (-1.25,0), 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), ("",), ("",), ("mw",mw), ("mh",mh), ("mn",mn), ("mr",mr), ("",), ("",), ("mw",mw), ("mh",mh),
("mf",mf), ("mj",mj)] ("mf",mf), ("mj",mj)]
m = G {path = mPath, width = 6} m = simpleG mPath 6
mt = G {path = mtPath, width = 10} mt = simpleG mtPath 10
mk = G {path = mkPath, width = 10} mk = simpleG mkPath 10
mg = G {path = mgPath, width = 10} mg = simpleG mgPath 10
md = G {path = mdPath, width = 12} md = simpleG mdPath 12
= G {path = mƶPath, width = 12} = simpleG mƶPath 12
mp = G {path = mpPath, width = 12.5} mp = simpleG mpPath 12.5
mb = G {path = mbPath, width = 12} mb = simpleG mbPath 12
ms = G {path = msPath, width = 11} ms = simpleG msPath 11
= G {path = mšPath, width = 11} = simpleG mšPath 11
ml = G {path = mlPath, width = 11} ml = simpleG mlPath 11
mm = G {path = mmPath, width = 12} mm = simpleG mmPath 12
mn = G {path = mnPath, width = 11} mn = simpleG mnPath 11
mr = G {path = mrPath, width = 9} mr = simpleG mrPath 9
= G {path = mčPath, width = 12} = simpleG mčPath 12
= G {path = mǧPath, width = 12} = simpleG mǧPath 12
mw = G {path = mwPath, width = 12} mw = simpleG mwPath 12
mh = G {path = mhPath, width = 14} mh = simpleG mhPath 14
mf = G {path = mfPath, width = 13} mf = simpleG mfPath 13
mj = G {path = mjPath, width = 9} mj = simpleG mjPath 9
m0 = G {path = m0Path, width = 6} m0 = simpleG m0Path 6
mPath = mPart <> P [mA (6,0), lR (0,5)] 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)] 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), ("", ), ("", ), ("nm", nm), ("nn", nn), ("nr", nr), ("", ), ("", ),
("nw", nw), ("nh", nh), ("nf", nf), ("nj", nj)] ("nw", nw), ("nh", nh), ("nf", nf), ("nj", nj)]
n = G {path = nPath, width = 5} n = simpleG nPath 5.125
nt = G {path = ntPath, width = 10.5} nt = simpleG ntPath 10.5
nk = G {path = nkPath, width = 9} nk = simpleG nkPath 9
ng = G {path = ngPath, width = 9} ng = simpleG ngPath 9
nd = G {path = ndPath, width = 10} nd = simpleG ndPath 10
= G {path = nƶPath, width = 10} = simpleG nƶPath 10
np = G {path = npPath, width = 10.25} np = simpleG npPath 10.25
nb = G {path = nbPath, width = 11} nb = simpleG nbPath 11
ns = G {path = nsPath, width = 10} ns = simpleG nsPath 10
= G {path = nšPath, width = 10} = simpleG nšPath 10
nl = G {path = nlPath, width = 10} nl = simpleG nlPath 10
nm = G {path = nmPath, width = 11} nm = simpleG nmPath 11
nn = G {path = nnPath, width = 10} nn = simpleG nnPath 10
nr = G {path = nrPath, width = 6.5} nr = simpleG nrPath 6.5
= G {path = nčPath, width = 10} = simpleG nčPath 10
= G {path = nǧPath, width = 9.75} = simpleG nǧPath 9.75
nw = G {path = nwPath, width = 11} nw = simpleG nwPath 11
nh = G {path = nhPath, width = 13} nh = simpleG nhPath 13
nf = G {path = nfPath, width = 10.75} nf = simpleG nfPath 10.75
nj = G {path = njPath, width = 5.25} nj = simpleG njPath 5.25
n0 = G {path = n0Path, width = 3.5} 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 = 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), 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)] 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), 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)] 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.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), ("", ), ("", ), ("rm", rm), ("rn", rn), ("rr", rr), ("", ), ("", ),
("rw", rw), ("rh", rh), ("rf", rf), ("rj", rj)] ("rw", rw), ("rh", rh), ("rf", rf), ("rj", rj)]
r = G {path = rPath, width = 5} r = simpleG rPath 5
rt = G {path = rtPath, width = 7.5} rt = simpleG rtPath 7.5
rk = G {path = rkPath, width = 7} rk = simpleG rkPath 7
rg = G {path = rgPath, width = 7} rg = simpleG rgPath 7
rd = G {path = rdPath, width = 9.5} rd = simpleG rdPath 9.5
= G {path = rƶPath, width = 9.5} = simpleG rƶPath 9.5
rp = G {path = rpPath, width = 10} rp = simpleG rpPath 10
rb = G {path = rbPath, width = 10.5} rb = simpleG rbPath 10.5
rs = G {path = rsPath, width = 9.5} rs = simpleG rsPath 9.5
= G {path = ršPath, width = 9.5} = simpleG ršPath 9.5
rl = G {path = rlPath, width = 9.5} rl = simpleG rlPath 9.5
rm = G {path = rmPath, width = 10.5} rm = simpleG rmPath 10.5
rr = G {path = rrPath, width = 6} rr = simpleG rrPath 6
rn = G {path = rnPath, width = 9} rn = simpleG rnPath 9
= G {path = rčPath, width = 9.5} = simpleG rčPath 9.5
= G {path = rǧPath, width = 9.5} = simpleG rǧPath 9.5
rw = G {path = rwPath, width = 10.5} rw = simpleG rwPath 10.5
rh = G {path = rhPath, width = 12.5} rh = simpleG rhPath 12.5
rf = G {path = rfPath, width = 10.5} rf = simpleG rfPath 10.5
rj = G {path = rjPath, width = 7.5} rj = simpleG rjPath 7.5
r0 = G {path = r0Path, width = 5} r0 = simpleG r0Path 5
rPath = rPart <> P [mA (5,-3), lR (0,8)] rPath = rPart <> P [mA (5,-3), lR (0,8)]
rPart = P [mA (0,5), cR (3.5,0) (5,-1) (5,-2)] 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), ("čč", čč)] čGlyphs = [("č", č), ("čs", čs), ("čč", čč)]
č = G {path = čPath, width = 5} č = simpleG čPath 5
čs = G {path = čsPath, width = 10} čs = simpleG čsPath 10
čč = G {path = ččPath, width = 10} čč = simpleG ččPath 10
čPath = čPart <> čJoin <> P [mA (5,0), lR (0,5)] č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' č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 ččPath = čPart <> shiftX 5 čPath
ǧ = G {path = ǧPath, width = 5} ǧ = simpleG ǧPath 5
ǧPath = ǧPart <> čJoin <> P [mA (5,-3), lR (0,8)] ǧ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), ǧ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)] 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 wPath = wPart <> shiftX 5.75 aPath
wPart = uPath <> P [mA (2.5,0), lR (3.5,0)] 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)] hGlyphs = [("h", h), ("hh", hh), ("hn", hn), ("hm", hm)]
h = G {path = hPath, width = 8.5} h = simpleG hPath 8.5
hh = G {path = hhPath, width = 16.5} hh = simpleG hhPath 16.5
hn = G {path = hnPath, width = 15} hn = simpleG hnPath 15
hm = G {path = hmPath, width = 16} hm = simpleG hmPath 16
hPath = hPart <> shiftX 3.5 gHat <> P [mA (8.5,-3), lR (0,8)] 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' 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)] fGlyphs = [("f", f), ("fn", fn), ("fm", fm)]
f = G {path = fPath, width = 6} f = simpleG fPath 6
fn = G {path = fnPath, width = 12} fn = simpleG fnPath 12
fm = G {path = fmPath, width = 12} fm = simpleG fmPath 12
f0 = G {path = f0Path, width = 6} f0 = simpleG f0Path 6
fPath = fPart <> P [lR (0,2.5)] fPath = fPart <> P [lR (0,2.5)]
fPart = P [mA (4.25,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)] 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)] 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 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 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), ("ḿ", ḿ), ("ai", ai), ("au", au), ("ia", ia), ("ua", ua), ("ḿ", ḿ),
("ń", ń), ("ł", ł), ("ŕ", ŕ)] ("ń", ń), ("ł", ł), ("ŕ", ŕ)]
a = G {path = aPath, width = 0.125} a = simpleG aPath 0.125
á = G {path = áPath, width = 2.125} á = simpleG áPath 2.125
i = j i = j
í = G {path = íPath, width = 5} í = simpleG íPath 5
u = G {path = uPath, width = 4.5} u = simpleG uPath 4.5
ú = G {path = úPath, width = 4} ú = simpleG úPath 4
ai = G {path = aiPath, width = 5} ai = simpleG aiPath 5
au = G {path = auPath, width = 4.5} au = simpleG auPath 4.5
ia = G {path = iaPath, width = 5} ia = simpleG iaPath 5
ua = G {path = uaPath, width = 4.5} ua = simpleG uaPath 4.5
ḿ = G {path = ḿPath, width = 6} ḿ = simpleG ḿPath 6
ń = G {path = ńPath, width = 4} ń = simpleG ńPath 4
ł = G {path = łPath, width = 3.75} ł = simpleG łPath 3.75
ŕ = G {path = ŕPath, width = 5} ŕ = simpleG ŕPath 5
aPath = P [mA (0.25,0), cR (-0.25,1) (-0.25,2) (-0.25,5)] aPath = P [mA (0.25,0), cR (-0.25,1) (-0.25,2) (-0.25,5)]
áPath = aPath <> shiftX 2 aPath áPath = aPath <> shiftX 2 aPath
@ -657,10 +657,10 @@ uaPath = uNarrow <> shiftX 4.5 aPath
adot = P . circR 0.2 adot = P . circR 0.2
withWidth f w = (f w, w) withWidth f (SI {width}) = (f width, width)
sP = simpleDia . P 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)]] da = [sP [lR (0,5)]]
= da <> [withWidth \w -> P [mA (w/2-1,8), cR (0.75,-0.5) (1.25,0.5) (2,0)]] = 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)]] di = da <> [sP [cR (1,-2) (3,-3) (0,-3)]]
@ -699,28 +699,29 @@ punctuation = Map.fromList
[(".", eos), ("?", eos), ("!", eos), (",", eop), (":", eop), (";", eop), [(".", eos), ("?", eos), ("!", eos), (",", eop), (":", eop), (";", eop),
("", ellipsis)] ("", ellipsis)]
eos = G {path = eosPath, width = 4} eos = simpleG eosPath 4
eosPath = P $ circA 1 (4,1) <> circA 1 (4,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) 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 $ numbers = Map.fromList $
zip [0..9::Int] [u, t, n2, G dFree 3, n4, n5, ł, ḿ, ń, f] zip [0..9::Int] [u, t, n2, simpleG dFree 3, n4, n5, ł, ḿ, ń, f]
n2 = G n2Path 5 n2 = simpleG n2Path 5
n2Path = P [mA (0,0), lR (0,5), sR (3,0) (5,-0.5), mA (5,0), lR (0,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)] 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), 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)] lR (1,0), aR 1.5 1.5 0 Small CW (1.5,1.5), lR (0,3.5)]
wave :: Glyph wave :: Glyph
wave = G {path = wavePath, width = 4} wave = simpleG wavePath 4
wavePath = P [mA (0,2.5), cR (1.5,-2) (2.5,2) (4,0)]
ellipsis :: Glyph 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)]

View file

@ -9,7 +9,17 @@ import Numeric
import Prelude hiding (Word) 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 -- | base amounts
charHeight', lineHeight', spaceWidth', gap' :: Double charHeight', lineHeight', spaceWidth', gap' :: Double
@ -78,10 +88,11 @@ type Word = [EGlyph]
type EGlyph = (Glyph, [Diacritic]) type EGlyph = (Glyph, [Diacritic])
type Diacritic = Double -> (Segs, Double) type Diacritic' a = SizeInfo -> (Segs, a)
type Diacritic = Diacritic' Double
simpleDia :: Segs -> Diacritic simpleDia :: Segs -> Diacritic
simpleDia ss w = (ss, w) simpleDia ss (SI {width}) = (ss, width)
doGlyphs :: [Word] -> Env -> Element doGlyphs :: [Word] -> Env -> Element
doGlyphs gs e = wrap $ run act e where 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 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 :: EGlyph -> M Double
glyphWidth (G {width}, ss) = glyphWidth (G {size}, ss) =
let w = foldl (\x f -> snd $ f x) width ss in let SI {width} = foldl (\x f -> snd $ liftDia f x) size ss in
(+) <$> withSize (* w) <*> gap (+) <$> withSize (* width) <*> gap
totalWidth :: Double -> M Double totalWidth :: Double -> M Double
totalWidth width = (+) <$> withSize (* width) <*> gap totalWidth width = (+) <$> withSize (* width) <*> gap
@ -122,17 +136,17 @@ placeWord w = do
pure e pure e
placeGlyph :: EGlyph -> M Element placeGlyph :: EGlyph -> M Element
placeGlyph (G {path = path1, width = width1}, dias) = do placeGlyph (G {path = path1, size}, dias) = do
let (segs', width') = placeDia width1 dias let (segs', width') = placeDias size dias
path <- joinSegs $ path1 <> segs' path <- joinSegs $ path1 <> segs'
width <- totalWidth width' width <- totalWidth width'
modify \s@(S {x}) -> s {x = x + width} modify \s@(S {x}) -> s {x = x + width}
pure $ path_ [D_ <<- path] pure $ path_ [D_ <<- path]
placeDia :: Double -> [Diacritic] -> (Segs, Double) placeDias :: SizeInfo -> [Diacritic] -> (Segs, Double)
placeDia w dias = placeDias sz =
flip runState w $ unlift . flip runState sz . fmap fold . traverse (state . liftDia)
fold <$> traverse state dias where unlift (x, SI {width}) = (x, width)
newline :: M () newline :: M ()
newline = do newline = do

View file

@ -9,7 +9,8 @@ where
import Control.Monad.Reader import Control.Monad.Reader
import Control.Monad.State import Control.Monad.State
import qualified Graphics.Svg as Base 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) import Data.Text (Text, pack)
@ -78,6 +79,16 @@ qR (x1, y1) (x2, y2) =
Base.qR (x1 * size) (y1 * size) Base.qR (x1 * size) (y1 * size)
(x2 * size) (y2 * 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 Arc = Large | Small
data Sweep = CW | CCW data Sweep = CW | CCW

View file

@ -27,7 +27,8 @@ executable laantas-script
MultiWayIf, MultiWayIf,
NamedFieldPuns, NamedFieldPuns,
OverloadedStrings, OverloadedStrings,
RecordWildCards RecordWildCards,
ViewPatterns
build-depends: build-depends:
base >= 4.14.0.0 && < 4.17, base >= 4.14.0.0 && < 4.17,
containers ^>= 0.6.2.1, containers ^>= 0.6.2.1,