diff --git a/demo/src/index.ts b/demo/src/index.ts index 9cca1e4..e812e89 100644 --- a/demo/src/index.ts +++ b/demo/src/index.ts @@ -20,7 +20,7 @@ const mirrorXGlyph = (g: Glyph) => const mirrorYGlyph = (g: Glyph) => g.map((l: Line) => l.map((p: Vec) => [1 - p[0], p[1]])); -//alert(`ɐ: ${JSON.stringify(rotateGlyph(font["a"]))},`); +// alert(`ɐ: ${JSON.stringify(mirrorXGlyph(font["S"]))},`); 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;'; diff --git a/demo/src/letters.ts b/demo/src/letters.ts index 5d3fb6a..e4c4b4c 100644 --- a/demo/src/letters.ts +++ b/demo/src/letters.ts @@ -58,5 +58,5 @@ export default [ // Punctuation ...'"⁄_-–—,;;:!¡?¿.…··\'‘’‚‹›"“”„«»()[]{}§¶@*/\\&#%†•′″"', // Currency - ..."₠₡₢₣₤₥₦₧₩₪₫€₭₮₯₰₱₲₳₴₵₶₷₸₹₺₻₼₽₾₿₨", + ..."₠₡₢₣₤₥₦₧₩₪₫€₭₮₯₰₱₲₳₴₵₶₷₸₹₺₻₼₽₾₿₨$£¤¥", ]; diff --git a/src/currency.ts b/src/currency.ts index d6e3aa1..db91d3d 100644 --- a/src/currency.ts +++ b/src/currency.ts @@ -1,6 +1,341 @@ -import { type Font } from "./type"; +import { type Font } from "./type"; export default { + "₠": [ + [ + [0.5, 0.2], + [0.275, 0.2], + [0.275, 0.525], + [0.65, 0.525], + ], + [ + [0.75, 0.35], + [0.5, 0.35], + [0.5, 0.7], + [0.75, 0.7], + ], + ], + "₡": [ + [ + [0.75, 0.25], + [0.35, 0.25], + [0.35, 0.65], + [0.75, 0.65], + ], + [ + [0.5, 0.2], + [0.4, 0.7], + ], + [ + [0.6, 0.2], + [0.5, 0.7], + ], + ], + "₢": [ + [ + [0.75, 0.2], + [0.25, 0.2], + [0.25, 0.7], + [0.75, 0.7], + ], + [ + [0.75, 0.414], + [0.6, 0.414], + [0.5, 0.486], + ], + [ + [0.5, 0.396], + [0.5, 0.7], + ], + ], + "₣": [ + [ + [0.75, 0.2], + [0.35, 0.2], + [0.35, 0.7], + ], + [ + [0.35, 0.45], + [0.55, 0.45], + ], + [ + [0.25, 0.6], + [0.45, 0.6], + ], + ], + "₤": [ + [ + [0.5, 0.2], + [0.35, 0.2], + [0.35, 0.75], + [0.25, 0.75], + [0.25, 0.65], + [0.725, 0.65], + ], + [ + [0.25, 0.4], + [0.65, 0.4], + ], + [ + [0.25, 0.5], + [0.65, 0.5], + ], + ], + "₥": [ + [ + [0.25, 0.7], + [0.25, 0.285], + ], + [ + [0.25, 0.3], + [0.75, 0.3], + [0.75, 0.7], + ], + [ + [0.5, 0.3], + [0.5, 0.7], + ], + [ + [0.75, 0.2], + [0.25, 0.75], + ], + ], + "₦": [ + [ + [0.35, 0.7], + [0.35, 0.2], + [0.65, 0.7], + [0.65, 0.2], + ], + [ + [0.25, 0.4], + [0.75, 0.4], + ], + [ + [0.25, 0.5], + [0.75, 0.5], + ], + ], + "₧": [ + [ + [0.15, 0.557], + [0.5, 0.557], + [0.5, 0.2], + [0.15, 0.2], + [0.15, 0.7], + ], + [ + [0.55, 0.414], + [0.85, 0.414], + ], + [ + [0.65, 0.271], + [0.65, 0.7], + [0.85, 0.7], + ], + ], + "₩": [ + [ + [0.35, 0.2], + [0.4, 0.7], + [0.5, 0.4], + [0.6, 0.7], + [0.65, 0.2], + ], + [ + [0.25, 0.45], + [0.75, 0.45], + ], + ], + "₪": [ + [ + [0.3, 0.7], + [0.3, 0.2], + [0.575, 0.2], + [0.575, 0.5], + ], + [ + [0.7, 0.2], + [0.7, 0.7], + [0.425, 0.7], + [0.425, 0.4], + ], + ], + "₫": [ + [ + [0.75, 0.2], + [0.75, 0.678], + ], + [ + [0.75, 0.65], + [0.25, 0.65], + [0.25, 0.414], + [0.75, 0.414], + ], + [ + [0.8, 0.25], + [0.55, 0.25], + ], + [ + [0.25, 0.7], + [0.75, 0.7], + ], + ], + "€": [ + [ + [0.75, 0.2], + [0.35, 0.2], + [0.35, 0.7], + [0.75, 0.7], + ], + [ + [0.25, 0.4], + [0.55, 0.4], + ], + [ + [0.25, 0.5], + [0.55, 0.5], + ], + ], + "₭": [ + [ + [0.25, 0.2], + [0.25, 0.7], + ], + [ + [0.75, 0.2], + [0.25, 0.45], + [0.75, 0.7], + ], + [ + [0.15, 0.45], + [0.85, 0.45], + ], + ], + "₮": [ + [ + [0.25, 0.2], + [0.75, 0.2], + ], + [ + [0.5, 0.2], + [0.5, 0.7], + ], + [ + [0.75, 0.35], + [0.25, 0.45], + ], + [ + [0.75, 0.45], + [0.25, 0.55], + ], + ], + "₯": [ + [ + [0.25, 0.2], + [0.5, 0.2], + [0.5, 0.7], + [0.3, 0.7], + ], + [ + [0.3, 0.2], + [0.3, 0.7], + ], + [ + [0.6, 0.9], + [0.6, 0.4], + [0.75, 0.4], + [0.75, 0.7], + [0.6, 0.7], + ], + ], + "₰": [ + [ + [0.25, 0.7], + [0.4, 0.5], + [0.5, 0.7], + [0.75, 0.3], + [0.5, 0.3], + [0.75, 0.9], + [0.6, 0.9], + ], + ], + "₱": [ + [ + [0.35, 0.45], + [0.65, 0.45], + [0.65, 0.2], + [0.35, 0.2], + [0.35, 0.7], + ], + [ + [0.25, 0.28], + [0.75, 0.28], + ], + [ + [0.25, 0.37], + [0.75, 0.37], + ], + ], + "₲": [ + [ + [0.75, 0.3], + [0.25, 0.3], + [0.25, 0.6], + [0.75, 0.6], + [0.75, 0.5], + [0.65, 0.5], + ], + [ + [0.5, 0.2], + [0.5, 0.7], + ], + ], + "₳": [ + [ + [0.25, 0.7], + [0.5, 0.2], + [0.75, 0.7], + ], + [ + [0.25, 0.4], + [0.75, 0.4], + ], + [ + [0.25, 0.55], + [0.75, 0.55], + ], + ], + "₴": [ + [ + [0.75, 0.7], + [0.25, 0.7], + [0.25, 0.6], + [0.75, 0.3], + [0.75, 0.2], + [0.25, 0.2], + ], + [ + [0.25, 0.366], + [0.75, 0.366], + ], + [ + [0.25, 0.533], + [0.75, 0.533], + ], + ], + "₵": [ + [ + [0.725, 0.35], + [0.275, 0.35], + [0.275, 0.65], + [0.725, 0.65], + ], + [ + [0.5, 0.2], + [0.5, 0.8], + ], + ], "¢": [ [ [0.725, 0.35], @@ -13,6 +348,220 @@ export default { [0.5, 0.8], ], ], + "₶": [ + [ + [0.25, 0.3], + [0.75, 0.3], + ], + [ + [0.3, 0.2], + [0.3, 0.7], + ], + [ + [0.65, 0.2], + [0.65, 0.6], + [0.67, 0.65], + [0.7, 0.68], + [0.75, 0.7], + ], + ], + "₷": [ + [ + [0.25, 0.7], + [0.25, 0.396], + ], + [ + [0.25, 0.414], + [0.47, 0.414], + [0.47, 0.7], + ], + [ + [0.3625, 0.414], + [0.3625, 0.7], + ], + [ + [0.75, 0.2], + [0.53, 0.2], + [0.53, 0.414], + [0.75, 0.414], + [0.75, 0.7], + [0.53, 0.7], + ], + ], + "₸": [ + [ + [0.25, 0.2], + [0.75, 0.2], + ], + [ + [0.25, 0.3], + [0.75, 0.3], + ], + [ + [0.5, 0.3], + [0.5, 0.7], + ], + ], + "₹": [ + [ + [0.75, 0.2], + [0.25, 0.2], + [0.55, 0.25], + [0.62, 0.3], + [0.65, 0.35], + [0.62, 0.4], + [0.55, 0.45], + [0.25, 0.5], + [0.55, 0.7], + ], + [ + [0.25, 0.35], + [0.75, 0.35], + ], + ], + "₺": [ + [ + [0.35, 0.2], + [0.35, 0.7], + [0.52, 0.67], + [0.63, 0.62], + [0.7, 0.55], + [0.75, 0.45], + ], + [ + [0.25, 0.3], + [0.6, 0.2], + ], + [ + [0.25, 0.4], + [0.6, 0.3], + ], + ], + "₻": [ + [ + [0.75, 0.7], + [0.45, 0.7], + [0.37, 0.67], + [0.35, 0.6], + [0.35, 0.2], + [0.25, 0.2], + [0.25, 0.25], + [0.7, 0.25], + [0.75, 0.3], + [0.75, 0.5], + [0.6, 0.4], + [0.525, 0.5], + [0.45, 0.4], + [0.25, 0.55], + ], + ], + "₼": [ + [ + [0.25, 0.7], + [0.25, 0.5], + [0.35, 0.4], + [0.65, 0.4], + [0.75, 0.5], + [0.75, 0.7], + ], + [ + [0.5, 0.2], + [0.5, 0.6], + ], + ], + "₽": [ + [ + [0.25, 0.5], + [0.75, 0.5], + [0.75, 0.2], + [0.35, 0.2], + [0.35, 0.7], + ], + [ + [0.25, 0.6], + [0.5, 0.6], + ], + ], + "₾": [ + [ + [0.75, 0.3], + [0.35, 0.3], + [0.25, 0.5], + [0.4, 0.6], + [0.75, 0.7], + [0.25, 0.7], + ], + [ + [0.5, 0.2], + [0.5, 0.4], + ], + [ + [0.625, 0.2], + [0.625, 0.4], + ], + ], + "₿": [ + [ + [0.7, 0.45], + [0.7, 0.25], + [0.25, 0.25], + [0.25, 0.65], + [0.75, 0.65], + [0.75, 0.45], + [0.25, 0.45], + ], + [ + [0.33, 0.25], + [0.33, 0.2], + ], + [ + [0.66, 0.25], + [0.66, 0.2], + ], + [ + [0.33, 0.65], + [0.33, 0.7], + ], + [ + [0.66, 0.65], + [0.66, 0.7], + ], + ], + "₨": [ + [ + [0.25, 0.557], + [0.45, 0.557], + [0.45, 0.2], + [0.25, 0.2], + [0.25, 0.7], + ], + [ + [0.25, 0.557], + [0.45, 0.7], + ], + [ + [0.75, 0.414], + [0.55, 0.414], + [0.55, 0.557], + [0.75, 0.557], + [0.75, 0.7], + [0.55, 0.7], + ], + ], + $: [ + [ + [0.75, 0.25], + [0.25, 0.25], + [0.25, 0.557], + [0.75, 0.557], + [0.75, 0.65], + [0.25, 0.65], + ], + [ + [0.5, 0.2], + [0.5, 0.7], + ], + ], "£": [ [ [0.5, 0.25], @@ -71,20 +620,4 @@ export default { [0.75, 0.6], ], ], - "€": [ - [ - [0.75, 0.2], - [0.35, 0.2], - [0.35, 0.7], - [0.75, 0.7], - ], - [ - [0.25, 0.4], - [0.55, 0.4], - ], - [ - [0.25, 0.5], - [0.55, 0.5], - ], - ], } as Font; diff --git a/src/lowercase/base.ts b/src/lowercase/base.ts index ea16624..990efb9 100644 --- a/src/lowercase/base.ts +++ b/src/lowercase/base.ts @@ -3,8 +3,6 @@ import { type Font } from "../type"; /* * Base alphabet */ - -// const base = const base = { a: [ [ diff --git a/src/type.d.ts b/src/type.d.ts index 98582c9..d4e408c 100644 --- a/src/type.d.ts +++ b/src/type.d.ts @@ -7,6 +7,9 @@ export interface Line extends Array {} // A glyph/letter (array of Line) export interface Glyph extends Array {} +// An array of diacritics key (two or three letters ) +export interface DiaGroup extends Array {} + // Table to dupplicate existing glyph with diacriticals marks // The key is used to defined a diacriticized letter (à,ê,ï), // the first item of the array define the base letter w/out diacritics (a, e, i),