Skip to content

Commit

Permalink
some symbols + split currency from punctuation
Browse files Browse the repository at this point in the history
  • Loading branch information
nclslbrn committed May 18, 2024
1 parent 13e79e3 commit b8cd224
Show file tree
Hide file tree
Showing 4 changed files with 173 additions and 91 deletions.
2 changes: 2 additions & 0 deletions demo/src/letters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,6 @@ export default [
..."1234567890",
// Punctuation
...'"⁄_-–—,;;:!¡?¿.…··\'‘’‚‹›"“”„«»()[]{}§¶@*/\\&#%†•′″"',
// Currency
..."₠₡₢₣₤₥₦₧₩₪₫€₭₮₯₰₱₲₳₴₵₶₷₸₹₺₻₼₽₾₿₨",
];
90 changes: 90 additions & 0 deletions src/currency.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
const currency = {
"¢": [
[
[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.5, 0.25],
[0.35, 0.25],
[0.35, 0.75],
[0.25, 0.75],
[0.25, 0.65],
[0.725, 0.65],
],
[
[0.25, 0.45],
[0.65, 0.45],
],
],
"¤": [
[
[0.4, 0.4],
[0.6, 0.4],
[0.6, 0.55],
[0.4, 0.55],
[0.4, 0.4],
],
[
[0.6, 0.4],
[0.65, 0.35],
],
[
[0.6, 0.55],
[0.65, 0.6],
],
[
[0.4, 0.55],
[0.35, 0.6],
],
[
[0.4, 0.4],
[0.35, 0.35],
],
],
"¥": [
[
[0.25, 0.2],
[0.5, 0.5],
[0.75, 0.2],
],
[
[0.5, 0.5],
[0.5, 0.7],
],
[
[0.25, 0.5],
[0.75, 0.5],
],
[
[0.25, 0.6],
[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],
],
],
};

export default currency;
13 changes: 12 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,19 @@ import lowercase from "./lowercase/index";
import uppercase from "./uppercase/index";
import ponctuation from "./poncuation";
import number from "./number";
import currency from "./currency";

const font = { ...lowercase, ...uppercase, ...ponctuation, ...number } as Font;
/*
* Destructure every glyphs groups and assign glyph key to theirs paths
* font.a = [[[x1, y1], [x2, y2]...]]
*/
const font = {
...lowercase,
...uppercase,
...number,
...ponctuation,
...currency,
} as Font;

/**
* A function to move and scale each glyph vertex/point/Vec coordinate
Expand Down
159 changes: 69 additions & 90 deletions src/poncuation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,49 @@ const ponctuation = {
[0.5, 0.7],
],
],
"…": [
[
[0.33, 0.675],
[0.33, 0.7],
],
[
[0.5, 0.675],
[0.5, 0.7],
],
[
[0.66, 0.675],
[0.66, 0.7],
],
],
"·": [
[
[0.5, 0.4875],
[0.5, 0.5125],
],
],
"·": [
[
[0.5, 0.2875],
[0.5, 0.3125],
],
],
",": [
[
[0.5, 0.65],
[0.49, 0.69],
[0.5, 0.675],
[0.48, 0.69],
[0.45, 0.7],
],
],
";": [
[
[0.5, 0.5],
[0.5, 0.525],
],
[
[0.5, 0.65],
[0.5, 0.675],
[0.48, 0.69],
[0.45, 0.7],
],
],
Expand All @@ -20,6 +59,7 @@ const ponctuation = {
[
[0.5, 0.65],
[0.5, 0.675],
[0.48, 0.69],
[0.45, 0.7],
],
],
Expand Down Expand Up @@ -193,15 +233,27 @@ const ponctuation = {
[0.65, 0.45],
],
],
"–": [
[
[0.25, 0.45],
[0.75, 0.45],
],
],
"—": [
[
[0.15, 0.45],
[0.85, 0.45],
],
],
"×": [
[
[0.325, 0.305],
[0.675, 0.655]
[0.675, 0.655],
],
[
[0.675, 0.305],
[0.325, 0.655]
]
[0.325, 0.655],
],
],
_: [
[
Expand Down Expand Up @@ -241,92 +293,6 @@ const ponctuation = {
[0.75, 0.4],
],
],
"¢": [
[
[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.5, 0.25],
[0.35, 0.25],
[0.35, 0.75],
[0.25, 0.75],
[0.25, 0.65],
[0.725, 0.65],
],
[
[0.25, 0.45],
[0.65, 0.45],
],
],
"¤": [
[
[0.4, 0.4],
[0.6, 0.4],
[0.6, 0.55],
[0.4, 0.55],
[0.4, 0.4],
],
[
[0.6, 0.4],
[0.65, 0.35],
],
[
[0.6, 0.55],
[0.65, 0.6],
],
[
[0.4, 0.55],
[0.35, 0.6],
],
[
[0.4, 0.4],
[0.35, 0.35],
],
],
"¥": [
[
[0.25, 0.2],
[0.5, 0.5],
[0.75, 0.2],
],
[
[0.5, 0.5],
[0.5, 0.7],
],
[
[0.25, 0.5],
[0.75, 0.5],
],
[
[0.25, 0.6],
[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],
],
],
"¦": [
[
[0.5, 0.2],
Expand Down Expand Up @@ -511,6 +477,13 @@ const ponctuation = {
[0.5, 0.3],
],
],
"‘": [
[
[0.5125, 0.2],
[0.4875, 0.3],
],
],
//"’": [],
"«": [
[
[0.5, 0.3],
Expand Down Expand Up @@ -581,6 +554,12 @@ const ponctuation = {
[0.5775, 0.3],
],
],
"⁄": [
[
[0.6, 0.35],
[0.3, 0.65],
],
],
"¼": [
[
[0.6, 0.35],
Expand Down

0 comments on commit b8cd224

Please sign in to comment.