From 723441ee0158c316ebe35198a67312e4e6c0127f Mon Sep 17 00:00:00 2001 From: nclslbrn Date: Fri, 10 May 2024 12:26:29 +0200 Subject: [PATCH] and finally... z --- demo/src/index.ts | 27 +- src/glyphs/lowercase/base.ts | 315 +++++++++++++++++++-- src/glyphs/lowercase/diaBaseAssociation.ts | 15 +- 3 files changed, 319 insertions(+), 38 deletions(-) diff --git a/demo/src/index.ts b/demo/src/index.ts index f2e1614..264e5aa 100644 --- a/demo/src/index.ts +++ b/demo/src/index.ts @@ -27,7 +27,8 @@ const lowercase = [ ..."xẍẋ", ..."yýỳŷẙÿỹẏȳỷỵʏɏƴỿȝ", ..."zźẑžżẓẕƍƶȥʐʑɀʒǯƹƺʓþƿƨƽƅɂʕʡʢʖʗʘʬʭ", -]; +], +DEBUG = false; const rotateGlyph = (g: Glyph) => g.map((l: Line) => l.map((p: Vec) => [1 - p[0], 1 - p[1]])); @@ -38,13 +39,13 @@ const scaleGlyph = (g: Glyph) => g.map((l: Line) => l.map((p: Vec) => [0.166 + p[0] * 0.66, 0.166 + p[1] * 0.66]), ); -const mirrorYGlyph = (g: Glyph) => - g.map((l: Line) => l.map((p: Vec) => [p[0], 1 - p[1]])); const mirrorXGlyph = (g: Glyph) => + g.map((l: Line) => l.map((p: Vec) => [p[0], 1 - p[1]])); +const mirrorYGlyph = (g: Glyph) => g.map((l: Line) => l.map((p: Vec) => [1 - p[0], p[1]])); // font["ɜ"] = mirrorYGlyph(font["ɛ"]) -// alert(`ʏ: ${JSON.stringify(scaleGlyph(font["Y"]))},`); +// alert(`ʖ: ${JSON.stringify(rotateGlyph(font["ʕ"]))},`); for (let l = 0; l < lowercase.length; l++) { if (font[lowercase[l]] === undefined) { @@ -99,14 +100,16 @@ const update = () => { rect.setAttribute("width", `${textSize[0]}`); rect.setAttribute("height", `${textSize[1]}`); rect.setAttribute("title", char); - /* - const label = document.createElementNS(namespace, "text"); - label.setAttribute("x", `${margin[0] + x * textSize[0] + 10}`); - label.setAttribute("y", `${margin[1] + y * textSize[1] + 20}`); - label.setAttribute("font-size", `${fontScale*20}em`) - label.textContent = char; - group.appendChild(label); - */ + + if (DEBUG) { + const label = document.createElementNS(namespace, "text"); + label.setAttribute("x", `${margin[0] + x * textSize[0] + 10}`); + label.setAttribute("y", `${margin[1] + y * textSize[1] + 20}`); + label.setAttribute("font-size", `${fontScale*15}em`) + label.textContent = char; + group.appendChild(label); + } + lines.map((d: string) => { const path = document.createElementNS(namespace, "path"); path.setAttribute("d", d); diff --git a/src/glyphs/lowercase/base.ts b/src/glyphs/lowercase/base.ts index 90eb2a8..5af3d26 100644 --- a/src/glyphs/lowercase/base.ts +++ b/src/glyphs/lowercase/base.ts @@ -357,14 +357,14 @@ const base = { ], ẟ: [ [ - [0.75, 0.15], - [0.5, 0.1], - [0.3, 0.1], - [0.15, 0.15], - [0.85, 0.5], - [0.5, 0.7], - [0.15, 0.5], - [0.5, 0.325], + [0.75, 0.1], + [0.25, 0.1], + [0.25, 0.3], + [0.75, 0.3], + [0.75, 0.7], + [0.25, 0.7], + [0.25, 0.5], + [0.75, 0.5], ], ], @@ -400,14 +400,15 @@ const base = { ], ɛ: [ [ - [0.75, 0.35], - [0.6, 0.3], - [0.25, 0.4], - [0.6, 0.5], - [0.25, 0.6], - [0.6, 0.7], - [0.75, 0.65], + [0.75, 0.3], + [0.25, 0.3], + [0.25, 0.7], + [0.75, 0.7] ], + [ + [0.25, 0.5], + [0.75, 0.5] + ] ], ɘ: [ [ @@ -1598,7 +1599,7 @@ const base = { ], [ [0.265, 0.496], - [0.7270000000000001, 0.36400000000000005], + [0.73, 0.364], ], ], @@ -2030,15 +2031,15 @@ const base = { ], ʏ: [ [ - [0.265,0.3], + [0.265, 0.3], [0.5, 0.5], - [0.73, 0.3] + [0.73, 0.3], ], [ [0.5, 0.5], - [0.5,0.628] - ] - ], + [0.5, 0.628], + ], + ], ɏ: [ [ [0.25, 0.3], @@ -2051,9 +2052,9 @@ const base = { [0.5, 0.9], ], [ - [0.15, 0.5], - [0.85, 0.5] - ] + [0.15, 0.5], + [0.85, 0.5], + ], ], ƴ: [ [ @@ -2078,7 +2079,7 @@ const base = { [0.75, 0.3], [0.75, 0.9], [0.5, 0.9], - [0.85, 0.7] + [0.85, 0.7], ], ], ȝ: [ @@ -2102,6 +2103,270 @@ const base = { [0.85, 0.7], ], ], + ƍ: [ + [ + [0.15, 0.3], + [0.85, 0.3], + [0.85, 0.7], + [0.15, 0.7], + [0.15, 0.3], + ], + [ + [0.15, 0.7], + [0.85, 0.9], + [0.15, 0.9], + ], + ], + ƶ: [ + [ + [0.15, 0.3], + [0.85, 0.3], + [0.15, 0.7], + [0.85, 0.7], + ], + [ + [0.35, 0.5], + [0.65, 0.5], + ], + ], + ʐ: [ + [ + [0.15, 0.3], + [0.85, 0.3], + [0.15, 0.7], + [0.85, 0.7], + [0.85, 0.87], + [0.9, 0.9], + ], + ], + ʑ: [ + [ + [0.15, 0.3], + [0.85, 0.3], + [0.15, 0.7], + [0.85, 0.7], + [0.85, 0.6], + [0.65, 0.6], + [0.35, 0.8], + ], + ], + ɀ: [ + [ + [0.15, 0.3], + [0.85, 0.3], + [0.15, 0.7], + [0.5, 0.9], + [0.85, 0.9], + ], + ], + ʒ: [ + [ + [0.15, 0.3], + [0.85, 0.3], + [0.5, 0.7], + [0.85, 0.7], + [0.85, 0.9], + [0.15, 0.9], + ], + ], + ƹ: [ + [ + [0.85, 0.3], + [0.15, 0.3], + [0.5, 0.7], + [0.15, 0.7], + [0.15, 0.9], + [0.85, 0.9], + ], + ], + ƺ: [ + [ + [0.15, 0.3], + [0.85, 0.3], + [0.5, 0.5], + [0.85, 0.5], + [0.85, 0.7], + [0.15, 0.7], + [0.15, 0.9], + [0.7, 0.9], + ], + ], + ʓ: [ + [ + [0.15, 0.3], + [0.85, 0.3], + [0.5, 0.5], + [0.85, 0.5], + [0.85, 0.7], + [0.15, 0.7], + [0.15, 0.5], + [0.65, 0.9], + ], + ], + þ: [ + [ + [0.25, 0.3], + [0.75, 0.3], + [0.75, 0.7], + [0.25, 0.7], + ], + [ + [0.25, 0.1], + [0.25, 0.9], + ], + ], + ƿ: [ + [ + [0.25, 0.3], + [0.75, 0.1], + [0.75, 0.5], + [0.25, 0.7], + ], + [ + [0.25, 0.3], + [0.25, 0.9], + ], + ], + ƨ: [ + [ + [0.15, 0.3], + [0.85, 0.3], + [0.85, 0.4], + [0.15, 0.6], + [0.15, 0.7], + [0.85, 0.7], + ], + ], + ƽ: [ + [ + [0.15, 0.3], + [0.85, 0.3], + ], + [ + [0.35, 0.3], + [0.35, 0.5], + [0.85, 0.5], + [0.85, 0.7], + [0.15, 0.7], + ], + ], + ƅ: [ + [ + [0.15, 0.1], + [0.25, 0.1], + [0.25, 0.725], + ], + [ + [0.25, 0.3], + [0.85, 0.3], + [0.85, 0.7], + [0.25, 0.7], + ], + ], + ɂ: [ + [ + [0.15, 0.3], + [0.85, 0.3], + [0.85, 0.5], + [0.5, 0.5], + [0.5, 0.7], + ], + ], + ʕ: [ + [ + [0.85, 0.3], + [0.15, 0.3], + [0.15, 0.5], + [0.5, 0.5], + [0.5, 0.9], + ], + ], + ʡ: [ + [ + [0.15, 0.3], + [0.85, 0.3], + [0.85, 0.5], + [0.5, 0.5], + [0.5, 0.9], + ], + [ + [0.35, 0.7], + [0.65, 0.7], + ], + ], + ʢ: [ + [ + [0.85, 0.3], + [0.15, 0.3], + [0.15, 0.5], + [0.5, 0.5], + [0.5, 0.9], + ], + [ + [0.65, 0.7], + [0.35, 0.7], + ], + ], + ʖ: [ + [ + [0.15, 0.7], + [0.85, 0.7], + [0.85, 0.5], + [0.5, 0.5], + [0.5, 0.1], + ], + ], + ʗ: [ + [ + [0.75, 0.3], + [0.25, 0.3], + [0.25, 0.9], + [0.75, 0.9], + ], + ], + ʘ: [ + [ + [0.25, 0.3], + [0.75, 0.3], + [0.75, 0.7], + [0.25, 0.7], + [0.25, 0.3], + ], + [ + [0.5, 0.4875], + [0.5, 0.5125], + ], + ], + ʬ: [ + [ + [0.25, 0.3], + [0.33, 0.5], + [0.5, 0.3], + [0.66, 0.5], + [0.75, 0.3], + ], + [ + [0.25, 0.5], + [0.33, 0.7], + [0.5, 0.5], + [0.66, 0.7], + [0.75, 0.5], + ], + ], + ʭ: [ + [ + [0.25, 0.4], + [0.25, 0.3], + [0.75, 0.3], + [0.75, 0.4], + ], + [ + [0.25, 0.7], + [0.25, 0.6], + [0.75, 0.6], + [0.75, 0.7], + ], + ], } as Font; export { base }; diff --git a/src/glyphs/lowercase/diaBaseAssociation.ts b/src/glyphs/lowercase/diaBaseAssociation.ts index 96efc29..4d8826c 100644 --- a/src/glyphs/lowercase/diaBaseAssociation.ts +++ b/src/glyphs/lowercase/diaBaseAssociation.ts @@ -305,9 +305,22 @@ const diaBaseAssociation = { ỹ: ["y", ["tl"]], ẏ: ["y", ["da"]], ȳ: ["y", ["mc"]], - ỵ: ["y", ["db"]], ỷ: ["y", ["ha"]], + + // z + ź: ["z", ["ct"]], + ẑ: ["z", ["cr"]], + ž: ["z", ["hc"]], + ż: ["z", ["da"]], + ẓ: ["z", ["db"]], + ẕ: ["z", ["lb"]], + ȥ: ["z", ["hbr"]], + ǯ: ["ʒ", ["hc"]], + + //ž: ["z", ["hc"]], + //ž: ["z", ["hc"]], + } as ExtendedTable; export { diaBaseAssociation };