diff --git a/demo/src/index.ts b/demo/src/index.ts index bd30e71..2dc5c5a 100644 --- a/demo/src/index.ts +++ b/demo/src/index.ts @@ -28,15 +28,6 @@ const lowercase = [ ..."yýỳŷẙÿỹẏȳỷỵʏɏƴỿȝ", ..."zźẑžżẓẕƍƶȥʐʑɀʒǯƹƺʓþƿƨƽƅɂʕʡʢʖʗʘʬʭ", ]; -/* -console.log( - JSON.stringify( - font["3"].map( - (l: Line) => l.map((v: Vec) => [0.166 + v[0] * 0.33, 0.166 + v[1] * 0.33] as Vec) as Line, - ) as Glyph, - ), -); -*/ const rotateGlyph = (g: Glyph) => g.map((l: Line) => l.map((p: Vec) => [1 - p[0], 1 - p[1]])); @@ -51,7 +42,8 @@ const mirrorXGlyph = (g: Glyph) => g.map((l: Line) => l.map((p: Vec) => [1 - p[0], p[1]])); // font["ɜ"] = mirrorYGlyph(font["ɛ"]) -// alert(`ɴ: ${JSON.stringify(scaleGlyph(font["N"]))},`); +// alert(`ʁ: ${JSON.stringify(scaleGlyph(rotateGlyph(font["R"])))},`); + for (let l = 0; l < lowercase.length; l++) { if (font[lowercase[l]] === undefined) { @@ -127,7 +119,7 @@ const update = () => { const init = () => { if (app === null) return; - form.autocomplete = "off"; + //form.autocomplete = "off"; group.setAttribute("stroke", "#333"); group.setAttribute("stroke-linejoin", "round"); @@ -137,23 +129,22 @@ const init = () => { svg.appendChild(group); input.innerText = textAtLaunch; + input.addEventListener("input", update); input.addEventListener("change", update); + inputSize.type = "range"; inputSize.min = "0.05"; inputSize.max = "0.2"; inputSize.step = "0.01"; - inputSize.value = "0.12"; - inputSize.addEventListener("change", (e) => { - console.log((e.target as HTMLInputElement).value); - update(); - }); + inputSize.value = "0.07"; + + inputSize.addEventListener("change", update); form.appendChild(input); form.appendChild(inputSize); app.appendChild(form); app.appendChild(svg); + update(); }; -window.addEventListener("resize", update); init(); -update(); diff --git a/src/glyphs/lowercase/base.ts b/src/glyphs/lowercase/base.ts index d844bba..f6fa154 100644 --- a/src/glyphs/lowercase/base.ts +++ b/src/glyphs/lowercase/base.ts @@ -577,8 +577,8 @@ const base = { [0.265, 0.3], [0.265, 0.628], [0.725, 0.628], - [0.725, 0.496], - [0.496, 0.496], + [0.725, 0.5], + [0.5, 0.5], ], ], ǥ: [ @@ -607,8 +607,8 @@ const base = { [0.265, 0.3], [0.265, 0.628], [0.725, 0.628], - [0.725, 0.496], - [0.496, 0.496], + [0.725, 0.5], + [0.5, 0.5], ], ], ɣ: [ @@ -668,8 +668,8 @@ const base = { [0.265, 0.628], ], [ - [0.265, 0.496], - [0.73, 0.496], + [0.265, 0.5], + [0.73, 0.5], ], [ [0.73, 0.3], @@ -785,8 +785,8 @@ const base = { [0.73, 0.628], ], [ - [0.496, 0.3], - [0.496, 0.628], + [0.5, 0.3], + [0.5, 0.628], ], ], ɨ: [ @@ -1179,7 +1179,7 @@ const base = { ], ], - m: [ + m: [ [ [0.15, 0.7], [0.15, 0.275], @@ -1194,7 +1194,7 @@ const base = { [0.5, 0.7], ], ], - + n: [ [ [0.15, 0.7], @@ -1206,7 +1206,7 @@ const base = { [0.85, 0.7], ], ], - nj: [ + nj: [ [ [0.15, 0.7], [0.15, 0.275], @@ -1239,7 +1239,7 @@ const base = { ], ], ɲ: [ - [ + [ [0.1, 0.77], [0.125, 0.75], [0.15, 0.7], @@ -1263,7 +1263,7 @@ const base = { ], ], ɳ: [ - [ + [ [0.15, 0.7], [0.15, 0.275], ], @@ -1271,7 +1271,7 @@ const base = { [0.15, 0.3], [0.77, 0.3], [0.77, 0.85], - [0.85, 0.9] + [0.85, 0.9], ], ], ȵ: [ @@ -1285,9 +1285,8 @@ const base = { [0.65, 0.9], [0.85, 0.9], [0.85, 0.7], - [0.5, 0.9] + [0.5, 0.9], ], - ], o: [ @@ -1299,6 +1298,87 @@ const base = { [0.15, 0.7], ], ], + ɶ: [ + [ + [0.265, 0.3], + [0.265, 0.628], + [0.5, 0.628], + [0.5, 0.3], + [0.265, 0.3], + ], + [ + [0.73, 0.3], + [0.5, 0.3], + ], + [ + [0.5, 0.628], + [0.73, 0.628], + ], + [ + [0.5, 0.5], + [0.65, 0.5], + ], + ], + ɔ: [ + [ + [0.15, 0.7], + [0.85, 0.7], + [0.85, 0.3], + [0.15, 0.3], + ], + ], + ɵ: [ + [ + [0.15, 0.7], + [0.15, 0.3], + [0.85, 0.3], + [0.85, 0.7], + [0.15, 0.7], + ], + [ + [0.15, 0.5], + [0.85, 0.5], + ], + ], + ɷ: [ + [ + [0.5, 0.7], + [0.8, 0.7], + [0.9, 0.5], + + [0.75, 0.35], + [0.66, 0.3], + [0.5, 0.25], + [0.33, 0.3], + [0.25, 0.35], + + [0.1, 0.5], + [0.2, 0.7], + [0.5, 0.7], + ], + [ + [0.5, 0.7], + [0.5, 0.5], + ], + ], + ȣ: [ + [ + [0.15, 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.1], + ], + [ + [0.85, 0.3], + [0.85, 0.1], + ], + ], + p: [ [ [0.15, 0.9], @@ -1308,6 +1388,35 @@ const base = { [0.125, 0.7], ], ], + + ƥ: [ + [ + [0.15, 0.3], + [0.85, 0.3], + [0.85, 0.7], + [0.15, 0.7], + ], + [ + [0.15, 0.9], + [0.15, 0.2], + [0.16, 0.145], + [0.2, 0.1], + ], + ], + ɸ: [ + [ + [0.15, 0.7], + [0.15, 0.3], + [0.85, 0.3], + [0.85, 0.7], + [0.15, 0.7], + ], + [ + [0.5, 0.9], + [0.5, 0.1], + ], + ], + q: [ [ [0.85, 0.9], @@ -1317,6 +1426,41 @@ const base = { [0.875, 0.7], ], ], + ȹ: [ + [ + [0.85, 0.7], + [0.85, 0.3], + [0.15, 0.3], + [0.15, 0.7], + [0.85, 0.7], + ], + [ + [0.5, 0.3], + [0.5, 0.9], + ], + ], + ɋ: [ + [ + [0.85, 0.9], + [0.77, 0.85], + [0.77, 0.3], + [0.15, 0.3], + [0.15, 0.7], + [0.8, 0.7], + ], + ], + ĸ: [ + [ + [0.265, 0.3], + [0.265, 0.628], + ], + [ + [0.73, 0.3], + [0.265, 0.5], + [0.73, 0.628], + ], + ], + r: [ [ [0.85, 0.3], @@ -1328,6 +1472,123 @@ const base = { [0.15, 0.7], ], ], + ʀ: [ + [ + [0.265, 0.5], + [0.73, 0.5], + [0.73, 0.3], + [0.265, 0.3], + [0.265, 0.628], + ], + [ + [0.265, 0.5], + [0.73, 0.628], + ], + ], + ɍ: [ + [ + [0.85, 0.3], + [0.45, 0.3], + [0.25, 0.4], + ], + [ + [0.25, 0.275], + [0.25, 0.7], + ], + [ + [0.15, 0.5125], + [0.35, 0.5125], + ], + ], + ɹ: [ + [ + [0.15, 0.7], + [0.65, 0.7], + [0.85, 0.6], + ], + [ + [0.85, 0.725], + [0.85, 0.3], + ], + ], + ɺ: [ + [ + [0.15, 0.7], + [0.65, 0.7], + [0.85, 0.6], + ], + [ + [0.85, 0.725], + [0.85, 0.1], + ], + ], + ɻ: [ + [ + [0.15, 0.7], + [0.65, 0.7], + [0.77, 0.6], + ], + [ + [0.85, 0.9], + [0.77, 0.85], + [0.77, 0.725], + [0.77, 0.3], + ], + ], + ɼ: [ + [ + [0.85, 0.3], + [0.35, 0.3], + [0.15, 0.4], + ], + [ + [0.15, 0.275], + [0.15, 0.9], + ], + ], + ɽ: [ + [ + [0.85, 0.3], + [0.35, 0.3], + [0.15, 0.4], + ], + [ + [0.15, 0.275], + [0.15, 0.85], + [0.175, 0.875], + [0.25, 0.9], + ], + ], + ɾ: [ + [ + [0.85, 0.3], + [0.35, 0.3], + [0.15, 0.4], + [0.15, 0.7], + ], + ], + ɿ: [ + [ + [0.15, 0.3], + [0.65, 0.3], + [0.85, 0.4], + [0.85, 0.9], + ], + ], + ʁ: [ + [ + [0.73, 0.5], + [0.265, 0.5], + [0.265, 0.7], + [0.73, 0.7], + [0.73, 0.364], + ], + [ + [0.73, 0.5], + [0.265, 0.364], + ], + ], + s: [ [ [0.85, 0.3], diff --git a/src/glyphs/lowercase/diaBaseAssociation.ts b/src/glyphs/lowercase/diaBaseAssociation.ts index 1455c87..9819c1e 100644 --- a/src/glyphs/lowercase/diaBaseAssociation.ts +++ b/src/glyphs/lowercase/diaBaseAssociation.ts @@ -127,10 +127,10 @@ const diaBaseAssociation = { //Ỉ: ["i", ["ha"]], //Ị: ["i", ["db"]], - // j + // j ĵ: ["ȷ", ["cr"]], ǰ: ["ȷ", ["hc"]], - + // k ḱ: ["k", ["ct"]], ǩ: ["k", ["hc"]], @@ -163,8 +163,8 @@ const diaBaseAssociation = { ṇ: ["n", ["db"]], ṋ: ["n", ["crb"]], ṉ: ["n", ["lb"]], - ŋ: ["n", ["hbr"]], - + ŋ: ["n", ["hbr"]], + // o ó: ["o", ["ct"]], ò: ["o", ["gr"]], @@ -203,6 +203,35 @@ const diaBaseAssociation = { ọ: ["o", ["db"]], ộ: ["o", ["cr", "db"]], + // p + ṕ: ["p", ["ct"]], + ṗ: ["p", ["da"]], + + // q + ʠ: ["q", ["crs"]], + + // r + ŕ: ["r", ["ct"]], + ř: ["r", ["hc"]], + ṙ: ["r", ["da"]], + ŗ: ["r", ["cdl"]], + ȑ: ["r", ["gr", "gr"]], + ȓ: ["r", ["br"]], + ṛ: ["r", ["db"]], + ṝ: ["r", ["db", "mc"]], + ṟ: ["r", ["lb"]], + + // s + ś: ["s", ["ct"]], + ṥ: ["s", ["ct", "da"]], + ŝ: ["s", ["cr"]], + š: ["s", ["hc"]], + ṧ: ["s", ["hc", "da"]], + ṡ: ["s", ["da"]], + ş: ["s", ["cd"]], + ṣ: ["s", ["db"]], + ṩ: ["s", ["da", "db"]], + // u ụ: ["u", ["db"]], ủ: ["u", ["ha"]],