diff --git a/src/font/index.js b/src/font/index.js index 3d8df2f..2b0335e 100644 --- a/src/font/index.js +++ b/src/font/index.js @@ -10,11 +10,14 @@ import { import { SPECIAL } from './special.js'; +import { + LATIN +} from './latin.js'; import { TOFU } from './util.js'; -const DATA = Object.assign({}, UPPER, LOWER, NUMBER, SPECIAL); +const DATA = Object.assign({}, UPPER, LOWER, NUMBER, SPECIAL, LATIN); export function typo(v) { var t = DATA[v] || DATA[TOFU]; diff --git a/src/font/latin.js b/src/font/latin.js new file mode 100644 index 0000000..c55b68a --- /dev/null +++ b/src/font/latin.js @@ -0,0 +1,625 @@ +import { + generateFontData, + ROTATE_HORIZONTAL, + ROTATE_VERTICAL, + VERTEX_GAP2, + getR, + getCurveR +} from './util.js'; +import { + DATA_UA, + DATA_UC, + DATA_UE, + DATA_UG, + DATA_UH, + DATA_UI, + DATA_UJ, + DATA_UN, + DATA_UO, + DATA_US, + DATA_UU, + DATA_UY +} from './upper.js'; +import { + DATA_LA, + DATA_LC, + DATA_LE, + DATA_LG, + DATA_LH, + DATA_LN, + DATA_LO, + DATA_LS, + DATA_LU, + DATA_LY +} from './lower.js'; + +function getLatin1(x, y) { + const tx = 140 + x; + const ty = -390 - 78 + y; + return [{ + d: -1, + v: [ + ['m', -40 + tx, 350 + ty, { + x: 0, + y: 0, + r: getR(-40 + tx, 350 + ty, 0 + tx, 60 + 350 + ty) + }], + ['l', 0 + tx, 60 + 350 + ty, { + x: 0, + y: 0, + f: 1 + }], + ] + }]; +} + +function getLatin2(x, y) { + const tx = 150 + x; + const ty = -390 - 78 + y; + return [{ + d: -1, + v: [ + ['m', 40 + tx, 350 + ty, { + x: 0, + y: 0, + r: getR(40 + tx, 350 + ty, 0 + tx, 60 + 350 + ty) + }], + ['l', 0 + tx, 60 + 350 + ty, { + x: 0, + y: 0, + f: 1 + }], + ] + }]; +} + +function getLatin3(x, y) { + const tx = 77 + x; + const ty = -30 - 78 + y; + return [{ + d: -1, + v: [ + ['m', 0 + tx, 50 + ty, { + r: getR(0 + tx, 50 + ty, 68 - VERTEX_GAP2 + tx, 0 + ty), + y: 0, + x: 0 + }], + ['l', 68 - VERTEX_GAP2 + tx, 0 + ty, { + r: getR(0 + tx, 50 + ty, 68 - VERTEX_GAP2 + tx, 0 + ty), + y: 0, + x: 0, + f: 1, + }], + ['l', 68 + VERTEX_GAP2 + tx, 0 + ty, { + r: getR(68 + VERTEX_GAP2 + tx, 0 + ty, 68 + 68 + tx, 50 + ty), + y: 0, + x: 0, + f: 1, + v: 1 + }], + ['l', 68 + 68 + tx, 50 + ty, { + y: 0, + x: 0, + f: 1 + }] + ] + }]; +} + +function getLatin4(x, y) { + const tx = 65 + x; + const ty = -16 - 78 + y; + const scale = 0.8; + return [{ + d: 1, + v: [ + ['m', 199.4 * scale + tx, 20.7 * scale + ty, { + x: -1, + y: -0.2, + r: getCurveR(199.4 * scale + tx, 20.7 * scale + ty, 187.6 * scale + tx, 36.6 * scale + ty, 168.2 * scale + tx, 47.1 * scale + ty, 148.2 * scale + tx, 47.1 * scale + ty, 0), + f: 1 + }], + ['b', 187.6 * scale + tx, 36.6 * scale + ty, 168.2 * scale + tx, 47.1 * scale + ty, 148.2 * scale + tx, 47.1 * scale + ty, { + x: -1, + y: -0.2, + r: ROTATE_VERTICAL + }], + ['b', 129.1 * scale + tx, 47.1 * scale + ty, 112.1 * scale + tx, 36.6 * scale + ty, 95.3 * scale + tx, 25.5 * scale + ty, { + x: -1, + y: -0.2 + }], + ['b', 76.8 * scale + tx, 13.2 * scale + ty, 59.1 * scale + tx, 0 * scale + ty, 39.6 * scale + tx, 0 * scale + ty, { + x: -1, + y: -0.2, + r: ROTATE_VERTICAL + }], + ['b', 22.3 * scale + tx, 0 * scale + ty, 10.9 * scale + tx, 8.9 * scale + ty, 0 * scale + tx, 20 * scale + ty, { + x: -1, + y: -0.2 + }], + ] + }]; +} + +function getLatin5(x, y) { + return [{ + d: 1, + v: [ + ['a', 145 - 50 + x, -78 + y, { + x: 0, + y: 0 + }], + ] + }, { + d: 1, + v: [ + ['a', 145 + 50 + x, -78 + y, { + x: 0, + y: 0 + }], + ] + }]; +} + +function getLatin6(x, y) { + const tx = x; + const ty = y; + return [{ + d: 1, + v: [ + ['m', 112.7 + tx, 0.0 + ty, { + r: getCurveR(112.7 + tx, 0.0 + ty + tx, 10.1 + ty, 110.1 + tx, 19.3 + ty, 105.0 + tx, 27.7 + ty, 0), + x: 0, + y: 0, + f: 1 + }], + ['b', 112.7 + tx, 10.1 + ty, 110.1 + tx, 19.3 + ty, 105.0 + tx, 27.7 + ty, { + x: 0, + y: 0, + }], + ['b', 99.8 + tx, 36.1 + ty, 92.9 + tx, 42.8 + ty, 84.3 + tx, 47.7 + ty, { + x: 0, + y: 0, + }], + ['b', 75.7 + tx, 52.6 + ty, 66.7 + tx, 55.0 + ty, 57.3 + tx, 55.0 + ty, { + x: 0, + y: 0, + }], + ['b', 47.5 + tx, 55.0 + ty, 38.3 + tx, 52.6 + ty, 29.6 + tx, 47.7 + ty, { + x: 0, + y: 0, + }], + ['b', 20.8 + tx, 42.8 + ty, 13.8 + tx, 36.1 + ty, 8.5 + tx, 27.7 + ty, { + x: 0, + y: 0, + }], + ['b', 3.2 + tx, 19.3 + ty, 0.5 + tx, 10.1 + ty, 0.5 + tx, 0.0 + ty, { + x: 0, + y: 0, + }], + ] + }]; +} + +function getLatin7(x, y) { + const tx = 88 + x; + const ty = -116 + y; + const scale = 0.5; + return [{ + d: 1, + v: [ + ['m', 232 * scale + tx, 116 * scale + ty, { + r: ROTATE_HORIZONTAL, + p: 1, + f: 1 + }], + ['b', 232 * scale + tx, 180.1 * scale + ty, 180.1 * scale + tx, 232 * scale + ty, 116 * scale + tx, 232 * scale + ty, { + r: ROTATE_VERTICAL + }], + ['b', 51.9 * scale + tx, 232 * scale + ty, 0 * scale + tx, 180.1 * scale + ty, 0 * scale + tx, 116 * scale + ty, { + r: ROTATE_HORIZONTAL + }], + ['b', 0 * scale + tx, 51.9 * scale + ty, 51.9 * scale + tx, 0 * scale + ty, 116 * scale + tx, 0 * scale + ty, { + r: ROTATE_VERTICAL + }], + ['b', 180.1 * scale + tx, 0 * scale + ty, 232 * scale + tx, 51.9 * scale + ty, 232 * scale + tx, 116 * scale + ty, { + r: ROTATE_HORIZONTAL, + c: 1 + }], + ] + }] +} + +const DATA_LI = [{ + d: 1, + v: [ + ['m', 0, 352, { + y: 0, + f: 1 + }], + ['l', 0, 130, { + y: -3 + }], + ] +}]; + +const DATA_LJ = [{ + d: 1, + v: [ + ['m', 0 - 115.9, 317 + 127, { + x: 0.4, + y: 0.63, + r: getCurveR(0 - 115.9, 317 + 127, 12.6 - 115.9, 327.4 + 127, 29.6 - 115.9, 333.2 + 127, 45.9 - 115.9, 334.2 + 127, 0), + f: 1 + }], + ['b', 12.6 - 115.9, 327.4 + 127, 29.6 - 115.9, 333.2 + 127, 45.9 - 115.9, 334.2 + 127, { + x: 0.4, + y: 0.63, + r: ROTATE_VERTICAL + }], + ['b', 84.5 - 115.9, 336.5 + 127, 115.9 - 115.9, 308.1 + 127, 115.9 - 115.9, 269.4 + 127, { + x: 0.4, + y: 0.63, + r: ROTATE_HORIZONTAL + }], + ['l', 115.9 - 115.9, 0 + 127 + 3, { + y: -3 + }], + ] +}]; + +export const LATIN = { + 'À': generateFontData( + 620, 290, 352, + 0, 0, 0, 0, + JSON.parse(JSON.stringify(DATA_UA)).concat(getLatin1(0, 20)) + ), + 'Á': generateFontData( + 620, 290, 352, + 0, 0, 0, 0, + JSON.parse(JSON.stringify(DATA_UA)).concat(getLatin2(0, 20)) + ), + 'Â': generateFontData( + 620, 290, 352, + 0, 0, 0, 0, + JSON.parse(JSON.stringify(DATA_UA)).concat(getLatin3(0, 0)) + ), + 'Ã': generateFontData( + 620, 290, 352, + 0, 0, 0, 0, + JSON.parse(JSON.stringify(DATA_UA)).concat(getLatin4(0, 20)) + ), + 'Ä': generateFontData( + 620, 290, 352, + 0, 0, 0, 0, + JSON.parse(JSON.stringify(DATA_UA)).concat(getLatin5(0, 20)) + ), + 'Å': generateFontData( + 620, 290, 352, + 0, 0, 0, 0, + JSON.parse(JSON.stringify(DATA_UA)).concat(getLatin7(0, 0)) + ), + 'à': generateFontData( + 600, 232, 232, + 10, 2, -64, -64, + JSON.parse(JSON.stringify(DATA_LA)).concat(getLatin1(-29, -15)) + ), + 'á': generateFontData( + 600, 232, 232, + 10, 2, -64, -64, + JSON.parse(JSON.stringify(DATA_LA)).concat(getLatin2(-29, -15)) + ), + 'â': generateFontData( + 600, 232, 232, + 10, 2, -64, -64, + JSON.parse(JSON.stringify(DATA_LA)).concat(getLatin3(-29, -15)) + ), + 'ã': generateFontData( + 600, 232, 232, + 10, 2, -64, -64, + JSON.parse(JSON.stringify(DATA_LA)).concat(getLatin4(-29, -15)) + ), + 'ä': generateFontData( + 600, 232, 232, + 10, 2, -64, -64, + JSON.parse(JSON.stringify(DATA_LA)).concat(getLatin5(9, -15)) + ), + 'å': generateFontData( + 600, 232, 232, + 10, 2, -64, -64, + JSON.parse(JSON.stringify(DATA_LA)).concat(getLatin7(-30, 0)) + ), + 'È': generateFontData( + 520, 192, 352, + -5, -80, 0, 0, + JSON.parse(JSON.stringify(DATA_UE)).concat(getLatin1(-40, 0)) + ), + 'É': generateFontData( + 520, 192, 352, + -5, -80, 0, 0, + JSON.parse(JSON.stringify(DATA_UE)).concat(getLatin2(-40, 0)) + ), + 'Ê': generateFontData( + 520, 192, 352, + -5, -80, 0, 0, + JSON.parse(JSON.stringify(DATA_UE)).concat(getLatin3(-49, 0)) + ), + 'Ë': generateFontData( + 520, 192, 352, + -5, -80, 0, 0, + JSON.parse(JSON.stringify(DATA_UE)).concat(getLatin5(-40, 0)) + ), + 'è': generateFontData( + 570, 225.5, 233.1, + 0, 0, -64, -64, + JSON.parse(JSON.stringify(DATA_LE)).concat(getLatin1(-28, -14)) + ), + 'é': generateFontData( + 570, 225.5, 233.1, + 0, 0, -64, -64, + JSON.parse(JSON.stringify(DATA_LE)).concat(getLatin2(-28, -14)) + ), + 'ê': generateFontData( + 570, 225.5, 233.1, + 0, 0, -64, -64, + JSON.parse(JSON.stringify(DATA_LE)).concat(getLatin3(-28, -14)) + ), + 'ë': generateFontData( + 570, 225.5, 233.1, + 0, 0, -64, -64, + JSON.parse(JSON.stringify(DATA_LE)).concat(getLatin5(-28, -14)) + ), + 'Ì': generateFontData( + 249, 0, 352, + 0, 0, 0, 0, + JSON.parse(JSON.stringify(DATA_UI)).concat(getLatin1(-145, 0)) + ), + 'Í': generateFontData( + 249, 0, 352, + 0, 0, 0, 0, + JSON.parse(JSON.stringify(DATA_UI)).concat(getLatin2(-145, 0)) + ), + 'Î': generateFontData( + 249, 0, 352, + 0, 0, 0, 0, + JSON.parse(JSON.stringify(DATA_UI)).concat(getLatin3(-145, 0)) + ), + 'Ï': generateFontData( + 249, 0, 352, + 0, 0, 0, 0, + JSON.parse(JSON.stringify(DATA_UI)).concat(getLatin5(-145, 0)) + ), + 'ì': generateFontData( + 200, 0, 352, + 0, 0, 0, 0, + JSON.parse(JSON.stringify(DATA_LI)).concat(getLatin1(-145, 109)) + ), + 'í': generateFontData( + 200, 0, 352, + 0, 0, 0, 0, + JSON.parse(JSON.stringify(DATA_LI)).concat(getLatin2(-145, 109)) + ), + 'î': generateFontData( + 200, 0, 352, + 0, 0, 0, 0, + JSON.parse(JSON.stringify(DATA_LI)).concat(getLatin3(-145, 109)) + ), + 'ï': generateFontData( + 200, 0, 352, + 0, 0, 0, 0, + JSON.parse(JSON.stringify(DATA_LI)).concat(getLatin5(-145, 109)) + ), + 'Ñ': generateFontData( + 721, 250, 352, + 0, 0, 0, 0, + JSON.parse(JSON.stringify(DATA_UN)).concat(getLatin4(-20, 0)) + ), + 'ñ': generateFontData( + 520, 182, 352, + 0, 0, 0, 0, + JSON.parse(JSON.stringify(DATA_LN)).concat(getLatin4(-54, 109)) + ), + 'Ò': generateFontData( + 850, 360, 360, + 0, 0, 0, 0, + JSON.parse(JSON.stringify(DATA_UO)).concat(getLatin1(35, 4)) + ), + 'Ó': generateFontData( + 850, 360, 360, + 0, 0, 0, 0, + JSON.parse(JSON.stringify(DATA_UO)).concat(getLatin2(35, 4)) + ), + 'Ô': generateFontData( + 850, 360, 360, + 0, 0, 0, 0, + JSON.parse(JSON.stringify(DATA_UO)).concat(getLatin3(35, 4)) + ), + 'Õ': generateFontData( + 850, 360, 360, + 0, 0, 0, 0, + JSON.parse(JSON.stringify(DATA_UO)).concat(getLatin4(35, 4)) + ), + 'Ö': generateFontData( + 850, 360, 360, + 0, 0, 0, 0, + JSON.parse(JSON.stringify(DATA_UO)).concat(getLatin5(35, 4)) + ), + 'Ø': generateFontData( + 850, 360, 360, + 0, 0, 0, 0, + JSON.parse(JSON.stringify(DATA_UO)).concat([{ + d: 1, + v: [ + ['m', 0, 360, { + r: getR(0, 360, 360, 0), + f: 1, + x: 0, + y: 1 + }], + ['l', 360, 0, { + x: 0, + y: 1 + }] + ] + }]) + ), + 'ò': generateFontData( + 580, 232, 232, + 0, 0, -64, -64, + JSON.parse(JSON.stringify(DATA_LO)).concat(getLatin1(-29, -15)) + ), + 'ó': generateFontData( + 580, 232, 232, + 0, 0, -64, -64, + JSON.parse(JSON.stringify(DATA_LO)).concat(getLatin2(-29, -15)) + ), + 'ô': generateFontData( + 580, 232, 232, + 0, 0, -64, -64, + JSON.parse(JSON.stringify(DATA_LO)).concat(getLatin3(-29, -15)) + ), + 'õ': generateFontData( + 580, 232, 232, + 0, 0, -64, -64, + JSON.parse(JSON.stringify(DATA_LO)).concat(getLatin4(-29, -15)) + ), + 'ö': generateFontData( + 580, 232, 232, + 0, 0, -64, -64, + JSON.parse(JSON.stringify(DATA_LO)).concat(getLatin5(-29, -15)) + ), + 'ø': generateFontData( + 580, 232, 232, + 0, 0, -64, -64, + JSON.parse(JSON.stringify(DATA_LO)).concat([{ + d: 1, + v: [ + ['m', 0, 232, { + r: getR(0, 232, 232, 0), + f: 1, + x: 0, + y: 1 + }], + ['l', 232, 0, { + x: 0, + y: 1 + }] + ] + }]) + ), + 'Ù': generateFontData( + 712, 250, 355, + 0, 0, -0.5, -0.5, + JSON.parse(JSON.stringify(DATA_UU)).concat(getLatin1(-20, 1)) + ), + 'Ú': generateFontData( + 712, 250, 355, + 0, 0, -0.5, -0.5, + JSON.parse(JSON.stringify(DATA_UU)).concat(getLatin2(-20, 1)) + ), + 'Û': generateFontData( + 712, 250, 355, + 0, 0, -0.5, -0.5, + JSON.parse(JSON.stringify(DATA_UU)).concat(getLatin3(-20, 1)) + ), + 'Ŭ': generateFontData( + 712, 250, 355, + 0, 0, -0.5, -0.5, + JSON.parse(JSON.stringify(DATA_UU)).concat(getLatin6(69, -107)) + ), + 'Ü': generateFontData( + 712, 250, 355, + 0, 0, -0.5, -0.5, + JSON.parse(JSON.stringify(DATA_UU)).concat(getLatin5(-20, 1)) + ), + 'ù': generateFontData( + 520, 182, 352, + 0, 0, 0, 0, + JSON.parse(JSON.stringify(DATA_LU)).concat(getLatin1(-54, 109)) + ), + 'ú': generateFontData( + 520, 182, 352, + 0, 0, 0, 0, + JSON.parse(JSON.stringify(DATA_LU)).concat(getLatin2(-54, 109)) + ), + 'û': generateFontData( + 520, 182, 352, + 0, 0, 0, 0, + JSON.parse(JSON.stringify(DATA_LU)).concat(getLatin3(-54, 109)) + ), + 'ŭ': generateFontData( + 520, 182, 352, + 0, 0, 0, 0, + JSON.parse(JSON.stringify(DATA_LU)).concat(getLatin6(34, 0)) + ), + 'ü': generateFontData( + 520, 182, 352, + 0, 0, 0, 0, + JSON.parse(JSON.stringify(DATA_LU)).concat(getLatin5(-54, 109)) + ), + 'Ý': generateFontData( + 673, 270, 352, + 0, 0, 0, 0, + JSON.parse(JSON.stringify(DATA_UY)).concat(getLatin2(-10, 0)) + ), + 'ý': generateFontData( + 500, 225.5, 331.5, + 10, 10, -119, -119, + JSON.parse(JSON.stringify(DATA_LY)).concat(getLatin2(-30, -20)) + ), + 'ÿ': generateFontData( + 500, 225.5, 331.5, + 10, 10, -119, -119, + JSON.parse(JSON.stringify(DATA_LY)).concat(getLatin5(-30, -20)) + ), + 'Ĉ': generateFontData( + 700, 293.1, 360, + 0, 0, 0, 0, + JSON.parse(JSON.stringify(DATA_UC)).concat(getLatin3(20, 4)) + ), + 'Ĝ': generateFontData( + 840, 352, 360, + 0, 0, 0, 0, + JSON.parse(JSON.stringify(DATA_UG)).concat(getLatin3(30, 4)) + ), + 'Ĥ': generateFontData( + 684, 232, 352, + 0, 0, 0, 0, + JSON.parse(JSON.stringify(DATA_UH)).concat(getLatin3(-29, 0)) + ), + 'Ĵ': generateFontData( + 472, 172.5, 355.5, + 10, 20, -2, -2, + JSON.parse(JSON.stringify(DATA_UJ)).concat(getLatin3(-50, 0)) + ), + 'Ŝ': generateFontData( + 560, 224, 360, + 0, 0, 0, 0, + JSON.parse(JSON.stringify(DATA_US)).concat(getLatin3(-30, 4)) + ), + 'ĉ': generateFontData( + 520, 212.1, 233.1, + 2, -10, -64, -64, + JSON.parse(JSON.stringify(DATA_LC)).concat(getLatin3(-29, -14)) + ), + 'ĝ': generateFontData( + 600, 232, 338, + 10, 2, -117, -117, + JSON.parse(JSON.stringify(DATA_LG)).concat(getLatin3(-29, -15)) + ), + 'ĥ': generateFontData( + 520, 182, 352, + 0, 0, 0, 0, + JSON.parse(JSON.stringify(DATA_LH)).concat(getLatin3(-52, 9)) + ), + 'ĵ': generateFontData( + 220, 115.9, 352, + -60, -60, 0, 0, + JSON.parse(JSON.stringify(DATA_LJ)).concat(getLatin3(-155, 109)) + ), + 'ŝ': generateFontData( + 400, 224 * 0.642, 360 * 0.642, + 0, 0, -64, -64, + JSON.parse(JSON.stringify(DATA_LS)).concat(getLatin3(-73, -15)) + ), +}; \ No newline at end of file diff --git a/src/font/lower.js b/src/font/lower.js index d820a73..a9dfe39 100644 --- a/src/font/lower.js +++ b/src/font/lower.js @@ -9,39 +9,291 @@ import { getCurveR } from './util.js'; +export const DATA_LA = [{ + d: -1, + v: [ + ['m', 232, 8, { + y: -3.4, + r: ROTATE_HORIZONTAL + }], + ['l', 232, 116, { + r: ROTATE_NONE + }], + ['b', 232, 180.1, 180.1, 232, 116, 232, { + r: ROTATE_VERTICAL + }], + ['b', 51.9, 232, 0, 180.1, 0, 116, { + r: ROTATE_HORIZONTAL + }], + ['b', 0, 51.9, 51.9, 0, 116, 0, { + r: ROTATE_VERTICAL + }], + ['b', 180.1, 0, 232, 51.9, 232, 116, { + r: ROTATE_HORIZONTAL + }], + ['l', 232, 224, { + y: -0.1, + r: ROTATE_HORIZONTAL, + f: 1 + }] + ] +}]; + +export const DATA_LC = [{ + d: 1, + v: [ + ['m', 212.1, 182.9, { + r: getCurveR(212.1, 182.9, 191.1, 213.2, 156.1, 233.1, 116.5, 233.1, 0), + f: 1 + }], + ['b', 191.1, 213.2, 156.1, 233.1, 116.5, 233.1, { + r: ROTATE_VERTICAL + }], + ['b', 52.4, 233.1, 0.5, 181.2, 0.5, 117.1, { + r: ROTATE_HORIZONTAL + }], + ['b', 0.5, 53, 52.4, 1.1, 116.5, 1.1, { + r: ROTATE_VERTICAL + }], + ['b', 156.1, 1.1, 191.1, 21, 212.1, 51.3], + ] +}]; + +export const DATA_LE = [{ + d: 1, + v: [ + ['m', 211.6, 182.9, { + r: getCurveR(211.6, 182.9, 191.1, 213.2, 156.1, 233.1, 116.5, 233.1, 0), + f: 1 + }], + ['b', 191.1, 213.2, 156.1, 233.1, 116.5, 233.1, { + r: ROTATE_VERTICAL + }], + ['b', 52.4, 233.1, 0.5, 181.2, 0.5, 117.1, { + r: ROTATE_HORIZONTAL + }], + ['b', 0.5, 53, 52.4, 1.1, 116.5, 1.1, { + r: ROTATE_VERTICAL + }], + ['b', 176.4, 1.1, 224.9, 47.2, 225.5, 106.1, { + r: ROTATE_HORIZONTAL + }], + ['l', 0.5, 106.1, { + r: ROTATE_HORIZONTAL, + p: 1 + }], + ] +}]; + +export const DATA_LG = [{ + d: -1, + v: [ + ['m', 232, 5, { + y: -2.8 + }], + ['l', 232, 116, { + r: ROTATE_NONE + }], + ['b', 232, 180.1, 180.1, 232, 116, 232, { + r: ROTATE_VERTICAL + }], + ['b', 51.9, 232, 0, 180.1, 0, 116, { + r: ROTATE_HORIZONTAL + }], + ['b', 0, 51.9, 51.9, 0, 116, 0, { + r: ROTATE_VERTICAL + }], + ['b', 180.1, 0, 232, 51.9, 232, 116, { + r: ROTATE_HORIZONTAL + }], + ['l', 232, 222], + ['b', 234.5, 300.3, 180.2, 338.5, 116, 338, { + y: 0.64, + r: ROTATE_VERTICAL + }], + ['b', 76.2, 337.7, 36.6, 320.7, 15.7, 290.1, { + y: 0.64, + f: 1 + }], + ] +}]; + +export const DATA_LH = [{ + d: -1, + v: [ + ['m', 0, 0, { + y: 0, + r: ROTATE_HORIZONTAL + }], + ['l', 0, 352, { + y: 0, + f: 1 + }], + ] +}, { + d: -1, + v: [ + ['m', 0, 91 + 123, { + r: ROTATE_NONE + }], + ['b', 0, 40.7 + 123, 40.7, 0 + 123, 91, 0 + 123, { + r: ROTATE_VERTICAL + }], + ['b', 141.3, 0 + 123, 182, 40.7 + 123, 182, 91 + 123, { + r: ROTATE_HORIZONTAL + }], + ['l', 182, 352, { + y: 0, + f: 1 + }], + ] +}]; + + +export const DATA_LN = [{ + d: -1, + v: [ + ['m', 0, 130, { + y: -3.3 + }], + ['l', 0, 352, { + y: 0, + f: 1 + }], + ] +}, { + d: -1, + v: [ + ['m', 0, 91 + 123, { + y: 0, + r: ROTATE_HORIZONTAL, + p: 1 + }], + ['b', 0, 40.7 + 123, 40.7, 0 + 123, 91, 0 + 123, { + r: ROTATE_VERTICAL + }], + ['b', 141.3, 0 + 123, 182, 40.7 + 123, 182, 91 + 123, { + r: ROTATE_HORIZONTAL + }], + ['l', 182, 352, { + y: 0, + f: 1 + }], + ] +}]; + +export const DATA_LO = [{ + d: 1, + v: [ + ['m', 232, 116, { + r: ROTATE_HORIZONTAL, + p: 1, + f: 1 + }], + ['b', 232, 180.1, 180.1, 232, 116, 232, { + r: ROTATE_VERTICAL + }], + ['b', 51.9, 232, 0, 180.1, 0, 116, { + r: ROTATE_HORIZONTAL + }], + ['b', 0, 51.9, 51.9, 0, 116, 0, { + r: ROTATE_VERTICAL + }], + ['b', 180.1, 0, 232, 51.9, 232, 116, { + r: ROTATE_HORIZONTAL, + c: 1 + }], + ] +}]; + +export const DATA_LS = [{ + d: 1, + v: [ + ['m', 0 * 0.642, 295.4 * 0.642, { + r: getCurveR(0 * 0.642, 295.4 * 0.642, 17.6 * 0.642, 332.1 * 0.642, 58.3 * 0.642, 360 * 0.642, 110.3 * 0.642, 360 * 0.642, 0), + f: 1 + }], + ['b', 17.6 * 0.642, 332.1 * 0.642, 58.3 * 0.642, 360 * 0.642, 110.3 * 0.642, 360 * 0.642], + ['b', 173.9 * 0.642, 360 * 0.642, 223.8 * 0.642, 329.6 * 0.642, 224 * 0.642, 271 * 0.642], + ['b', 224.2 * 0.642, 214.7 * 0.642, 180.7 * 0.642, 189.6 * 0.642, 112.4 * 0.642, 173.3 * 0.642], + ['b', 47.3 * 0.642, 157.7 * 0.642, 10.9 * 0.642, 130.6 * 0.642, 12 * 0.642, 84.4 * 0.642], + ['b', 13.3 * 0.642, 29.8 * 0.642, 57.3 * 0.642, 0 * 0.642, 114.8 * 0.642, 0 * 0.642], + ['b', 158.4 * 0.642, 0 * 0.642, 196.5 * 0.642, 20.5 * 0.642, 212 * 0.642, 51.3 * 0.642], + ] +}]; + +export const DATA_LU = [{ + d: -1, + v: [ + ['m', 0, 130, { + y: -3 + }], + ['l', 0, 0 + 265, { + r: ROTATE_HORIZONTAL + }], + ['b', 0, 50.3 + 265, 40.7, 91 + 265, 91, 91 + 265, { + r: ROTATE_VERTICAL + }], + ['b', 141.3, 91 + 265, 182, 50.3 + 265, 182, 0 + 265, { + r: ROTATE_HORIZONTAL, + p: 1, + f: 1, + }], + ] + }, + { + d: -1, + v: [ + ['m', 182, 130, { + y: -3 + }], + ['l', 182, 352, { + y: 0, + f: 1 + }], + ] + } +]; + +export const DATA_LY = [{ + d: -1, + v: [ + ['m', 225.5, 0, { + y: -3, + r: getR(225.5, 0, 116.3, 248.8) + }], + ['l', 116.3, 248.8, { + x: 0.5, + y: 0.64 + }], + ['b', 71.8, 349.6, 0, 331.5, 0, 331.5, { + x: 0.5, + y: 0.64, + r: getCurveR(0, 331.5, 71.8, 349.6, 116.3, 248.8, 0, 331.5, 0), + f: 1 + }], + ] + }, + { + d: -1, + v: [ + ['m', 3.2, 0, { + y: -3, + r: getR(3.2, 0, 125.7, 226.6) + }], + ['l', 125.7, 226.6, { + p: 1, + f: 1 + }], + ] + } +]; + export const LOWER = { 'a': generateFontData( 600, 232, 232, 10, 2, -64, -64, - [{ - d: -1, - v: [ - ['m', 232, 8, { - y: -3.4, - r: ROTATE_HORIZONTAL - }], - ['l', 232, 116, { - r: ROTATE_NONE - }], - ['b', 232, 180.1, 180.1, 232, 116, 232, { - r: ROTATE_VERTICAL - }], - ['b', 51.9, 232, 0, 180.1, 0, 116, { - r: ROTATE_HORIZONTAL - }], - ['b', 0, 51.9, 51.9, 0, 116, 0, { - r: ROTATE_VERTICAL - }], - ['b', 180.1, 0, 232, 51.9, 232, 116, { - r: ROTATE_HORIZONTAL - }], - ['l', 232, 224, { - y: -0.1, - r: ROTATE_HORIZONTAL, - f: 1 - }] - ] - }, ] + JSON.parse(JSON.stringify(DATA_LA)) ), 'b': generateFontData( 600, 232, 352, @@ -80,25 +332,7 @@ export const LOWER = { 'c': generateFontData( 520, 212.1, 233.1, 2, -10, -64, -64, - [{ - d: 1, - v: [ - ['m', 212.1, 182.9, { - r: getCurveR(212.1, 182.9, 191.1, 213.2, 156.1, 233.1, 116.5, 233.1, 0), - f: 1 - }], - ['b', 191.1, 213.2, 156.1, 233.1, 116.5, 233.1, { - r: ROTATE_VERTICAL - }], - ['b', 52.4, 233.1, 0.5, 181.2, 0.5, 117.1, { - r: ROTATE_HORIZONTAL - }], - ['b', 0.5, 53, 52.4, 1.1, 116.5, 1.1, { - r: ROTATE_VERTICAL - }], - ['b', 156.1, 1.1, 191.1, 21, 212.1, 51.3], - ] - }] + JSON.parse(JSON.stringify(DATA_LC)) ), 'd': generateFontData( 600, 232, 352, @@ -134,31 +368,7 @@ export const LOWER = { 'e': generateFontData( 570, 225.5, 233.1, 0, 0, -64, -64, - [{ - d: 1, - v: [ - ['m', 211.6, 182.9, { - r: getCurveR(211.6, 182.9, 191.1, 213.2, 156.1, 233.1, 116.5, 233.1, 0), - f: 1 - }], - ['b', 191.1, 213.2, 156.1, 233.1, 116.5, 233.1, { - r: ROTATE_VERTICAL - }], - ['b', 52.4, 233.1, 0.5, 181.2, 0.5, 117.1, { - r: ROTATE_HORIZONTAL - }], - ['b', 0.5, 53, 52.4, 1.1, 116.5, 1.1, { - r: ROTATE_VERTICAL - }], - ['b', 176.4, 1.1, 224.9, 47.2, 225.5, 106.1, { - r: ROTATE_HORIZONTAL - }], - ['l', 0.5, 106.1, { - r: ROTATE_HORIZONTAL, - p: 1 - }], - ] - }] + JSON.parse(JSON.stringify(DATA_LE)) ), 'f': generateFontData( 356, 232, 352, @@ -200,72 +410,12 @@ export const LOWER = { 'g': generateFontData( 600, 232, 338, 10, 2, -117, -117, - [{ - d: -1, - v: [ - ['m', 232, 5, { - y: -2.8 - }], - ['l', 232, 116, { - r: ROTATE_NONE - }], - ['b', 232, 180.1, 180.1, 232, 116, 232, { - r: ROTATE_VERTICAL - }], - ['b', 51.9, 232, 0, 180.1, 0, 116, { - r: ROTATE_HORIZONTAL - }], - ['b', 0, 51.9, 51.9, 0, 116, 0, { - r: ROTATE_VERTICAL - }], - ['b', 180.1, 0, 232, 51.9, 232, 116, { - r: ROTATE_HORIZONTAL - }], - ['l', 232, 222], - ['b', 234.5, 300.3, 180.2, 338.5, 116, 338, { - y: 0.64, - r: ROTATE_VERTICAL - }], - ['b', 76.2, 337.7, 36.6, 320.7, 15.7, 290.1, { - y: 0.64, - f: 1 - }], - ] - }] + JSON.parse(JSON.stringify(DATA_LG)) ), 'h': generateFontData( 520, 182, 352, 0, 0, 0, 0, - [{ - d: -1, - v: [ - ['m', 0, 0, { - y: 0, - r: ROTATE_HORIZONTAL - }], - ['l', 0, 352, { - y: 0, - f: 1 - }], - ] - }, { - d: -1, - v: [ - ['m', 0, 91 + 123, { - r: ROTATE_NONE - }], - ['b', 0, 40.7 + 123, 40.7, 0 + 123, 91, 0 + 123, { - r: ROTATE_VERTICAL - }], - ['b', 141.3, 0 + 123, 182, 40.7 + 123, 182, 91 + 123, { - r: ROTATE_HORIZONTAL - }], - ['l', 182, 352, { - y: 0, - f: 1 - }], - ] - }] + JSON.parse(JSON.stringify(DATA_LH)) ), 'i': generateFontData( 200, 0, 352, @@ -445,66 +595,12 @@ export const LOWER = { 'n': generateFontData( 520, 182, 352, 0, 0, 0, 0, - [{ - d: -1, - v: [ - ['m', 0, 130, { - y: -3.3 - }], - ['l', 0, 352, { - y: 0, - f: 1 - }], - ] - }, { - d: -1, - v: [ - ['m', 0, 91 + 123, { - y: 0, - r: ROTATE_HORIZONTAL, - p: 1 - }], - ['b', 0, 40.7 + 123, 40.7, 0 + 123, 91, 0 + 123, { - r: ROTATE_VERTICAL - }], - ['b', 141.3, 0 + 123, 182, 40.7 + 123, 182, 91 + 123, { - r: ROTATE_HORIZONTAL - }], - ['l', 182, 352, { - y: 0, - f: 1 - }], - ] - } - - ] + JSON.parse(JSON.stringify(DATA_LN)) ), 'o': generateFontData( 580, 232, 232, 0, 0, -64, -64, - [{ - d: 1, - v: [ - ['m', 232, 116, { - r: ROTATE_HORIZONTAL, - p: 1, - f: 1 - }], - ['b', 232, 180.1, 180.1, 232, 116, 232, { - r: ROTATE_VERTICAL - }], - ['b', 51.9, 232, 0, 180.1, 0, 116, { - r: ROTATE_HORIZONTAL - }], - ['b', 0, 51.9, 51.9, 0, 116, 0, { - r: ROTATE_VERTICAL - }], - ['b', 180.1, 0, 232, 51.9, 232, 116, { - r: ROTATE_HORIZONTAL, - c: 1 - }], - ] - }] + JSON.parse(JSON.stringify(DATA_LO)) ), 'p': generateFontData( 600, 232, 338, @@ -604,21 +700,7 @@ export const LOWER = { 's': generateFontData( 400, 224 * 0.642, 360 * 0.642, 0, 0, -64, -64, - [{ - d: 1, - v: [ - ['m', 0 * 0.642, 295.4 * 0.642, { - r: getCurveR(0 * 0.642, 295.4 * 0.642, 17.6 * 0.642, 332.1 * 0.642, 58.3 * 0.642, 360 * 0.642, 110.3 * 0.642, 360 * 0.642, 0), - f: 1 - }], - ['b', 17.6 * 0.642, 332.1 * 0.642, 58.3 * 0.642, 360 * 0.642, 110.3 * 0.642, 360 * 0.642], - ['b', 173.9 * 0.642, 360 * 0.642, 223.8 * 0.642, 329.6 * 0.642, 224 * 0.642, 271 * 0.642], - ['b', 224.2 * 0.642, 214.7 * 0.642, 180.7 * 0.642, 189.6 * 0.642, 112.4 * 0.642, 173.3 * 0.642], - ['b', 47.3 * 0.642, 157.7 * 0.642, 10.9 * 0.642, 130.6 * 0.642, 12 * 0.642, 84.4 * 0.642], - ['b', 13.3 * 0.642, 29.8 * 0.642, 57.3 * 0.642, 0 * 0.642, 114.8 * 0.642, 0 * 0.642], - ['b', 158.4 * 0.642, 0 * 0.642, 196.5 * 0.642, 20.5 * 0.642, 212 * 0.642, 51.3 * 0.642], - ] - }] + JSON.parse(JSON.stringify(DATA_LS)) ), 't': generateFontData( 356, 232, 352, @@ -657,38 +739,7 @@ export const LOWER = { 'u': generateFontData( 520, 182, 352, 0, 0, 0, 0, - [{ - d: -1, - v: [ - ['m', 0, 130, { - y: -3 - }], - ['l', 0, 0 + 265, { - r: ROTATE_HORIZONTAL - }], - ['b', 0, 50.3 + 265, 40.7, 91 + 265, 91, 91 + 265, { - r: ROTATE_VERTICAL - }], - ['b', 141.3, 91 + 265, 182, 50.3 + 265, 182, 0 + 265, { - r: ROTATE_HORIZONTAL, - p: 1, - f: 1, - }], - ] - }, - { - d: -1, - v: [ - ['m', 182, 130, { - y: -3 - }], - ['l', 182, 352, { - y: 0, - f: 1 - }], - ] - } - ] + JSON.parse(JSON.stringify(DATA_LU)) ), 'v': generateFontData( 500, 200, 352, @@ -804,39 +855,7 @@ export const LOWER = { 'y': generateFontData( 500, 225.5, 331.5, 10, 10, -119, -119, - [{ - d: -1, - v: [ - ['m', 225.5, 0, { - y: -3, - r: getR(225.5, 0, 116.3, 248.8) - }], - ['l', 116.3, 248.8, { - x: 0.5, - y: 0.64 - }], - ['b', 71.8, 349.6, 0, 331.5, 0, 331.5, { - x: 0.5, - y: 0.64, - r: getCurveR(0, 331.5, 71.8, 349.6, 116.3, 248.8, 0, 331.5, 0), - f: 1 - }], - ] - }, - { - d: -1, - v: [ - ['m', 3.2, 0, { - y: -3, - r: getR(3.2, 0, 125.7, 226.6) - }], - ['l', 125.7, 226.6, { - p: 1, - f: 1 - }], - ] - } - ] + JSON.parse(JSON.stringify(DATA_LY)) ), 'z': generateFontData( // 232, 224 420, 172, 352, diff --git a/src/font/special.js b/src/font/special.js index b436937..71754b7 100644 --- a/src/font/special.js +++ b/src/font/special.js @@ -3,7 +3,6 @@ import { ROTATE_HORIZONTAL, ROTATE_VERTICAL, ROTATE_NONE, - VERTEX_GAP, getR, getCurveR, VERTEX_GAP2 @@ -298,10 +297,10 @@ export const SPECIAL = { d: -1, v: [ ['m', 0, 150, { - r: getR(0, 150, 88 - VERTEX_GAP, 0) + r: getR(0, 150, 88 - VERTEX_GAP2, 0) }], - ['l', 88 - VERTEX_GAP, 0, { - r: getR(0, 150, 88 - VERTEX_GAP, 0), + ['l', 88 - VERTEX_GAP2, 0, { + r: getR(0, 150, 88 - VERTEX_GAP2, 0), f: 1 }], ['l', 88 + VERTEX_GAP2, 0, { diff --git a/src/font/upper.js b/src/font/upper.js index 4b1fc9e..980fbe3 100644 --- a/src/font/upper.js +++ b/src/font/upper.js @@ -2,56 +2,343 @@ import { generateFontData, ROTATE_HORIZONTAL, ROTATE_VERTICAL, - ROTATE_NONE, VERTEX_GAP, VERTEX_GAP2, getR, getCurveR } from './util.js'; +export const DATA_UA = [{ + d: -1, + v: [ + ['m', 0, 352, { + x: 0.55, + y: 0.3, + r: getR(0, 352, 145 - VERTEX_GAP2, 0), + }], + ['l', 145 - VERTEX_GAP2, 0, { + r: getR(0, 352, 145 - VERTEX_GAP2, 0), + f: 1 + }], + ['l', 145 + VERTEX_GAP2, 0, { + r: getR(290, 352, 145 + VERTEX_GAP2, 0), + f: 1, + v: 1 + }], + ['l', 290, 352, { + x: 0.55, + y: 0.3, + f: 1 + }], + ] + }, + { + d: -1, + v: [ + ['m', 47, 237, { + r: ROTATE_VERTICAL, + p: 1 + }], + ['l', 243, 237, { + r: ROTATE_VERTICAL, + p: 1, + f: 1, + }], + ] + } +]; + +export const DATA_UC = [{ + d: 1, + v: [ + ['m', 293.1, 320.1, { + r: getCurveR(293.1, 320.1, 262.2, 345, 222.8, 360, 180, 360, 0), + f: 1 + }], + ['b', 262.2, 345, 222.8, 360, 180, 360], + ['b', 80.6, 360, 0, 279.4, 0, 180], + ['b', 0, 80.6, 80.6, 0, 180, 0], + ['b', 222.8, 0, 262.2, 15, 293.1, 39.9], + ] +}]; + +export const DATA_UE = [{ + d: -1, + v: [ + ['m', 192, 0, { + x: 0, + r: ROTATE_VERTICAL, + }], + ['l', 0, 0, { + r: ROTATE_HORIZONTAL, + f: 1, + x: 0.5 + }], + ['l', 0, 352, { + f: 1, + x: 0.5 + }], + ['l', 192, 352, { + x: 0, + r: ROTATE_VERTICAL, + f: 1 + }], + ] + }, + { + d: -1, + v: [ + ['m', 0, 164, { + r: ROTATE_VERTICAL, + p: 1, + x: 0.5 + }], + ['l', 180, 164, { + x: 0, + r: ROTATE_VERTICAL, + f: 1 + }], + ] + } +]; + +export const DATA_UG = [{ + d: 1, + v: [ + ['m', 202, 180, { + r: ROTATE_VERTICAL, + f: 1 + }], + ['l', 352, 180, { + f: 1 + }], + ['b', 352, 279.4, 279.4, 360, 180, 360, { + r: ROTATE_VERTICAL + }], + ['b', 80.6, 360, 0, 279.4, 0, 180, { + r: ROTATE_HORIZONTAL + }], + ['b', 0, 80.6, 80.6, 0, 180, 0, { + r: ROTATE_VERTICAL + }], + ['b', 222.8, 0, 262.1, 14.9, 293, 39.9], + ] +}]; + +export const DATA_UH = [{ + d: -1, + v: [ + ['m', 0, 0, { + y: 0, + r: ROTATE_HORIZONTAL + }], + ['l', 0, 352, { + y: 0, + r: ROTATE_HORIZONTAL, + f: 1 + }], + ] + }, + { + d: -1, + v: [ + ['m', 232, 0, { + y: 0, + r: ROTATE_HORIZONTAL + }], + ['l', 232, 352, { + y: 0, + r: ROTATE_HORIZONTAL, + f: 1 + }], + ] + }, + { + d: -1, + v: [ + ['m', 0, 164, { + r: ROTATE_VERTICAL, + p: 1 + }], + ['l', 232, 164, { + r: ROTATE_VERTICAL, + f: 1, + p: 1 + }], + ] + } +]; + +export const DATA_UI = [{ + d: 1, + v: [ + ['m', 0, 352, { + y: 0, + r: ROTATE_HORIZONTAL, + f: 1 + }], + ['l', 0, 0, { + y: 0, + r: ROTATE_HORIZONTAL + }], + ] +}]; + +export const DATA_UJ = [{ + d: 1, + v: [ + ['m', 0, 310.5 + 0.5, { + r: getCurveR(0, 310.5 + 0.5, 16.2, 341.1 + 0.5, 49.3, 355.5 + 0.5, 86, 355.5 + 0.5, 0), + f: 1 + }], + ['b', 16.2, 341.1 + 0.5, 49.3, 355.5 + 0.5, 86, 355.5 + 0.5, { + r: ROTATE_VERTICAL + }], + ['b', 133.5, 355.5 + 0.5, 172, 317 + 0.5, 172, 269.5 + 0.5], + ['l', 172.5, 0, { + y: 0, + r: ROTATE_HORIZONTAL + }], + ] +}]; + +export const DATA_UN = [{ + d: -1, + v: [ + ['m', 0, 352, { + y: 0, + r: ROTATE_HORIZONTAL + }], + ['l', 0, 0, { + r: ROTATE_HORIZONTAL, + f: 1 + }], + ['l', 0 + VERTEX_GAP, 0, { + r: ROTATE_HORIZONTAL, + p: 1, + f: 1, + v: 1 + }], + ['l', 250 - VERTEX_GAP, 351, { + r: ROTATE_HORIZONTAL, + p: 1, + f: 1 + }], + ['l', 250, 351, { + r: ROTATE_HORIZONTAL, + f: 1, + v: 1 + }], + ['l', 250, 0, { + y: 0, + r: ROTATE_HORIZONTAL, + f: 1 + }], + ] +}]; + +export const DATA_UO = [{ + d: 1, + v: [ + ['m', 360, 180, { + r: ROTATE_HORIZONTAL, + p: 1, + f: 1 + }], + ['b', 360, 279.4, 279.4, 360, 180, 360, { + r: ROTATE_VERTICAL + }], + ['b', 80.6, 360, 0, 279.4, 0, 180, { + r: ROTATE_HORIZONTAL + }], + ['b', 0, 80.6, 80.6, 0, 180, 0, { + r: ROTATE_VERTICAL + }], + ['b', 279.4, 0, 360, 80.6, 360, 180, { + r: ROTATE_HORIZONTAL, + c: 1 + }], + ] +}]; + +export const DATA_US = [{ + d: 1, + v: [ + ['m', 0, 295.4, { + r: getCurveR(0, 295.4, 17.6, 332.1, 58.3, 360, 110.3, 360, 0), + f: 1 + }], + ['b', 17.6, 332.1, 58.3, 360, 110.3, 360], + ['b', 173.9, 360, 223.8, 329.6, 224, 271], + ['b', 224.2, 214.7, 180.7, 189.6, 112.4, 173.3], + ['b', 47.3, 157.7, 10.9, 130.6, 12, 84.4], + ['b', 13.3, 29.8, 57.3, 0, 114.8, 0], + ['b', 158.4, 0, 196.5, 20.5, 212, 51.3], + ] +}]; + +export const DATA_UU = [{ + d: 1, + v: [ + ['m', 250, 0, { + y: 0, + r: ROTATE_HORIZONTAL + }], + ['l', 250, 230 + 1, { + r: ROTATE_HORIZONTAL + }], + ['b', 250, 299 + 1, 194, 355 + 1, 125, 355 + 1, { + r: ROTATE_VERTICAL + }], + ['b', 56, 355 + 1, 0, 299 + 1, 0, 230 + 1, { + r: ROTATE_HORIZONTAL + }], + ['l', 0, 0, { + y: 0, + r: ROTATE_HORIZONTAL + }], + ] +}]; + +export const DATA_UY = [{ + d: -1, + v: [ + ['m', 0, 0, { + x: 0.6, + y: 0.3, + r: getR(0, 0, 135, 186), + }], + ['l', 135, 186, { + r: ROTATE_HORIZONTAL, + f: 1 + }], + ['l', 270, 0, { + x: 0.6, + y: 0.3, + f: 1 + }] + ] + }, + { + d: -1, + v: [ + ['m', 135, 186, { + r: ROTATE_HORIZONTAL, + p: 1 + }], + ['l', 135, 352, { + y: 0, + f: 1 + }], + ] + } +]; + export const UPPER = { 'A': generateFontData( 620, 290, 352, 0, 0, 0, 0, - [{ - d: -1, - v: [ - ['m', 0, 352, { - x: 0.55, - y: 0.3, - r: getR(0, 352, 145 - VERTEX_GAP2, 0), - }], - ['l', 145 - VERTEX_GAP2, 0, { - r: getR(0, 352, 145 - VERTEX_GAP2, 0), - f: 1 - }], - ['l', 145 + VERTEX_GAP2, 0, { - r: getR(290, 352, 145 + VERTEX_GAP2, 0), - f: 1, - v: 1 - }], - ['l', 290, 352, { - x: 0.55, - y: 0.3, - f: 1 - }], - ] - }, - { - d: -1, - v: [ - ['m', 47, 237, { - r: ROTATE_VERTICAL, - p: 1 - }], - ['l', 243, 237, { - r: ROTATE_VERTICAL, - p: 1, - f: 1, - }], - ] - } - ] + JSON.parse(JSON.stringify(DATA_UA)) ), 'B': generateFontData( 596, 209, 352, @@ -97,19 +384,7 @@ export const UPPER = { 'C': generateFontData( 700, 293.1, 360, 0, 0, 0, 0, - [{ - d: 1, - v: [ - ['m', 293.1, 320.1, { - r: getCurveR(293.1, 320.1, 262.2, 345, 222.8, 360, 180, 360, 0), - f: 1 - }], - ['b', 262.2, 345, 222.8, 360, 180, 360], - ['b', 80.6, 360, 0, 279.4, 0, 180], - ['b', 0, 80.6, 80.6, 0, 180, 0], - ['b', 222.8, 0, 262.2, 15, 293.1, 39.9], - ] - }] + JSON.parse(JSON.stringify(DATA_UC)) ), 'D': generateFontData( 721, 270, 352, @@ -146,45 +421,7 @@ export const UPPER = { 'E': generateFontData( 520, 192, 352, -5, -80, 0, 0, - [{ - d: -1, - v: [ - ['m', 192, 0, { - x: 0, - r: ROTATE_VERTICAL, - }], - ['l', 0, 0, { - r: ROTATE_HORIZONTAL, - f: 1, - x: 0.5 - }], - ['l', 0, 352, { - f: 1, - x: 0.5 - }], - ['l', 192, 352, { - x: 0, - r: ROTATE_VERTICAL, - f: 1 - }], - ] - }, - { - d: -1, - v: [ - ['m', 0, 164, { - r: ROTATE_VERTICAL, - p: 1, - x: 0.5 - }], - ['l', 180, 164, { - x: 0, - r: ROTATE_VERTICAL, - f: 1 - }], - ] - } - ] + JSON.parse(JSON.stringify(DATA_UE)) ), 'F': generateFontData( 510, 192, 352, @@ -228,114 +465,22 @@ export const UPPER = { 'G': generateFontData( 840, 352, 360, 0, 0, 0, 0, - [{ - d: 1, - v: [ - ['m', 202, 180, { - r: ROTATE_VERTICAL, - f: 1 - }], - ['l', 352, 180, { - f: 1 - }], - ['b', 352, 279.4, 279.4, 360, 180, 360, { - r: ROTATE_VERTICAL - }], - ['b', 80.6, 360, 0, 279.4, 0, 180, { - r: ROTATE_HORIZONTAL - }], - ['b', 0, 80.6, 80.6, 0, 180, 0, { - r: ROTATE_VERTICAL - }], - ['b', 222.8, 0, 262.1, 14.9, 293, 39.9], - ] - }] + JSON.parse(JSON.stringify(DATA_UG)) ), 'H': generateFontData( 684, 232, 352, 0, 0, 0, 0, - [{ - d: -1, - v: [ - ['m', 0, 0, { - y: 0, - r: ROTATE_HORIZONTAL - }], - ['l', 0, 352, { - y: 0, - r: ROTATE_HORIZONTAL, - f: 1 - }], - ] - }, - { - d: -1, - v: [ - ['m', 232, 0, { - y: 0, - r: ROTATE_HORIZONTAL - }], - ['l', 232, 352, { - y: 0, - r: ROTATE_HORIZONTAL, - f: 1 - }], - ] - }, - { - d: -1, - v: [ - ['m', 0, 164, { - r: ROTATE_VERTICAL, - p: 1 - }], - ['l', 232, 164, { - r: ROTATE_VERTICAL, - f: 1, - p: 1 - }], - ] - }, - ] + JSON.parse(JSON.stringify(DATA_UH)) ), 'I': generateFontData( 249, 0, 352, 0, 0, 0, 0, - [{ - d: 1, - v: [ - ['m', 0, 352, { - y: 0, - r: ROTATE_HORIZONTAL, - f: 1 - }], - ['l', 0, 0, { - y: 0, - r: ROTATE_HORIZONTAL - }], - ] - }, ] + JSON.parse(JSON.stringify(DATA_UI)) ), 'J': generateFontData( 472, 172.5, 355.5, 10, 20, -2, -2, - [{ - d: 1, - v: [ - ['m', 0, 310.5 + 0.5, { - r: getCurveR(0, 310.5 + 0.5, 16.2, 341.1 + 0.5, 49.3, 355.5 + 0.5, 86, 355.5 + 0.5, 0), - f: 1 - }], - ['b', 16.2, 341.1 + 0.5, 49.3, 355.5 + 0.5, 86, 355.5 + 0.5, { - r: ROTATE_VERTICAL - }], - ['b', 133.5, 355.5 + 0.5, 172, 317 + 0.5, 172, 269.5 + 0.5], - ['l', 172.5, 0, { - y: 0, - r: ROTATE_HORIZONTAL - }], - ] - }, ] + JSON.parse(JSON.stringify(DATA_UJ)) ), 'K': generateFontData( 616, 232, 352, @@ -449,67 +594,12 @@ export const UPPER = { 'N': generateFontData( 721, 250, 352, 0, 0, 0, 0, - [{ - d: -1, - v: [ - ['m', 0, 352, { - y: 0, - r: ROTATE_HORIZONTAL - }], - ['l', 0, 0, { - r: ROTATE_HORIZONTAL, - f: 1 - }], - ['l', 0 + VERTEX_GAP, 0, { - r: ROTATE_HORIZONTAL, - p: 1, - f: 1, - v: 1 - }], - ['l', 250 - VERTEX_GAP, 351, { - r: ROTATE_HORIZONTAL, - p: 1, - f: 1 - }], - ['l', 250, 351, { - r: ROTATE_HORIZONTAL, - f: 1, - v: 1 - }], - ['l', 250, 0, { - y: 0, - r: ROTATE_HORIZONTAL, - f: 1 - }], - ] - }] + JSON.parse(JSON.stringify(DATA_UN)) ), 'O': generateFontData( 850, 360, 360, 0, 0, 0, 0, - [{ - d: 1, - v: [ - ['m', 360, 180, { - r: ROTATE_HORIZONTAL, - p: 1, - f: 1 - }], - ['b', 360, 279.4, 279.4, 360, 180, 360, { - r: ROTATE_VERTICAL - }], - ['b', 80.6, 360, 0, 279.4, 0, 180, { - r: ROTATE_HORIZONTAL - }], - ['b', 0, 80.6, 80.6, 0, 180, 0, { - r: ROTATE_VERTICAL - }], - ['b', 279.4, 0, 360, 80.6, 360, 180, { - r: ROTATE_HORIZONTAL, - c: 1 - }], - ] - }] + JSON.parse(JSON.stringify(DATA_UO)) ), 'P': generateFontData( 568, 210, 352, @@ -632,21 +722,7 @@ export const UPPER = { 'S': generateFontData( 560, 224, 360, 0, 0, 0, 0, - [{ - d: 1, - v: [ - ['m', 0, 295.4, { - r: getCurveR(0, 295.4, 17.6, 332.1, 58.3, 360, 110.3, 360, 0), - f: 1 - }], - ['b', 17.6, 332.1, 58.3, 360, 110.3, 360], - ['b', 173.9, 360, 223.8, 329.6, 224, 271], - ['b', 224.2, 214.7, 180.7, 189.6, 112.4, 173.3], - ['b', 47.3, 157.7, 10.9, 130.6, 12, 84.4], - ['b', 13.3, 29.8, 57.3, 0, 114.8, 0], - ['b', 158.4, 0, 196.5, 20.5, 212, 51.3], - ] - }] + JSON.parse(JSON.stringify(DATA_US)) ), 'T': generateFontData( 568, 232, 352, @@ -684,28 +760,7 @@ export const UPPER = { 'U': generateFontData( 712, 250, 355, 0, 0, -0.5, -0.5, - [{ - d: 1, - v: [ - ['m', 250, 0, { - y: 0, - r: ROTATE_HORIZONTAL - }], - ['l', 250, 230 + 1, { - r: ROTATE_HORIZONTAL - }], - ['b', 250, 299 + 1, 194, 355 + 1, 125, 355 + 1, { - r: ROTATE_VERTICAL - }], - ['b', 56, 355 + 1, 0, 299 + 1, 0, 230 + 1, { - r: ROTATE_HORIZONTAL - }], - ['l', 0, 0, { - y: 0, - r: ROTATE_HORIZONTAL - }], - ] - }] + JSON.parse(JSON.stringify(DATA_UU)) ), 'V': generateFontData( 650, 270, 352, @@ -819,39 +874,7 @@ export const UPPER = { 'Y': generateFontData( 673, 270, 352, 0, 0, 0, 0, - [{ - d: -1, - v: [ - ['m', 0, 0, { - x: 0.6, - y: 0.3, - r: getR(0, 0, 135, 186), - }], - ['l', 135, 186, { - r: ROTATE_HORIZONTAL, - f: 1 - }], - ['l', 270, 0, { - x: 0.6, - y: 0.3, - f: 1 - }] - ] - }, - { - d: -1, - v: [ - ['m', 135, 186, { - r: ROTATE_HORIZONTAL, - p: 1 - }], - ['l', 135, 352, { - y: 0, - f: 1 - }], - ] - } - ] + JSON.parse(JSON.stringify(DATA_UY)) ), 'Z': generateFontData( 558, 232, 352, diff --git a/src/index.js b/src/index.js index 1b9c716..e9e42b8 100644 --- a/src/index.js +++ b/src/index.js @@ -1,2 +1,2 @@ -const LeonSans = require('./LeonSans').default; +const LeonSans = require('./leonsans').default; module.exports = LeonSans; \ No newline at end of file diff --git a/src/leonsans.js b/src/leonsans.js index 620536a..d0fbca5 100644 --- a/src/leonsans.js +++ b/src/leonsans.js @@ -1,3 +1,10 @@ +/*! + * VERSION: 1.6.1 + * DATE: 2019-09-05 + * https://leon-sans.com + * + * @license Copyright (c) 2019, Jongmin Kim. All rights reserved. + **/ import { Dispatcher } from './core/dispatcher.js';