Skip to content

Commit

Permalink
fix wrong diacritics and spot next fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nclslbrn committed May 19, 2024
1 parent b8cd224 commit 57db8bc
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 59 deletions.
37 changes: 18 additions & 19 deletions demo/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,24 @@ import { Glyph, Line, Vec } from "../../src/type";
import letters from "./letters";

const DEBUG = true;
//
// const rotateGlyph = (g: Glyph) =>
// g.map((l: Line) => l.map((p: Vec) => [1 - p[0], 1 - p[1]]));
// const upscaleGlyph = (g: Glyph) =>
// g.map((l: Line) =>
// l.map((p: Vec) => [p[0] * 1.33 - 0.166, p[1] * 1.33 - 0.33]),
// );
//
// 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 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(upscaleGlyph(font["ɣ"]))},`);

const rotateGlyph = (g: Glyph) =>
g.map((l: Line) => l.map((p: Vec) => [1 - p[0], 1 - p[1]]));
const upscaleGlyph = (g: Glyph) =>
g.map((l: Line) =>
l.map((p: Vec) => [p[0] * 1.33 - 0.166, p[1] * 1.33 - 0.33]),
);

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 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]]));

//alert(`ɐ: ${JSON.stringify(rotateGlyph(font["a"]))},`);

const fontFamily =
'ui-monospace, Menlo, Monaco,"Cascadia Mono", "Segoe UI Mono", "Roboto Mono","Oxygen Mono", "Ubuntu Monospace", "Source Code Pro", "Fira Mono", "Droid Sans Mono", "Courier New", monospace;';
Expand Down
11 changes: 7 additions & 4 deletions src/lowercase/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,13 @@ const base = {
],
ɐ: [
[
[0.15, 0.557],
[0.85, 0.557],
[0.85, 0.414],
[0.15, 0.414],
[0.85, 0.414],
[0.85, 0.557],
[0.15, 0.557],
],
[
[0.15, 0.4],
[0.15, 0.7],
[0.7, 0.7],
],
Expand Down Expand Up @@ -1817,7 +1820,7 @@ const base = {
[0.15, 0.7],
],
[
[0.65, 0.7],
[0.65, 0.85],
[0.65, 0.414],
[0.15, 0.414],
],
Expand Down
20 changes: 9 additions & 11 deletions src/lowercase/diaBaseAssociation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ const diaBaseAssociation = {
ä: ["a", ["dr"]],
ǟ: ["a", ["dr", "mc"]],
ã: ["a", ["tl"]],
ȧ: ["a", ["gs"]],
ǡ: ["a", ["gs", "mc"]],
ȧ: ["a", ["da"]],
ǡ: ["a", ["da", "mc"]],
ą: ["a", ["cdr"]],
ā: ["a", ["mc"]],
: ["a", ["ha"]],
Expand All @@ -31,7 +31,7 @@ const diaBaseAssociation = {
: ["a", ["db"]],
: ["a", ["br", "db"]],
: ["a", ["cr", "db"]],
: ["a", ["db"]],
: ["a", ["gsb"]],
ǽ: ["æ", ["ct"]],
ǣ: ["æ", ["mc"]],
: ["a", ["hcr"]],
Expand Down Expand Up @@ -234,8 +234,8 @@ const diaBaseAssociation = {
ș: ["s", ["cm"]],
: ["ſ", ["da"]],
ʂ: ["s", ["hbl"]],
// t

// t
ť: ["t", ["ct"]],
: ["t", ["dr"]],
: ["t", ["da"]],
Expand Down Expand Up @@ -281,21 +281,20 @@ const diaBaseAssociation = {
// v
: ["v", ["tl"]],
ṿ: ["v", ["db"]],
// w

// w
: ["w", ["ct"]],
: ["w", ["gr"]],
ŵ: ["w", ["cr"]],
: ["w", ["gs"]],
: ["w", ["dr"]],
: ["w", ["da"]],
: ["w", ["db"]],

// x
: ["x", ["dr"]],
: ["x", ["da"]],


// y
ý: ["y", ["ct"]],
: ["y", ["gr"]],
Expand All @@ -308,7 +307,7 @@ const diaBaseAssociation = {
: ["y", ["db"]],
: ["y", ["ha"]],

// z
// z
ź: ["z", ["ct"]],
: ["z", ["cr"]],
ž: ["z", ["hc"]],
Expand All @@ -320,7 +319,6 @@ const diaBaseAssociation = {

//ž: ["z", ["hc"]],
//ž: ["z", ["hc"]],

} as ExtendedTable;

export { diaBaseAssociation };
32 changes: 23 additions & 9 deletions src/poncuation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ const ponctuation = {
],
"?": [
[
[0.35, 0.2],
[0.5, 0.165],
[0.65, 0.2],
[0.65, 0.4],
[0.3, 0.3],
[0.3, 0.2],
[0.7, 0.2],
[0.7, 0.4],
[0.5, 0.5],
[0.5, 0.6],
],
Expand All @@ -109,10 +109,10 @@ const ponctuation = {
],
"¿": [
[
[0.65, 0.7],
[0.5, 0.735],
[0.35, 0.7],
[0.35, 0.5],
[0.3, 0.6],
[0.3, 0.7],
[0.7, 0.7],
[0.7, 0.5],
[0.5, 0.4],
[0.5, 0.3],
],
Expand Down Expand Up @@ -481,9 +481,23 @@ const ponctuation = {
[
[0.5125, 0.2],
[0.4875, 0.3],
[0.4925, 0.3],
],
],
"’": [
[
[0.5125, 0.2],
[0.4875, 0.3],
[0.4825, 0.3],
],
],
"‚": [
[
[0.5, 0.736],
[0.49, 0.764],
[0.45, 0.771],
],
],
//"’": [],
"«": [
[
[0.5, 0.3],
Expand Down
26 changes: 13 additions & 13 deletions src/uppercase/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,39 +34,39 @@ const base = {

B: [
[
[0.6, 0.557],
[0.6, 0.45],
[0.6, 0.271],
[0.15, 0.271],
[0.15, 0.7],
[0.85, 0.7],
[0.85, 0.557],
[0.15, 0.557],
[0.85, 0.45],
[0.15, 0.45],
],
],
Ƀ: [
[
[0.6, 0.557],
[0.6, 0.45],
[0.6, 0.271],
[0.25, 0.271],
[0.25, 0.7],
[0.85, 0.7],
[0.85, 0.557],
[0.25, 0.557],
[0.85, 0.45],
[0.25, 0.45],
],
[
[0.15, 0.629],
[0.35, 0.629],
[0.15, 0.58],
[0.35, 0.58],
],
],
Ɓ: [
[
[0.6, 0.557],
[0.6, 0.45],
[0.6, 0.271],
[0.25, 0.271],
[0.25, 0.7],
[0.85, 0.7],
[0.85, 0.557],
[0.25, 0.557],
[0.85, 0.45],
[0.25, 0.45],
],
[
[0.3, 0.271],
Expand All @@ -80,8 +80,8 @@ const base = {
[0.25, 0.271],
[0.25, 0.7],
[0.85, 0.7],
[0.85, 0.557],
[0.25, 0.557],
[0.85, 0.45],
[0.25, 0.45],
],
],
C: [
Expand Down
6 changes: 3 additions & 3 deletions src/uppercase/diaBaseAssociation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ const diaBaseAssociation = {
: ["O", ["tl", "dr"]],
Ȭ: ["O", ["tl", "mc"]],
Ȯ: ["O", ["da"]],
Ȱ: ["O", ["db", "mc"]],
Ȱ: ["O", ["da", "mc"]],
Ø: ["O", ["brd"]],
Ǿ: ["O", ["brd", "ct"]],
Ǫ: ["O", ["gnkc"]],
Expand Down Expand Up @@ -220,7 +220,7 @@ const diaBaseAssociation = {

// S
Ś: ["S", ["ct"]],
: ["S", ["ct", "da"]],
: ["S", ["ct", "da"]], // these two diacritics overlap
Ŝ: ["S", ["cr"]],
Š: ["S", ["hc"]],
: ["S", ["hc", "da"]],
Expand Down Expand Up @@ -304,7 +304,7 @@ const diaBaseAssociation = {
: ["Z", ["cr"]],
Ž: ["Z", ["hc"]],
Ż: ["Z", ["da"]],
: ["Z", ["da"]],
: ["Z", ["db"]],
: ["Z", ["lb"]],
Ȥ: ["Z", ["hbr"]],
Ǯ: ["Ʒ", ["hc"]],
Expand Down

0 comments on commit 57db8bc

Please sign in to comment.