From 76b2feaa2aa4e605522e17c2803d2b2c14ff9691 Mon Sep 17 00:00:00 2001 From: nclslbrn Date: Fri, 17 May 2024 18:56:38 +0200 Subject: [PATCH] Diacritics assembly for G, L, M, N & O --- src/index.ts | 4 +- src/lowercase/base.ts | 4 +- src/uppercase/base.ts | 274 +++++++++++++++++++++++++++- src/uppercase/diaBaseAssociation.ts | 78 +++++++- 4 files changed, 350 insertions(+), 10 deletions(-) diff --git a/src/index.ts b/src/index.ts index 1d118c1..92207ed 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,7 +2,7 @@ import { type Vec, Line, Glyph, Font } from "./type"; import lowercase from "./lowercase/index"; import uppercase from "./uppercase/index"; import ponctuation from "./poncuation"; -import number from './number'; +import number from "./number"; const font = { ...lowercase, ...uppercase, ...ponctuation, ...number } as Font; @@ -49,7 +49,7 @@ const getGlyphPath = (key: string, size: Vec, pos: Vec): string[] => { ); } else { console.warn( - "Can't retrieve this glyph, be sure to use this function with a single char", + `Missing glyph ${key}, You can create it (and add it to this repository by making a pull request) or open an issue.`, ); return []; } diff --git a/src/lowercase/base.ts b/src/lowercase/base.ts index 34b74fa..b3486bc 100644 --- a/src/lowercase/base.ts +++ b/src/lowercase/base.ts @@ -1608,8 +1608,8 @@ const base = { [0.15, 0.7], [0.15, 0.379], [0.5, 0.379], - [0.5, 0.45], - [0.35, 0.45], + [0.5, 0.5], + [0.35, 0.5], [0.35, 0.557], [0.85, 0.557], [0.85, 0.7], diff --git a/src/uppercase/base.ts b/src/uppercase/base.ts index 9e63b9a..c583029 100644 --- a/src/uppercase/base.ts +++ b/src/uppercase/base.ts @@ -31,6 +31,7 @@ const base = { [0.85, 0.7], ], ], + B: [ [ [0.6, 0.557], @@ -102,6 +103,7 @@ const base = { [0.8, 0.7], ], ], + D: [ [ [0.15, 0.271], @@ -174,6 +176,7 @@ const base = { [0.85, 0.414], ], ], + E: [ [ [0.85, 0.271], @@ -220,6 +223,7 @@ const base = { [0.15, 0.4], ], ], + F: [ [ [0.85, 0.271], @@ -246,6 +250,7 @@ const base = { [0.55, 0.557], ], ], + G: [ [ [0.85, 0.271], @@ -292,6 +297,19 @@ const base = { [0.6985, 0.271], ], ], + Ƣ: [ + [ + [0.45, 0.371], + [0.45, 0.7], + [0.15, 0.7], + [0.15, 0.371], + [0.45, 0.371], + [0.65, 0.271], + [0.85, 0.371], + [0.85, 0.7], + ], + ], + H: [ [ [0.15, 0.271], @@ -306,6 +324,42 @@ const base = { [0.85, 0.7], ], ], + Ħ: [ + [ + [0.2, 0.271], + [0.2, 0.7], + ], + [ + [0.15, 0.4], + [0.85, 0.4], + ], + [ + [0.2, 0.557], + [0.8, 0.557], + ], + [ + [0.8, 0.271], + [0.8, 0.7], + ], + ], + Ƕ: [ + [ + [0.15, 0.271], + [0.15, 0.7], + ], + [ + [0.15, 0.557], + [0.5, 0.557], + ], + [ + [0.85, 0.45], + [0.85, 0.65], + [0.675, 0.7], + [0.5, 0.65], + [0.5, 0.271], + ], + ], + I: [ [ [0.15, 0.271], @@ -320,18 +374,88 @@ const base = { [0.5, 0.7], ], ], + IJ: [ + [ + [0.15, 0.271], + [0.45, 0.271], + ], + [ + [0.15, 0.7], + [0.45, 0.7], + ], + [ + [0.275, 0.271], + [0.275, 0.7], + ], + [ + [0.55, 0.271], + [0.85, 0.271], + ], + [ + [0.75, 0.271], + [0.75, 0.7], + [0.55, 0.7], + [0.55, 0.629], + ], + ], + Ɨ: [ + [ + [0.15, 0.271], + [0.85, 0.271], + ], + [ + [0.15, 0.7], + [0.85, 0.7], + ], + [ + [0.15, 0.5], + [0.85, 0.5], + ], + [ + [0.5, 0.271], + [0.5, 0.7], + ], + ], + Ɩ: [ + [ + [0.15, 0.271], + [0.85, 0.271], + ], + [ + [0.5, 0.271], + [0.5, 0.7], + [0.85, 0.7], + ], + ], J: [ [ - [0.4, 0.271], + [0.15, 0.271], [0.85, 0.271], ], [ - [0.6, 0.271], - [0.6, 0.7], + [0.5, 0.271], + [0.5, 0.7], [0.15, 0.7], [0.15, 0.629], ], ], + Ɉ: [ + [ + [0.15, 0.271], + [0.85, 0.271], + ], + [ + [0.5, 0.271], + [0.5, 0.7], + [0.15, 0.7], + [0.15, 0.629], + ], + [ + [0.15, 0.5], + [0.85, 0.5], + ], + ], + K: [ [ [0.15, 0.271], @@ -343,6 +467,19 @@ const base = { [0.85, 0.7], ], ], + Ƙ: [ + [ + [0.15, 0.271], + [0.15, 0.7], + ], + [ + [0.85, 0.271], + [0.65, 0.271], + [0.15, 0.557], + [0.85, 0.7], + ], + ], + L: [ [ [0.15, 0.271], @@ -350,6 +487,46 @@ const base = { [0.85, 0.7], ], ], + LJ: [ + [ + [0.15, 0.271], + [0.15, 0.7], + [0.45, 0.7], + ], + [ + [0.55, 0.271], + [0.85, 0.271], + ], + [ + [0.75, 0.271], + [0.75, 0.7], + [0.55, 0.7], + [0.55, 0.629], + ], + ], + Ỻ: [ + [ + [0.35, 0.271], + [0.35, 0.7], + [0.85, 0.7], + ], + [ + [0.15, 0.271], + [0.15, 0.7], + ], + ], + Ƚ: [ + [ + [0.25, 0.271], + [0.25, 0.7], + [0.85, 0.7], + ], + [ + [0.15, 0.5], + [0.55, 0.5], + ], + ], + M: [ [ [0.15, 0.7], @@ -359,6 +536,7 @@ const base = { [0.85, 0.7], ], ], + N: [ [ [0.15, 0.7], @@ -367,6 +545,43 @@ const base = { [0.85, 0.271], ], ], + NJ: [ + [ + [0.15, 0.7], + [0.15, 0.271], + [0.45, 0.7], + [0.45, 0.271], + ], + [ + [0.75, 0.271], + [0.75, 0.7], + [0.55, 0.7], + [0.55, 0.629], + ], + ], + Ɲ: [ + [ + [0.15, 0.9], + [0.17, 0.9], + [0.22, 0.88], + [0.25, 0.85], + [0.25, 0.271], + [0.85, 0.7], + [0.85, 0.271], + ], + ], + Ƞ: [ + [ + [0.15, 0.271], + [0.15, 0.7], + ], + [ + [0.15, 0.3], + [0.85, 0.3], + [0.85, 0.9], + ], + ], + O: [ [ [0.15, 0.271], @@ -376,6 +591,59 @@ const base = { [0.15, 0.271], ], ], + Œ: [ + [ + [0.15, 0.7], + [0.5, 0.7], + [0.5, 0.271], + [0.15, 0.271], + [0.15, 0.7], + ], + [ + [0.5, 0.557], + [0.65, 0.557], + ], + [ + [0.85, 0.271], + [0.5, 0.271], + [0.5, 0.7], + [0.85, 0.7], + ], + ], + Ɔ: [ + [ + [0.15, 0.7], + [0.85, 0.7], + [0.85, 0.271], + [0.15, 0.271], + ], + ], + Ɵ: [ + [ + [0.25, 0.271], + [0.25, 0.7], + [0.75, 0.7], + [0.75, 0.271], + [0.25, 0.271], + ], + [ + [0.15, 0.5], + [0.85, 0.5], + ], + ], + Ȣ: [ + [ + [0.15, 0.271], + [0.15, 0.7], + [0.85, 0.7], + [0.85, 0.271], + ], + [ + [0.15, 0.5], + [0.85, 0.5], + ], + ], + P: [ [ [0.15, 0.557], diff --git a/src/uppercase/diaBaseAssociation.ts b/src/uppercase/diaBaseAssociation.ts index bde5b55..36f4a19 100644 --- a/src/uppercase/diaBaseAssociation.ts +++ b/src/uppercase/diaBaseAssociation.ts @@ -88,9 +88,9 @@ const diaBaseAssociation = { Ḛ: ["E", ["tlb"]], Ɇ: ["E", ["brd"]], - // F + // F Ḟ: ["F", ["da"]], - + // G Ǵ: ["G", ["ct"]], Ğ: ["G", ["br"]], @@ -99,7 +99,7 @@ const diaBaseAssociation = { Ġ: ["G", ["da"]], Ģ: ["G", ["cm"]], Ḡ: ["G", ["mc"]], - + // H Ĥ: ["H", ["cr"]], Ȟ: ["H", ["hc"]], @@ -127,9 +127,81 @@ const diaBaseAssociation = { Ị: ["I", ["db"]], Ḭ: ["I", ["tlb"]], + // J + Ĵ: ["J", ["cr"]], + + // K + Ḱ: ["K", ["ct"]], + Ǩ: ["K", ["hc"]], + Ķ: ["K", ["cm"]], + Ḳ: ["K", ["cm"]], + Ḵ: ["K", ["lb"]], + + // L + Ĺ: ["L", ["ct"]], + Ľ: ["L", ["hc"]], // probably need another diacritic + Ļ: ["L", ["cm"]], + Ł: ["L", ["brd"]], // could be enhance in base + Ḷ: ["L", ["db"]], + Ḹ: ["L", ["db", "mc"]], + Ḽ: ["L", ["crb"]], + Ḻ: ["L", ["lb"]], + Ŀ: ["L", ["da"]], + // M + Ḿ: ["M", ["ct"]], + Ṁ: ["M", ["da"]], + Ṃ: ["M", ["db"]], + // N + Ń: ["N", ["ct"]], + Ǹ: ["N", ["gr"]], + Ň: ["N", ["hc"]], + Ñ: ["N", ["tl"]], + Ṅ: ["N", ["da"]], + Ņ: ["N", ["cm"]], + Ṇ: ["N", ["db"]], + Ṋ: ["N", ["crb"]], + Ṉ: ["N", ["lb"]], + Ŋ: ["N", ["hbr"]], + // O + Ó: ["O", ["ct"]], + Ò: ["O", ["gr"]], + Ŏ: ["O", ["br"]], + Ô: ["O", ["cr"]], + Ố: ["O", ["cr", "ct"]], + Ồ: ["O", ["cr", "gr"]], + Ỗ: ["O", ["cr", "tl"]], + Ổ: ["O", ["cr", "ha"]], + Ǒ: ["O", ["hc"]], + Ö: ["O", ["dr"]], + Ȫ: ["O", ["dr", "mc"]], + Ő: ["O", ["ct", "ct"]], + Õ: ["O", ["tl"]], + Ṍ: ["O", ["tl", "ct"]], + Ṏ: ["O", ["tl", "dr"]], + Ȭ: ["O", ["tl", "mc"]], + Ȯ: ["O", ["da"]], + Ȱ: ["O", ["db", "mc"]], + Ø: ["O", ["brd"]], + Ǿ: ["O", ["brd", "ct"]], + Ǫ: ["O", ["gnkc"]], + Ǭ: ["O", ["gnkc", "mc"]], + Ō: ["O", ["mc"]], + Ṓ: ["O", ["mc", "ct"]], + Ṑ: ["O", ["mc", "gr"]], + Ỏ: ["O", ["ha"]], + Ȍ: ["O", ["gr", "gr"]], + Ȏ: ["O", ["bri"]], + Ơ: ["O", ["crs"]], + Ớ: ["O", ["crs", "ct"]], + Ờ: ["O", ["crs", "gr"]], + Ỡ: ["O", ["crs", "tl"]], + Ở: ["O", ["crs", "ha"]], + Ợ: ["O", ["crs", "db"]], + Ọ: ["O", ["db"]], + Ộ: ["O", ["db", "cr"]], } as ExtendedTable; export { diaBaseAssociation };