From b8205a63aa98d5d75172e30aef1444541874652e Mon Sep 17 00:00:00 2001 From: be5invis Date: Sat, 16 Jul 2022 19:26:49 -0700 Subject: [PATCH] Initial work of ESM transformation --- .eslintrc.json | 3 +- .gitignore | 3 + .../gen/{build-font.js => build-font.mjs} | 30 +- font-src/gen/caching/{index.js => index.mjs} | 28 +- .../gen/{empty-font.js => empty-font.mjs} | 6 +- font-src/gen/finalize/{gc.js => gc.mjs} | 22 +- .../gen/finalize/{glyphs.js => glyphs.mjs} | 39 +- font-src/gen/finalize/{index.js => index.mjs} | 27 +- .../{glyph-name.js => glyph-name.mjs} | 16 +- .../gen/otd-conv/{glyphs.js => glyphs.mjs} | 60 ++-- font-src/gen/otd-conv/{index.js => index.mjs} | 11 +- font-src/gen/otd-conv/layout.js | 326 ----------------- font-src/gen/otd-conv/layout.mjs | 339 ++++++++++++++++++ font-src/glyphs/auto-build/accents.ptl | 6 +- font-src/glyphs/auto-build/composite.ptl | 8 +- font-src/glyphs/auto-build/transformed.ptl | 8 +- font-src/glyphs/common/derivatives.ptl | 4 +- font-src/glyphs/common/shapes.ptl | 6 +- font-src/glyphs/index.ptl | 66 ++-- font-src/glyphs/letter/cyrillic.ptl | 44 +-- font-src/glyphs/letter/cyrillic/abk-ha.ptl | 2 +- font-src/glyphs/letter/cyrillic/big-yus.ptl | 2 +- font-src/glyphs/letter/cyrillic/che.ptl | 2 +- font-src/glyphs/letter/cyrillic/de.ptl | 2 +- font-src/glyphs/letter/cyrillic/dje.ptl | 2 +- font-src/glyphs/letter/cyrillic/dzhe.ptl | 2 +- font-src/glyphs/letter/cyrillic/el.ptl | 4 +- font-src/glyphs/letter/cyrillic/fita.ptl | 2 +- font-src/glyphs/letter/cyrillic/lje.ptl | 4 +- font-src/glyphs/letter/cyrillic/lower-be.ptl | 2 +- font-src/glyphs/letter/cyrillic/nje.ptl | 4 +- font-src/glyphs/letter/cyrillic/omega.ptl | 2 +- font-src/glyphs/letter/cyrillic/sha.ptl | 2 +- font-src/glyphs/letter/cyrillic/small-yus.ptl | 2 +- font-src/glyphs/letter/cyrillic/te-comb.ptl | 2 +- font-src/glyphs/letter/cyrillic/tse.ptl | 2 +- font-src/glyphs/letter/cyrillic/tshe.ptl | 2 +- font-src/glyphs/letter/cyrillic/yat.ptl | 2 +- font-src/glyphs/letter/cyrillic/yeri.ptl | 2 +- font-src/glyphs/letter/cyrillic/yu.ptl | 2 +- font-src/glyphs/letter/cyrillic/zhe.ptl | 2 +- font-src/glyphs/letter/greek.ptl | 56 +-- font-src/glyphs/letter/greek/lower-alpha.ptl | 2 +- font-src/glyphs/letter/greek/lower-delta.ptl | 2 +- .../glyphs/letter/greek/lower-epsilon.ptl | 2 +- font-src/glyphs/letter/greek/lower-gamma.ptl | 2 +- .../letter/greek/lower-kappa-symbol.ptl | 2 +- .../letter/greek/lower-lunate-epsilon.ptl | 2 +- font-src/glyphs/letter/greek/lower-mu.ptl | 2 +- font-src/glyphs/letter/greek/lower-nu.ptl | 2 +- font-src/glyphs/letter/greek/lower-omega.ptl | 2 +- font-src/glyphs/letter/greek/lower-phi.ptl | 2 +- font-src/glyphs/letter/greek/lower-rho.ptl | 4 +- .../glyphs/letter/greek/lower-sigma-final.ptl | 4 +- font-src/glyphs/letter/greek/lower-sigma.ptl | 4 +- font-src/glyphs/letter/greek/lower-tau.ptl | 4 +- font-src/glyphs/letter/greek/lower-theta.ptl | 4 +- .../glyphs/letter/greek/lower-upsilon.ptl | 4 +- font-src/glyphs/letter/greek/lower-xi.ptl | 4 +- font-src/glyphs/letter/greek/lower-zeta.ptl | 4 +- font-src/glyphs/letter/greek/pi.ptl | 4 +- font-src/glyphs/letter/greek/psi.ptl | 4 +- font-src/glyphs/letter/greek/qoppa.ptl | 4 +- font-src/glyphs/letter/greek/sampi.ptl | 4 +- font-src/glyphs/letter/greek/upper-gamma.ptl | 6 +- font-src/glyphs/letter/greek/upper-omega.ptl | 4 +- font-src/glyphs/letter/greek/upper-phi.ptl | 4 +- font-src/glyphs/letter/greek/upper-sigma.ptl | 4 +- font-src/glyphs/letter/greek/upper-theta.ptl | 4 +- font-src/glyphs/letter/greek/upper-xi.ptl | 4 +- .../letter/latin-ext/bidental-percussive.ptl | 4 +- .../glyphs/letter/latin-ext/egyptological.ptl | 4 +- font-src/glyphs/letter/latin-ext/eszet.ptl | 4 +- font-src/glyphs/letter/latin-ext/eth.ptl | 4 +- font-src/glyphs/letter/latin-ext/ezh.ptl | 4 +- .../glyphs/letter/latin-ext/f-ligatures.ptl | 4 +- font-src/glyphs/letter/latin-ext/gha.ptl | 4 +- .../glyphs/letter/latin-ext/glottal-stop.ptl | 4 +- font-src/glyphs/letter/latin-ext/hwair.ptl | 4 +- font-src/glyphs/letter/latin-ext/long-s.ptl | 4 +- .../glyphs/letter/latin-ext/lower-ae-oe.ptl | 4 +- font-src/glyphs/letter/latin-ext/ou.ptl | 4 +- .../glyphs/letter/latin-ext/rams-horn.ptl | 4 +- font-src/glyphs/letter/latin-ext/rhotic.ptl | 4 +- font-src/glyphs/letter/latin-ext/thorn.ptl | 4 +- .../glyphs/letter/latin-ext/upper-ae-oe.ptl | 4 +- font-src/glyphs/letter/latin-ext/wynn.ptl | 4 +- font-src/glyphs/letter/latin-ext/yogh.ptl | 4 +- font-src/glyphs/letter/latin.ptl | 124 +++---- font-src/glyphs/letter/latin/c.ptl | 4 +- font-src/glyphs/letter/latin/k.ptl | 6 +- font-src/glyphs/letter/latin/lower-a.ptl | 4 +- font-src/glyphs/letter/latin/lower-b.ptl | 4 +- font-src/glyphs/letter/latin/lower-d.ptl | 4 +- font-src/glyphs/letter/latin/lower-e.ptl | 4 +- font-src/glyphs/letter/latin/lower-f.ptl | 4 +- font-src/glyphs/letter/latin/lower-g.ptl | 4 +- font-src/glyphs/letter/latin/lower-h.ptl | 4 +- font-src/glyphs/letter/latin/lower-il.ptl | 4 +- font-src/glyphs/letter/latin/lower-j.ptl | 4 +- font-src/glyphs/letter/latin/lower-m.ptl | 4 +- font-src/glyphs/letter/latin/lower-n.ptl | 4 +- font-src/glyphs/letter/latin/lower-p.ptl | 4 +- font-src/glyphs/letter/latin/lower-q.ptl | 4 +- font-src/glyphs/letter/latin/lower-r.ptl | 4 +- font-src/glyphs/letter/latin/lower-t.ptl | 4 +- font-src/glyphs/letter/latin/lower-y.ptl | 4 +- font-src/glyphs/letter/latin/o.ptl | 4 +- font-src/glyphs/letter/latin/s.ptl | 4 +- font-src/glyphs/letter/latin/u.ptl | 4 +- font-src/glyphs/letter/latin/upper-a.ptl | 4 +- font-src/glyphs/letter/latin/upper-b.ptl | 4 +- font-src/glyphs/letter/latin/upper-d.ptl | 4 +- font-src/glyphs/letter/latin/upper-e.ptl | 4 +- font-src/glyphs/letter/latin/upper-f.ptl | 4 +- font-src/glyphs/letter/latin/upper-g.ptl | 4 +- font-src/glyphs/letter/latin/upper-h.ptl | 4 +- font-src/glyphs/letter/latin/upper-i.ptl | 4 +- font-src/glyphs/letter/latin/upper-j.ptl | 4 +- font-src/glyphs/letter/latin/upper-l.ptl | 4 +- font-src/glyphs/letter/latin/upper-m.ptl | 4 +- font-src/glyphs/letter/latin/upper-n.ptl | 4 +- font-src/glyphs/letter/latin/upper-p.ptl | 4 +- font-src/glyphs/letter/latin/upper-q.ptl | 4 +- font-src/glyphs/letter/latin/upper-r.ptl | 4 +- font-src/glyphs/letter/latin/upper-t.ptl | 4 +- font-src/glyphs/letter/latin/upper-y.ptl | 4 +- font-src/glyphs/letter/latin/v.ptl | 4 +- font-src/glyphs/letter/latin/w.ptl | 4 +- font-src/glyphs/letter/latin/x.ptl | 4 +- font-src/glyphs/letter/latin/z.ptl | 4 +- font-src/glyphs/letter/shared.ptl | 6 +- font-src/glyphs/marks/above.ptl | 12 +- font-src/glyphs/marks/below.ptl | 10 +- font-src/glyphs/marks/composite.ptl | 10 +- font-src/glyphs/marks/doppelganger.ptl | 10 +- font-src/glyphs/marks/horn-and-angle.ptl | 10 +- font-src/glyphs/marks/index.ptl | 16 +- font-src/glyphs/marks/overlay.ptl | 10 +- font-src/glyphs/marks/shared-metrics.ptl | 10 +- font-src/glyphs/marks/tie.ptl | 10 +- font-src/glyphs/number/0.ptl | 4 +- font-src/glyphs/number/1.ptl | 4 +- font-src/glyphs/number/2.ptl | 4 +- font-src/glyphs/number/3.ptl | 4 +- font-src/glyphs/number/4.ptl | 4 +- font-src/glyphs/number/5.ptl | 4 +- font-src/glyphs/number/6.ptl | 4 +- font-src/glyphs/number/7.ptl | 4 +- font-src/glyphs/number/8.ptl | 4 +- font-src/glyphs/number/9.ptl | 4 +- font-src/glyphs/number/index.ptl | 22 +- font-src/glyphs/number/shared.ptl | 4 +- font-src/glyphs/space/index.ptl | 4 +- font-src/glyphs/symbol/arrow.ptl | 2 +- font-src/glyphs/symbol/braille.ptl | 4 +- font-src/glyphs/symbol/enclosure.ptl | 4 +- font-src/glyphs/symbol/geometric.ptl | 18 +- .../glyphs/symbol/geometric/ballot-box.ptl | 4 +- font-src/glyphs/symbol/geometric/dotted.ptl | 4 +- font-src/glyphs/symbol/geometric/masked.ptl | 4 +- font-src/glyphs/symbol/geometric/plain.ptl | 4 +- font-src/glyphs/symbol/geometric/rounded.ptl | 4 +- font-src/glyphs/symbol/geometric/shaded.ptl | 4 +- font-src/glyphs/symbol/geometric/shared.ptl | 4 +- font-src/glyphs/symbol/geometric/stars.ptl | 4 +- .../glyphs/symbol/geometric/sun-and-gear.ptl | 4 +- font-src/glyphs/symbol/letter.ptl | 4 +- font-src/glyphs/symbol/ligation.ptl | 6 +- font-src/glyphs/symbol/math.ptl | 34 +- font-src/glyphs/symbol/math/apl.ptl | 8 +- font-src/glyphs/symbol/math/arith.ptl | 2 +- font-src/glyphs/symbol/math/boxed.ptl | 2 +- font-src/glyphs/symbol/math/circled.ptl | 2 +- font-src/glyphs/symbol/math/complement.ptl | 2 +- .../glyphs/symbol/math/dots-and-colons.ptl | 2 +- font-src/glyphs/symbol/math/frame.ptl | 2 +- font-src/glyphs/symbol/math/geometry.ptl | 2 +- font-src/glyphs/symbol/math/integrals.ptl | 2 +- .../glyphs/symbol/math/large-operators.ptl | 2 +- font-src/glyphs/symbol/math/letter-like.ptl | 2 +- font-src/glyphs/symbol/math/logicals.ptl | 2 +- font-src/glyphs/symbol/math/negation.ptl | 2 +- font-src/glyphs/symbol/math/not-glyph-fn.ptl | 2 +- font-src/glyphs/symbol/math/other.ptl | 2 +- font-src/glyphs/symbol/math/relation.ptl | 6 +- font-src/glyphs/symbol/math/v-and-cup.ptl | 2 +- font-src/glyphs/symbol/mosaic.ptl | 2 +- font-src/glyphs/symbol/pictograph.ptl | 30 +- .../glyphs/symbol/pictograph/astronomy.ptl | 2 +- font-src/glyphs/symbol/pictograph/atom.ptl | 2 +- .../glyphs/symbol/pictograph/bolt-symbol.ptl | 2 +- .../symbol/pictograph/checking-marks.ptl | 2 +- .../glyphs/symbol/pictograph/corner-shape.ptl | 2 +- font-src/glyphs/symbol/pictograph/faces.ptl | 2 +- font-src/glyphs/symbol/pictograph/flags.ptl | 2 +- font-src/glyphs/symbol/pictograph/heart.ptl | 4 +- font-src/glyphs/symbol/pictograph/i-ching.ptl | 4 +- .../pictograph/iec-power-and-playback.ptl | 2 +- font-src/glyphs/symbol/pictograph/kome.ptl | 2 +- .../glyphs/symbol/pictograph/metric-marks.ptl | 2 +- font-src/glyphs/symbol/pictograph/musical.ptl | 4 +- .../symbol/pictograph/powerline-and-gui.ptl | 2 +- font-src/glyphs/symbol/pictograph/suit.ptl | 4 +- font-src/glyphs/symbol/punctuation.ptl | 48 +-- .../glyphs/symbol/punctuation/ampersand.ptl | 2 +- .../glyphs/symbol/punctuation/ascii-marks.ptl | 2 +- .../glyphs/symbol/punctuation/asterisk.ptl | 2 +- font-src/glyphs/symbol/punctuation/at.ptl | 2 +- font-src/glyphs/symbol/punctuation/bar.ptl | 6 +- .../glyphs/symbol/punctuation/brackets.ptl | 6 +- .../glyphs/symbol/punctuation/bullets.ptl | 2 +- font-src/glyphs/symbol/punctuation/caret.ptl | 2 +- .../glyphs/symbol/punctuation/daggers.ptl | 2 +- font-src/glyphs/symbol/punctuation/dashes.ptl | 4 +- .../glyphs/symbol/punctuation/ellipsis.ptl | 2 +- .../glyphs/symbol/punctuation/emotion.ptl | 2 +- .../glyphs/symbol/punctuation/guillemet.ptl | 2 +- .../glyphs/symbol/punctuation/interpuncts.ptl | 2 +- .../glyphs/symbol/punctuation/joiners.ptl | 2 +- .../symbol/punctuation/ligation-variants.ptl | 2 +- .../symbol/punctuation/other-phonetic.ptl | 4 +- .../glyphs/symbol/punctuation/percentages.ptl | 2 +- .../glyphs/symbol/punctuation/pilcrow.ptl | 2 +- .../symbol/punctuation/quotes-and-primes.ptl | 2 +- .../glyphs/symbol/punctuation/section.ptl | 2 +- .../punctuation/slashes-and-number-sign.ptl | 4 +- font-src/glyphs/symbol/punctuation/small.ptl | 4 +- font-src/glyphs/symbol/punctuation/ties.ptl | 2 +- font-src/glyphs/symbol/shared.ptl | 2 +- font-src/{index.js => index.mjs} | 54 ++- font-src/kits/boole-kit.js | 35 +- font-src/kits/boole-kit.mjs | 41 +++ font-src/kits/{spiro-kit.js => spiro-kit.mjs} | 222 +++++------- font-src/merge-cache.js | 7 - font-src/merge-cache.mjs | 5 + font-src/meta/aesthetics.ptl | 8 +- font-src/meta/naming.ptl | 4 +- font-src/otl/compat-ligature.ptl | 4 +- font-src/otl/gpos-mark-mkmk.ptl | 14 +- font-src/otl/gsub-ccmp.ptl | 36 +- font-src/otl/gsub-cv-ss.ptl | 22 +- font-src/otl/gsub-frac.ptl | 14 +- font-src/otl/gsub-gr.ptl | 8 +- font-src/otl/gsub-ligation.ptl | 4 +- font-src/otl/gsub-locl.ptl | 16 +- font-src/otl/gsub-thousands.ptl | 12 +- font-src/otl/index.ptl | 26 +- font-src/otl/table-util.ptl | 48 +-- .../geometry/{anchor.js => anchor.mjs} | 6 +- font-src/support/geometry/{box.js => box.mjs} | 10 +- .../{curve-util.js => curve-util.mjs} | 122 +++---- .../support/geometry/{index.js => index.mjs} | 72 ++-- .../support/geometry/{point.js => point.mjs} | 7 +- .../{spiro-expand.js => spiro-expand.mjs} | 33 +- .../geometry/{transform.js => transform.mjs} | 11 +- .../{glyph-block.js => glyph-block.mjs} | 9 +- .../{glyph-store.js => glyph-store.mjs} | 13 +- .../support/glyph/{index.js => index.mjs} | 28 +- font-src/support/{gr.js => gr.mjs} | 104 ++---- .../{ligation-data.js => ligation-data.mjs} | 26 +- ...metric-override.js => metric-override.mjs} | 21 +- .../support/{parameters.js => parameters.mjs} | 21 +- .../util/{formatter.js => formatter.mjs} | 17 +- .../util/{mask-bit.js => mask-bit.mjs} | 18 +- ...terpolate.js => monotonic-interpolate.mjs} | 12 +- font-src/support/{utils.js => utils.mjs} | 21 +- .../{variant-data.js => variant-data.mjs} | 16 +- package-lock.json | 46 +-- package.json | 12 +- utility/amend-readme/{index.js => index.mjs} | 71 ++-- utility/copy-char-name-to-markdown.js | 7 - utility/copy-char-name-to-markdown.mjs | 6 + utility/create-sha-file.js | 31 -- utility/create-sha-file.mjs | 29 ++ utility/ensure-verda-exists.js | 23 -- .../export-data/coverage-export/block-data.js | 19 - .../coverage-export/block-data.mjs | 15 + ...erage-data.js => gather-coverage-data.mjs} | 48 ++- utility/export-data/{index.js => index.mjs} | 19 +- .../{ligation-data.js => ligation-data.mjs} | 53 ++- ...d-languages.js => supported-languages.mjs} | 58 ++- .../{variants-data.js => variants-data.mjs} | 49 +-- .../{change-log.js => change-log.mjs} | 25 +- .../{package-list.js => package-list.mjs} | 41 +-- .../{release-note.js => release-note.mjs} | 69 ++-- .../shared/{index.js => index.mjs} | 5 +- .../generate-samples/{index.js => index.mjs} | 79 ++-- .../templates/{button.js => button.mjs} | 7 +- ...acter-variant.js => character-variant.mjs} | 10 +- .../{grand-title.js => grand-title.mjs} | 7 +- .../generate-samples/templates/languages.js | 82 ----- .../generate-samples/templates/languages.mjs | 75 ++++ .../{ligation-set.js => ligation-set.mjs} | 52 ++- .../templates/{matrix.js => matrix.mjs} | 13 +- .../{stylistic-set.js => stylistic-set.mjs} | 49 ++- .../templates/{weights.js => weights.mjs} | 13 +- utility/generate-samples/themes/index.js | 13 - utility/generate-samples/themes/index.mjs | 12 + ...ke-webfont-css.js => make-webfont-css.mjs} | 9 +- utility/{ttf-to-woff2.js => ttf-to-woff2.mjs} | 10 +- .../{index.js => index.mjs} | 12 +- verdafile.js => verdafile.mjs | 67 ++-- 303 files changed, 1959 insertions(+), 2450 deletions(-) rename font-src/gen/{build-font.js => build-font.mjs} (62%) rename font-src/gen/caching/{index.js => index.mjs} (80%) rename font-src/gen/{empty-font.js => empty-font.mjs} (82%) rename font-src/gen/finalize/{gc.js => gc.mjs} (97%) rename font-src/gen/finalize/{glyphs.js => glyphs.mjs} (94%) rename font-src/gen/finalize/{index.js => index.mjs} (85%) rename font-src/gen/otd-conv/{glyph-name.js => glyph-name.mjs} (97%) rename font-src/gen/otd-conv/{glyphs.js => glyphs.mjs} (92%) rename font-src/gen/otd-conv/{index.js => index.mjs} (56%) delete mode 100644 font-src/gen/otd-conv/layout.js create mode 100644 font-src/gen/otd-conv/layout.mjs rename font-src/{index.js => index.mjs} (80%) create mode 100644 font-src/kits/boole-kit.mjs rename font-src/kits/{spiro-kit.js => spiro-kit.mjs} (96%) delete mode 100644 font-src/merge-cache.js create mode 100644 font-src/merge-cache.mjs rename font-src/support/geometry/{anchor.js => anchor.mjs} (83%) rename font-src/support/geometry/{box.js => box.mjs} (92%) rename font-src/support/geometry/{curve-util.js => curve-util.mjs} (85%) rename font-src/support/geometry/{index.js => index.mjs} (93%) rename font-src/support/geometry/{point.js => point.mjs} (96%) rename font-src/support/geometry/{spiro-expand.js => spiro-expand.mjs} (96%) rename font-src/support/geometry/{transform.js => transform.mjs} (96%) rename font-src/support/{glyph-block.js => glyph-block.mjs} (90%) rename font-src/support/{glyph-store.js => glyph-store.mjs} (97%) rename font-src/support/glyph/{index.js => index.mjs} (95%) rename font-src/support/{gr.js => gr.mjs} (90%) rename font-src/support/{ligation-data.js => ligation-data.mjs} (91%) rename font-src/support/{metric-override.js => metric-override.mjs} (97%) rename font-src/support/{parameters.js => parameters.mjs} (95%) rename font-src/support/util/{formatter.js => formatter.mjs} (73%) rename font-src/support/util/{mask-bit.js => mask-bit.mjs} (54%) rename font-src/support/util/{monotonic-interpolate.js => monotonic-interpolate.mjs} (97%) rename font-src/support/{utils.js => utils.mjs} (77%) rename font-src/support/{variant-data.js => variant-data.mjs} (98%) rename utility/amend-readme/{index.js => index.mjs} (95%) delete mode 100644 utility/copy-char-name-to-markdown.js create mode 100644 utility/copy-char-name-to-markdown.mjs delete mode 100644 utility/create-sha-file.js create mode 100644 utility/create-sha-file.mjs delete mode 100644 utility/ensure-verda-exists.js delete mode 100644 utility/export-data/coverage-export/block-data.js create mode 100644 utility/export-data/coverage-export/block-data.mjs rename utility/export-data/coverage-export/{gather-coverage-data.js => gather-coverage-data.mjs} (86%) rename utility/export-data/{index.js => index.mjs} (58%) rename utility/export-data/{ligation-data.js => ligation-data.mjs} (94%) rename utility/export-data/{supported-languages.js => supported-languages.mjs} (89%) rename utility/export-data/{variants-data.js => variants-data.mjs} (94%) rename utility/generate-release-note/{change-log.js => change-log.mjs} (76%) rename utility/generate-release-note/{package-list.js => package-list.mjs} (93%) rename utility/generate-release-note/{release-note.js => release-note.mjs} (84%) rename utility/generate-release-note/shared/{index.js => index.mjs} (72%) rename utility/generate-samples/{index.js => index.mjs} (80%) rename utility/generate-samples/templates/{button.js => button.mjs} (85%) rename utility/generate-samples/templates/{character-variant.js => character-variant.mjs} (89%) rename utility/generate-samples/templates/{grand-title.js => grand-title.mjs} (80%) delete mode 100644 utility/generate-samples/templates/languages.js create mode 100644 utility/generate-samples/templates/languages.mjs rename utility/generate-samples/templates/{ligation-set.js => ligation-set.mjs} (92%) rename utility/generate-samples/templates/{matrix.js => matrix.mjs} (93%) rename utility/generate-samples/templates/{stylistic-set.js => stylistic-set.mjs} (94%) rename utility/generate-samples/templates/{weights.js => weights.mjs} (90%) delete mode 100644 utility/generate-samples/themes/index.js create mode 100644 utility/generate-samples/themes/index.mjs rename utility/{make-webfont-css.js => make-webfont-css.mjs} (90%) rename utility/{ttf-to-woff2.js => ttf-to-woff2.mjs} (51%) rename utility/update-package-json-version/{index.js => index.mjs} (90%) rename verdafile.js => verdafile.mjs (95%) diff --git a/.eslintrc.json b/.eslintrc.json index a2c0587a9..7ecc6622d 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -9,7 +9,8 @@ "ecmaFeatures": { "jsx": true, "experimentalObjectRestSpread": true - } + }, + "sourceType": "module" }, "extends": ["eslint:recommended", "prettier"], "rules": { diff --git a/.gitignore b/.gitignore index e95b89805..808393ab9 100644 --- a/.gitignore +++ b/.gitignore @@ -46,6 +46,9 @@ testdrive/iosevka* font-src/meta/**/*.js font-src/otl/**/*.js font-src/glyphs/**/*.js +font-src/meta/**/*.mjs +font-src/otl/**/*.mjs +font-src/glyphs/**/*.mjs private.toml private-build-plans.toml diff --git a/font-src/gen/build-font.js b/font-src/gen/build-font.mjs similarity index 62% rename from font-src/gen/build-font.js rename to font-src/gen/build-font.mjs index 55dbfa860..e275a0a9a 100644 --- a/font-src/gen/build-font.js +++ b/font-src/gen/build-font.mjs @@ -1,24 +1,18 @@ -"use strict"; - -const { CreateEmptyFont } = require("./empty-font"); -const { buildGlyphs } = require("../glyphs/index"); -const { finalizeFont } = require("./finalize/index"); -const { convertOtd } = require("./otd-conv/index"); -const Caching = require("./caching/index"); - -const { buildOtl } = require("../otl/index"); -const { assignFontNames } = require("../meta/naming"); -const { copyFontMetrics } = require("../meta/aesthetics"); - -exports.buildFont = async function buildFont(argv, para) { +import { CreateEmptyFont } from "./empty-font.mjs"; +import { buildGlyphs } from "../glyphs/index.mjs"; +import { finalizeFont } from "./finalize/index.mjs"; +import { convertOtd } from "./otd-conv/index.mjs"; +import * as Caching from "./caching/index.mjs"; +import { buildOtl } from "../otl/index.mjs"; +import { assignFontNames } from "../meta/naming.mjs"; +import { copyFontMetrics } from "../meta/aesthetics.mjs"; +("use strict"); +export async function buildFont(argv, para) { const gs = buildGlyphs(para); - const baseFont = CreateEmptyFont(argv); assignFontNames(para, baseFont); copyFontMetrics(gs.fontMetrics, baseFont); - const otl = buildOtl(para, gs.glyphStore); - // Regulate const excludeChars = new Set(); if (para.excludedCharRanges) { @@ -26,14 +20,12 @@ exports.buildFont = async function buildFont(argv, para) { for (let p = start; p <= end; p++) excludeChars.add(p); } } - // Finalize (like geometry conversion) const cache = await Caching.load(argv.iCache, argv.menu.version, argv.cacheFreshAgeKey); const finalGs = finalizeFont(cache, para, gs.glyphStore, excludeChars, otl); if (cache.isUpdated()) { await Caching.save(argv.oCache, argv.menu.version, cache, true); } - const font = convertOtd(baseFont, otl, finalGs); return { font, glyphStore: finalGs, cacheUpdated: cache.isUpdated() }; -}; +} diff --git a/font-src/gen/caching/index.js b/font-src/gen/caching/index.mjs similarity index 80% rename from font-src/gen/caching/index.js rename to font-src/gen/caching/index.mjs index e7b97447a..0d8b75ea3 100644 --- a/font-src/gen/caching/index.js +++ b/font-src/gen/caching/index.mjs @@ -1,19 +1,15 @@ -"use strict"; - -const fs = require("fs"); -const zlib = require("zlib"); -const { encode, decode } = require("@msgpack/msgpack"); +import fs from "fs"; +import zlib from "zlib"; +import { encode, decode } from "@msgpack/msgpack"; const Edition = 20; const MAX_AGE = 16; - class GfEntry { constructor(age, value) { this.age = age; this.value = value; } } - class Cache { constructor(freshAgeKey) { this.freshAgeKey = freshAgeKey; @@ -40,21 +36,18 @@ class Cache { this.historyAgeKeys[0] === this.freshAgeKey ? this.historyAgeKeys : [this.freshAgeKey, ...this.historyAgeKeys]; - return { version: version + "@" + Edition, ageKeys: mergedAgeKeys, gf: gfRep }; } - isEmpty() { return this.gf.size == 0; } isUpdated() { return this.diff.size != 0; } - // Geometry flattening conversion cache getGF(k) { const entry = this.gf.get(k); @@ -79,8 +72,7 @@ class Cache { } } } - -exports.load = async function (path, version, freshAgeKey) { +export const load = async function (path, version, freshAgeKey) { let cache = new Cache(freshAgeKey); if (path && fs.existsSync(path)) { const buf = zlib.gunzipSync(await fs.promises.readFile(path)); @@ -88,21 +80,19 @@ exports.load = async function (path, version, freshAgeKey) { } return cache; }; - -exports.save = async function savePTCache(path, version, cache, diffOnly) { +export const save = async function savePTCache(path, version, cache, diffOnly) { if (path) { const buf = encode(cache.toRep(version, diffOnly)); const bufZip = zlib.gzipSync(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength)); await fs.promises.writeFile(path, bufZip); } }; - -exports.merge = async function (base, diff, version, freshAgeKey) { - const cacheDiff = await exports.load(diff, version, freshAgeKey); +export const merge = async function (base, diff, version, freshAgeKey) { + const cacheDiff = await load(diff, version, freshAgeKey); if (!cacheDiff.isEmpty()) { - const cacheBase = await exports.load(base, version, freshAgeKey); + const cacheBase = await load(base, version, freshAgeKey); cacheBase.merge(cacheDiff); - await exports.save(base, version, cacheBase, false); + await save(base, version, cacheBase, false); } if (fs.existsSync(diff)) await fs.promises.rm(diff); }; diff --git a/font-src/gen/empty-font.js b/font-src/gen/empty-font.mjs similarity index 82% rename from font-src/gen/empty-font.js rename to font-src/gen/empty-font.mjs index 4dadde28f..4162446e1 100644 --- a/font-src/gen/empty-font.js +++ b/font-src/gen/empty-font.mjs @@ -1,8 +1,6 @@ -"use strict"; +import { Ot } from "ot-builder"; -const { Ot } = require("ot-builder"); - -exports.CreateEmptyFont = function (argv) { +export const CreateEmptyFont = function (argv) { let font = { head: new Ot.Head.Table(), hhea: new Ot.MetricHead.Hhea(), diff --git a/font-src/gen/finalize/gc.js b/font-src/gen/finalize/gc.mjs similarity index 97% rename from font-src/gen/finalize/gc.js rename to font-src/gen/finalize/gc.mjs index fccb7a014..a275fc9e3 100644 --- a/font-src/gen/finalize/gc.js +++ b/font-src/gen/finalize/gc.mjs @@ -1,13 +1,4 @@ -"use strict"; - -const { Radical } = require("../../support/gr"); - -exports.gcFont = function (glyphStore, excludedChars, otl, cfg) { - markSweepOtlLookups(otl.GSUB); - markSweepOtlLookups(otl.GPOS); - const sink = markGlyphs(glyphStore, excludedChars, otl, cfg); - return sweep(glyphStore, sink); -}; +import { Radical } from "../../support/gr.mjs"; function markSweepOtlLookups(table) { if (!table || !table.features || !table.lookups) return; @@ -65,7 +56,6 @@ function sweepFeatures(table, accessibleLookupsIds) { } table.features = features1; } - function markGlyphs(glyphStore, excludedChars, otl, cfg) { const sink = markGlyphsInitial(glyphStore, excludedChars); while (markGlyphsStep(glyphStore, sink, otl, cfg)); @@ -88,7 +78,6 @@ function markGlyphsInitial(glyphStore, excludedChars) { } function markGlyphsStep(glyphStore, sink, otl, cfg) { const glyphCount = sink.size; - if (otl.GSUB) { for (const l in otl.GSUB.lookups) { const lookup = otl.GSUB.lookups[l]; @@ -99,7 +88,6 @@ function markGlyphsStep(glyphStore, sink, otl, cfg) { const glyphCount1 = sink.size; return glyphCount1 > glyphCount; } - function markGlyphsLookupImpl(sink, lookup, cfg) { switch (lookup.type) { case "gsub_single": @@ -116,7 +104,6 @@ function markGlyphsLookupImpl(sink, lookup, cfg) { return markGlyphsGsubReverse(sink, lookup, cfg); } } - function markGlyphsGsubSingle(sink, lookup, cfg) { const st = lookup.substitutions; for (const k in st) if (sink.has(k) && st[k]) sink.add(st[k]); @@ -149,7 +136,12 @@ function markGlyphsGsubReverse(sink, lookup, cfg) { } } } - function sweep(glyphStore, gnSet) { return glyphStore.filterByName(gnSet); } +export const gcFont = function (glyphStore, excludedChars, otl, cfg) { + markSweepOtlLookups(otl.GSUB); + markSweepOtlLookups(otl.GPOS); + const sink = markGlyphs(glyphStore, excludedChars, otl, cfg); + return sweep(glyphStore, sink); +}; diff --git a/font-src/gen/finalize/glyphs.js b/font-src/gen/finalize/glyphs.mjs similarity index 94% rename from font-src/gen/finalize/glyphs.js rename to font-src/gen/finalize/glyphs.mjs index 5c39cff49..a915baa0b 100644 --- a/font-src/gen/finalize/glyphs.js +++ b/font-src/gen/finalize/glyphs.mjs @@ -1,19 +1,10 @@ -"use strict"; - -const TypoGeom = require("typo-geom"); -const Geom = require("../../support/geometry/index"); -const { Point } = require("../../support/geometry/point"); -const { Transform } = require("../../support/geometry/transform"); -const CurveUtil = require("../../support/geometry/curve-util"); - -exports.finalizeGlyphs = function finalizeGlyphs(cache, para, glyphStore) { - const skew = Math.tan(((para.slopeAngle || 0) / 180) * Math.PI); - regulateGlyphStore(cache, skew, glyphStore); - return glyphStore; -}; +import * as TypoGeom from "typo-geom"; +import * as Geom from "../../support/geometry/index.mjs"; +import { Point } from "../../support/geometry/point.mjs"; +import { Transform } from "../../support/geometry/transform.mjs"; +import * as CurveUtil from "../../support/geometry/curve-util.mjs"; /////////////////////////////////////////////////////////////////////////////////////////////////// - function regulateGlyphStore(cache, skew, glyphStore) { const compositeMemo = new Map(); for (const g of glyphStore.glyphs()) { @@ -26,24 +17,19 @@ function regulateGlyphStore(cache, skew, glyphStore) { if (!compositeMemo.get(g)) flattenSimpleGlyph(cache, skew, g); } } - /////////////////////////////////////////////////////////////////////////////////////////////////// - function memoSet(memo, g, v) { memo.set(g, v); return v; } function regulateCompositeGlyph(glyphStore, memo, g) { if (memo.has(g)) return memo.get(g); - let refs = g.geometry.asReferences(); if (!refs) return memoSet(memo, g, false); - for (const sr of refs) { const gn = glyphStore.queryNameOf(sr.glyph); if (!gn) return memoSet(memo, g, false); } - // De-doppelganger while (refs.length === 1 && regulateCompositeGlyph(glyphStore, memo, refs[0].glyph)) { const sr = refs[0]; @@ -54,10 +40,8 @@ function regulateCompositeGlyph(glyphStore, memo, g) { } refs = g.geometry.asReferences(); } - return memoSet(memo, g, true); } - function flattenSimpleGlyph(cache, skew, g) { const ck = Geom.hashGeometry(g.geometry); const cached = cache.getGF(ck); @@ -78,9 +62,7 @@ function flattenSimpleGlyph(cache, skew, g) { if (ck) cache.saveGF(ck, CurveUtil.shapeToRep(cs)); } } - /////////////////////////////////////////////////////////////////////////////////////////////////// - class SimplifyGeometry extends Geom.GeometryBase { constructor(g) { super(); @@ -120,7 +102,6 @@ class SimplifyGeometry extends Geom.GeometryBase { return `SimplifyGeometry{${sTarget}}`; } } - class FairizedShapeSink { constructor() { this.contours = []; @@ -153,7 +134,6 @@ class FairizedShapeSink { } this.lineTo(x, y); } - // Contour cleaning code alignHVKnots(c0) { const c = c0.slice(0); @@ -224,11 +204,9 @@ class FairizedShapeSink { c.length = n; lengthAfter = c.length; } while (lengthAfter < lengthBefore); - return c; } } - // Disjoint set for coordinate alignment class CoordinateAligner { constructor(c, lens, lensSet) { @@ -268,12 +246,10 @@ class CoordinateAligner { } } } - const GetX = z => z.x; const SetX = (z, x) => (z.x = x); const GetY = z => z.y; const SetY = (z, y) => (z.y = y); - function isOccurrent(zFirst, zLast) { return ( zFirst.type === Point.Type.Corner && @@ -291,3 +267,8 @@ function aligned(a, b, c) { function between(a, b, c) { return (a <= b && b <= c) || (a >= b && b >= c); } +export function finalizeGlyphs(cache, para, glyphStore) { + const skew = Math.tan(((para.slopeAngle || 0) / 180) * Math.PI); + regulateGlyphStore(cache, skew, glyphStore); + return glyphStore; +} diff --git a/font-src/gen/finalize/index.js b/font-src/gen/finalize/index.mjs similarity index 85% rename from font-src/gen/finalize/index.js rename to font-src/gen/finalize/index.mjs index 12ad2daa9..1adbf5818 100644 --- a/font-src/gen/finalize/index.js +++ b/font-src/gen/finalize/index.mjs @@ -1,23 +1,11 @@ -"use strict"; - -const { finalizeGlyphs } = require("./glyphs"); -const { gcFont } = require("./gc"); -const { Nwid, Wwid } = require("../../support/gr"); - -exports.finalizeFont = function (cache, para, glyphStore, excludedCodePoints, restFont) { - assignGrAndCodeRank(glyphStore, Nwid, Wwid); - assignSubRank(glyphStore); - glyphStore = gcFont(glyphStore, excludedCodePoints, restFont, {}); - glyphStore = finalizeGlyphs(cache, para, glyphStore); - validateMonospace(para, glyphStore); - return glyphStore; -}; +import { finalizeGlyphs } from "./glyphs.mjs"; +import { gcFont } from "./gc.mjs"; +import { Nwid, Wwid } from "../../support/gr.mjs"; function assignGrAndCodeRank(glyphStore, ...flatteners) { for (const g of glyphStore.glyphs()) { g.codeRank = 0xffffffff; for (const c of glyphStore.flattenCodes(g, flatteners)) if (c < g.codeRank) g.codeRank = c; - g.grRank = 0; for (let i = 0; i < flatteners.length; i++) if (flatteners[i].get(g)) g.grRank |= 1 << i; } @@ -26,7 +14,6 @@ function assignSubRank(glyphStore) { let sr = 0; for (const g of glyphStore.glyphs()) g.subRank = sr++; } - // In FontConfig, a font is considered "monospace" if and only if all non-combining characters // (AW > 0) have the same width. We use this method to validate whether our "Fixed" subfamilies // are properly built. @@ -43,3 +30,11 @@ function validateMonospace(para, glyphStore) { throw new Error("Unreachable! Building monospace with more than 2 character widths"); } } +export const finalizeFont = function (cache, para, glyphStore, excludedCodePoints, restFont) { + assignGrAndCodeRank(glyphStore, Nwid, Wwid); + assignSubRank(glyphStore); + glyphStore = gcFont(glyphStore, excludedCodePoints, restFont, {}); + glyphStore = finalizeGlyphs(cache, para, glyphStore); + validateMonospace(para, glyphStore); + return glyphStore; +}; diff --git a/font-src/gen/otd-conv/glyph-name.js b/font-src/gen/otd-conv/glyph-name.mjs similarity index 97% rename from font-src/gen/otd-conv/glyph-name.js rename to font-src/gen/otd-conv/glyph-name.mjs index 881cefbcf..3b19902ce 100644 --- a/font-src/gen/otd-conv/glyph-name.js +++ b/font-src/gen/otd-conv/glyph-name.mjs @@ -1,5 +1,4 @@ -const { Joining, AnyCv, TieMark, Nwid, Wwid } = require("../../support/gr"); - +import { Joining, AnyCv, TieMark, Nwid, Wwid } from "../../support/gr.mjs"; const ApplePostNames = new Map([ /* spell-checker: disable */ [0xd, "nonmarkingreturn"], @@ -260,11 +259,9 @@ const ApplePostNames = new Map([ [0x111, "dcroat"] /* spell-checker: enable */ ]); - function byCode(gSrc, primaryUnicode, conflictSet) { if (gSrc.glyphRank === 9999) return ".notdef"; if (gSrc.glyphRank === 9998) return ".null"; - let preferredName = null; if (primaryUnicode) { preferredName = @@ -275,7 +272,6 @@ function byCode(gSrc, primaryUnicode, conflictSet) { } return preferredName; } - function formatCodePointHex(u) { return u.toString(16).padStart(4, "0").toUpperCase(); } @@ -326,14 +322,12 @@ function nameByGr(gr, gSrcBase, gOtBase, internalNameMap, conflictSet) { } return 0; } - function byBuildOrder(rank, gSrc, gnOrig) { if (!gnOrig) gnOrig = `.g${rank}`; gnOrig = Joining.amendOtName(gnOrig, Joining.get(gSrc)); return gnOrig; } - -exports.byCode = byCode; -exports.bySpacing = bySpacing; -exports.byGr = byGr; -exports.byBuildOrder = byBuildOrder; +export { byCode }; +export { bySpacing }; +export { byGr }; +export { byBuildOrder }; diff --git a/font-src/gen/otd-conv/glyphs.js b/font-src/gen/otd-conv/glyphs.mjs similarity index 92% rename from font-src/gen/otd-conv/glyphs.js rename to font-src/gen/otd-conv/glyphs.mjs index 7e6353389..3cdf90007 100644 --- a/font-src/gen/otd-conv/glyphs.js +++ b/font-src/gen/otd-conv/glyphs.mjs @@ -1,30 +1,7 @@ -const { Ot } = require("ot-builder"); -const { Point } = require("../../support/geometry/point"); -const Gr = require("../../support/gr"); -const { byCode, bySpacing, byGr, byBuildOrder } = require("./glyph-name"); - -exports.convertGlyphs = function convertGlyphs(gsOrig) { - const sortedEntries = Array.from(gsOrig.namedEntries(Gr.Nwid, Gr.Wwid)).sort(byRank); - - const gs = new MappedGlyphStore(); - const cmap = new Ot.Cmap.Table(); - - for (const [name, gSrc] of sortedEntries) { - gs.declare(name, gSrc); - const us = gsOrig.queryUnicodeOf(gSrc); - if (us) { - for (const u of us) { - if (!(isFinite(u - 0) && u)) continue; - cmap.unicode.set(u, gs.queryBySourceGlyph(gSrc)); - gs.setPrimaryUnicode(gSrc, u); - } - } - } - for (const [name, gSrc] of sortedEntries) gs.fill(name, gSrc); - gs.fillOtGlyphNames(); - return { glyphs: gs, cmap }; -}; - +import { Ot } from "ot-builder"; +import { Point } from "../../support/geometry/point.mjs"; +import * as Gr from "../../support/gr.mjs"; +import { byCode, bySpacing, byGr, byBuildOrder } from "./glyph-name.mjs"; function byRank([gna, a], [gnb, b]) { return ( b.glyphRank - a.glyphRank || @@ -33,7 +10,6 @@ function byRank([gna, a], [gnb, b]) { a.subRank - b.subRank ); } - class MappedGlyphStore { constructor() { this.m_nameMapping = new Map(); @@ -48,14 +24,12 @@ class MappedGlyphStore { setPrimaryUnicode(source, u) { this.m_primaryUnicodeMapping.set(u, source); } - queryBySourceGlyph(source) { return this.m_mapping.get(source); } queryByName(name) { return this.m_nameMapping.get(name); } - decideOrder() { const gs = Ot.ListGlyphStoreFactory.createStoreFromList([...this.m_mapping.values()]); return gs.decideOrder(); @@ -63,10 +37,8 @@ class MappedGlyphStore { fill(name, source) { const g = this.queryBySourceGlyph(source); if (!g) throw new Error("Unreachable"); - // Fill metrics g.horizontal = { start: 0, end: source.advanceWidth }; - // Fill Geometry if (source.geometry.isEmpty()) return; const rs = source.geometry.asReferences(); @@ -81,13 +53,10 @@ class MappedGlyphStore { let conflictSet = new Set(); let rev = new Map(); for (const [u, g] of this.m_primaryUnicodeMapping) rev.set(g, u); - const glyphsInBuildOrder = Array.from(this.m_mapping).sort( ([a], [b]) => a.subRank - b.subRank ); - for (const [gSrc, gOt] of glyphsInBuildOrder) gOt.name = undefined; - // Name by Unicode for (const [gSrc, gOt] of glyphsInBuildOrder) { gOt.name = byCode(gSrc, rev.get(gSrc), conflictSet); @@ -111,7 +80,6 @@ class MappedGlyphStore { for (const [gSrc, gOt] of glyphsInBuildOrder) { gOt.name = byBuildOrder(gSrc.subRank, gSrc, gOt.name); } - // validate { let gnSet = new Set(); @@ -121,7 +89,6 @@ class MappedGlyphStore { } } } - fillReferences(g, rs) { const gl = new Ot.Glyph.GeometryList(); for (const ref of rs) { @@ -152,3 +119,22 @@ class MappedGlyphStore { g.geometry = cs; } } +export function convertGlyphs(gsOrig) { + const sortedEntries = Array.from(gsOrig.namedEntries(Gr.Nwid, Gr.Wwid)).sort(byRank); + const gs = new MappedGlyphStore(); + const cmap = new Ot.Cmap.Table(); + for (const [name, gSrc] of sortedEntries) { + gs.declare(name, gSrc); + const us = gsOrig.queryUnicodeOf(gSrc); + if (us) { + for (const u of us) { + if (!(isFinite(u - 0) && u)) continue; + cmap.unicode.set(u, gs.queryBySourceGlyph(gSrc)); + gs.setPrimaryUnicode(gSrc, u); + } + } + } + for (const [name, gSrc] of sortedEntries) gs.fill(name, gSrc); + gs.fillOtGlyphNames(); + return { glyphs: gs, cmap }; +} diff --git a/font-src/gen/otd-conv/index.js b/font-src/gen/otd-conv/index.mjs similarity index 56% rename from font-src/gen/otd-conv/index.js rename to font-src/gen/otd-conv/index.mjs index d8cf6d897..980b29ac4 100644 --- a/font-src/gen/otd-conv/index.js +++ b/font-src/gen/otd-conv/index.mjs @@ -1,12 +1,9 @@ -const { convertGlyphs } = require("./glyphs"); -const { convertGsub, convertGpos, convertGdef } = require("./layout"); - -exports.convertOtd = function convertOtd(baseFont, otl, gs) { +import { convertGlyphs } from "./glyphs.mjs"; +import { convertGsub, convertGpos, convertGdef } from "./layout.mjs"; +export function convertOtd(baseFont, otl, gs) { const { glyphs, cmap } = convertGlyphs(gs); - const gsub = convertGsub(otl.GSUB, glyphs); const gpos = convertGpos(otl.GPOS, glyphs); const gdef = convertGdef(otl.GDEF, glyphs); - return { ...baseFont, glyphs, cmap, gsub, gpos, gdef }; -}; +} diff --git a/font-src/gen/otd-conv/layout.js b/font-src/gen/otd-conv/layout.js deleted file mode 100644 index 62d404768..000000000 --- a/font-src/gen/otd-conv/layout.js +++ /dev/null @@ -1,326 +0,0 @@ -const { Ot } = require("ot-builder"); - -class LookupStore { - constructor(handlers, glyphs) { - this.glyphs = glyphs; - this.m_handlers = handlers; - this.m_mapping = new Map(); - } - extract() { - return Array.from(this.m_mapping.values()); - } - query(id) { - return this.m_mapping.get(id); - } - - declare(id, otdLookup) { - if (this.m_mapping.has(id)) return; - const handler = this.m_handlers[otdLookup.type]; - if (!handler) return; - this.m_mapping.set(id, handler.init()); - } - fill(id, otdLookup) { - const dst = this.query(id); - const handler = this.m_handlers[otdLookup.type]; - if (!dst || !handler) return; - if (otdLookup.subtables) throw new Error("Unreachable."); - handler.fill(dst, otdLookup, this); - } -} - -const GsubSingleHandler = { - init() { - return new Ot.Gsub.Single(); - }, - fill(dst, src, store) { - const st = src.substitutions; - for (const k in st) { - const from = store.glyphs.queryByName(k); - const to = store.glyphs.queryByName(st[k]); - if (from && to) dst.mapping.set(from, to); - } - } -}; -const GsubMultipleHandler = { - init() { - return new Ot.Gsub.Multiple(); - }, - fill(dst, src, store) { - const st = src.substitutions; - for (const k in st) { - const from = store.glyphs.queryByName(k); - const to = mapGlyphListAll(st[k], store); - if (!from || !to) continue; - dst.mapping.set(from, to); - } - } -}; -const GsubAlternateHandler = { - init() { - return new Ot.Gsub.Alternate(); - }, - fill: GsubMultipleHandler.fill -}; -const GsubLigatureHandler = { - init() { - return new Ot.Gsub.Ligature(); - }, - fill(dst, src, store) { - const st = src.substitutions; - for (const { from: _from, to: _to } of st) { - const to = store.glyphs.queryByName(_to); - const from = mapGlyphListAll(_from, store); - if (!from || !to) continue; - dst.mapping.push({ from, to }); - } - } -}; - -const GsubChainingHandler = { - init() { - return new Ot.Gsub.Chaining(); - }, - fill(dst, src, store) { - out: for (const st of src.rules) { - const match = []; - for (const m of st.match) { - const m1 = mapGlyphListSome(m, store); - if (!m1) continue out; - match.push(new Set(m1)); - } - const inputBegins = st.inputBegins; - const inputEnds = st.inputEnds; - const applications = []; - for (const ap of st.apply) { - const lookup = store.query(ap.lookup); - if (!lookup) continue out; - applications.push({ at: ap.at - inputBegins, apply: lookup }); - } - dst.rules.push({ match, inputBegins, inputEnds, applications }); - } - } -}; - -const GsubReverseHandler = { - init() { - return new Ot.Gsub.ReverseSub(); - }, - fill(dst, src, store) { - out: for (const st of src.rules) { - const match = []; - const doSubAt = st.inputIndex; - const replacement = new Map(); - for (let j = 0; j < st.match.length; j++) { - { - const m1 = new Set(); - for (let k = 0; k < st.match[j].length; k++) { - const gFrom = store.glyphs.queryByName(st.match[j][k]); - if (gFrom) m1.add(gFrom); - } - if (!m1.size) continue out; - match.push(m1); - } - - if (j === doSubAt) { - for (let k = 0; k < st.match[j].length; k++) { - const gFrom = store.glyphs.queryByName(st.match[j][k]); - const gTo = store.glyphs.queryByName(st.to[k]); - if (!gFrom) continue; - if (gTo) { - replacement.set(gFrom, gTo); - } else { - replacement.set(gFrom, gFrom); - } - } - } - } - dst.rules.push({ match, doSubAt, replacement }); - } - } -}; - -function mapGlyphListAll(gl, store) { - const out = []; - for (const item of gl) { - const fg = store.glyphs.queryByName(item); - if (!fg) return null; - out.push(fg); - } - return out; -} -function mapGlyphListSome(gl, store) { - const out = []; - for (const item of gl) { - const fg = store.glyphs.queryByName(item); - if (!fg) continue; - out.push(fg); - } - if (!out.length) return null; - return out; -} - -const GsubHandlers = { - gsub_single: GsubSingleHandler, - gsub_multiple: GsubMultipleHandler, - gsub_alternate: GsubAlternateHandler, - gsub_ligature: GsubLigatureHandler, - gsub_chaining: GsubChainingHandler, - gsub_reverse: GsubReverseHandler -}; - -const GposMarkToBaseHandler = { - init() { - return new Ot.Gpos.MarkToBase(); - }, - fill(dst, src, store) { - const mm = collectClassMap(src.marks); - dst.marks = convertMarkRecords(src.marks, mm, store); - dst.bases = convertBaseRecords(src.bases, mm, store); - } -}; -const GposMarkToMarkHandler = { - init() { - return new Ot.Gpos.MarkToMark(); - }, - fill(dst, src, store) { - const mm = collectClassMap(src.marks); - dst.marks = convertMarkRecords(src.marks, mm, store); - dst.baseMarks = convertBaseRecords(src.bases, mm, store); - } -}; -function collectClassMap(marks) { - let n = 0; - const m = new Map(); - for (const gn in marks) { - const mark = marks[gn]; - if (!m.has(mark.class)) { - m.set(mark.class, n); - n++; - } - } - return m; -} -function convertMarkRecords(marks, mm, store) { - const out = new Map(); - for (const gn in marks) { - const mark = marks[gn]; - const g = store.glyphs.queryByName(gn); - if (!g) continue; - let markAnchors = []; - markAnchors[mm.get(mark.class)] = { x: mark.x, y: mark.y }; - out.set(g, { markAnchors: markAnchors }); - } - return out; -} -function convertBaseRecords(bases, mm, store) { - const out = new Map(); - for (const gn in bases) { - const baseObj = bases[gn]; - const g = store.glyphs.queryByName(gn); - if (!g) continue; - const baseArray = []; - for (const bkStr in baseObj) { - baseArray[mm.get(bkStr)] = baseObj[bkStr]; - } - out.set(g, { baseAnchors: baseArray }); - } - return out; -} -const GposHandlers = { - gpos_mark_to_base: GposMarkToBaseHandler, - gpos_mark_to_mark: GposMarkToMarkHandler -}; - -class FeatureStore { - constructor(lookups) { - this.lookupStore = lookups; - this.m_mapping = new Map(); - } - extract() { - return Array.from(this.m_mapping.values()); - } - query(id) { - return this.m_mapping.get(id); - } - fill(id, data) { - const tag = id.slice(0, 4); - const lookups = []; - for (const lid of data) { - const lookup = this.lookupStore.query(lid); - if (lookup) lookups.push(lookup); - } - this.m_mapping.set(id, { tag, lookups }); - } -} - -class ScriptLanguageStore { - constructor(features) { - this.featureStore = features; - this.m_scriptMapping = new Map(); - } - extract() { - return this.m_scriptMapping; - } - fill(id, data) { - const scriptTag = id.slice(0, 4); - const languageTag = id.slice(5, 9).padEnd(4); - let sr = this.m_scriptMapping.get(scriptTag); - if (!sr) { - sr = { defaultLanguage: null, languages: new Map() }; - this.m_scriptMapping.set(scriptTag, sr); - } - - const lr = this.createLanguageRecord(data); - if (languageTag === "dflt" || languageTag === "DFLT") sr.defaultLanguage = lr; - else sr.languages.set(languageTag, lr); - } - createLanguageRecord(data) { - const features = []; - for (const fid of data.features) { - const feature = this.featureStore.query(fid); - if (feature) features.push(feature); - } - return { - requiredFeature: this.featureStore.query(data.requiredFeature) || null, - features: features - }; - } -} - -exports.convertGsub = ConvertGsubGposT(GsubHandlers, Ot.Gsub.Table); -exports.convertGpos = ConvertGsubGposT(GposHandlers, Ot.Gpos.Table); - -function ConvertGsubGposT(handlers, T) { - return function (table, glyphs) { - if (!table) return null; - const ls = new LookupStore(handlers, glyphs); - if (table.lookups) { - if (table.lookupOrder) { - for (const l of table.lookupOrder) ls.declare(l, table.lookups[l]); - } - for (const l in table.lookups) ls.declare(l, table.lookups[l]); - for (const l in table.lookups) ls.fill(l, table.lookups[l]); - } - const fs = new FeatureStore(ls); - if (table.features) { - for (const f in table.features) fs.fill(f, table.features[f]); - } - const ss = new ScriptLanguageStore(fs); - if (table.languages) { - for (const sl in table.languages) ss.fill(sl, table.languages[sl]); - } - - return new T(ss.extract(), fs.extract(), ls.extract()); - }; -} - -exports.convertGdef = convertGdef; -function convertGdef(otdGdef, glyphs) { - const gdef = new Ot.Gdef.Table(); - gdef.glyphClassDef = new Map(); - for (const gn in otdGdef.glyphClassDef) { - const g = glyphs.queryByName(gn); - if (g) gdef.glyphClassDef.set(g, otdGdef.glyphClassDef[gn]); - } - return gdef; -} diff --git a/font-src/gen/otd-conv/layout.mjs b/font-src/gen/otd-conv/layout.mjs new file mode 100644 index 000000000..b5c09ded8 --- /dev/null +++ b/font-src/gen/otd-conv/layout.mjs @@ -0,0 +1,339 @@ +import { Ot } from "ot-builder"; +class LookupStore { + constructor(handlers, glyphs) { + this.glyphs = glyphs; + this.m_handlers = handlers; + this.m_mapping = new Map(); + } + extract() { + return Array.from(this.m_mapping.values()); + } + query(id) { + return this.m_mapping.get(id); + } + declare(id, otdLookup) { + if (this.m_mapping.has(id)) + return; + const handler = this.m_handlers[otdLookup.type]; + if (!handler) + return; + this.m_mapping.set(id, handler.init()); + } + fill(id, otdLookup) { + const dst = this.query(id); + const handler = this.m_handlers[otdLookup.type]; + if (!dst || !handler) + return; + if (otdLookup.subtables) + throw new Error("Unreachable."); + handler.fill(dst, otdLookup, this); + } +} +const GsubSingleHandler = { + init() { + return new Ot.Gsub.Single(); + }, + fill(dst, src, store) { + const st = src.substitutions; + for (const k in st) { + const from = store.glyphs.queryByName(k); + const to = store.glyphs.queryByName(st[k]); + if (from && to) + dst.mapping.set(from, to); + } + } +}; +const GsubMultipleHandler = { + init() { + return new Ot.Gsub.Multiple(); + }, + fill(dst, src, store) { + const st = src.substitutions; + for (const k in st) { + const from = store.glyphs.queryByName(k); + const to = mapGlyphListAll(st[k], store); + if (!from || !to) + continue; + dst.mapping.set(from, to); + } + } +}; +const GsubAlternateHandler = { + init() { + return new Ot.Gsub.Alternate(); + }, + fill: GsubMultipleHandler.fill +}; +const GsubLigatureHandler = { + init() { + return new Ot.Gsub.Ligature(); + }, + fill(dst, src, store) { + const st = src.substitutions; + for (const { from: _from, to: _to } of st) { + const to = store.glyphs.queryByName(_to); + const from = mapGlyphListAll(_from, store); + if (!from || !to) + continue; + dst.mapping.push({ from, to }); + } + } +}; +const GsubChainingHandler = { + init() { + return new Ot.Gsub.Chaining(); + }, + fill(dst, src, store) { + out: for (const st of src.rules) { + const match = []; + for (const m of st.match) { + const m1 = mapGlyphListSome(m, store); + if (!m1) + continue out; + match.push(new Set(m1)); + } + const inputBegins = st.inputBegins; + const inputEnds = st.inputEnds; + const applications = []; + for (const ap of st.apply) { + const lookup = store.query(ap.lookup); + if (!lookup) + continue out; + applications.push({ at: ap.at - inputBegins, apply: lookup }); + } + dst.rules.push({ match, inputBegins, inputEnds, applications }); + } + } +}; +const GsubReverseHandler = { + init() { + return new Ot.Gsub.ReverseSub(); + }, + fill(dst, src, store) { + out: for (const st of src.rules) { + const match = []; + const doSubAt = st.inputIndex; + const replacement = new Map(); + for (let j = 0; j < st.match.length; j++) { + { + const m1 = new Set(); + for (let k = 0; k < st.match[j].length; k++) { + const gFrom = store.glyphs.queryByName(st.match[j][k]); + if (gFrom) + m1.add(gFrom); + } + if (!m1.size) + continue out; + match.push(m1); + } + if (j === doSubAt) { + for (let k = 0; k < st.match[j].length; k++) { + const gFrom = store.glyphs.queryByName(st.match[j][k]); + const gTo = store.glyphs.queryByName(st.to[k]); + if (!gFrom) + continue; + if (gTo) { + replacement.set(gFrom, gTo); + } + else { + replacement.set(gFrom, gFrom); + } + } + } + } + dst.rules.push({ match, doSubAt, replacement }); + } + } +}; +function mapGlyphListAll(gl, store) { + const out = []; + for (const item of gl) { + const fg = store.glyphs.queryByName(item); + if (!fg) + return null; + out.push(fg); + } + return out; +} +function mapGlyphListSome(gl, store) { + const out = []; + for (const item of gl) { + const fg = store.glyphs.queryByName(item); + if (!fg) + continue; + out.push(fg); + } + if (!out.length) + return null; + return out; +} +const GsubHandlers = { + gsub_single: GsubSingleHandler, + gsub_multiple: GsubMultipleHandler, + gsub_alternate: GsubAlternateHandler, + gsub_ligature: GsubLigatureHandler, + gsub_chaining: GsubChainingHandler, + gsub_reverse: GsubReverseHandler +}; +const GposMarkToBaseHandler = { + init() { + return new Ot.Gpos.MarkToBase(); + }, + fill(dst, src, store) { + const mm = collectClassMap(src.marks); + dst.marks = convertMarkRecords(src.marks, mm, store); + dst.bases = convertBaseRecords(src.bases, mm, store); + } +}; +const GposMarkToMarkHandler = { + init() { + return new Ot.Gpos.MarkToMark(); + }, + fill(dst, src, store) { + const mm = collectClassMap(src.marks); + dst.marks = convertMarkRecords(src.marks, mm, store); + dst.baseMarks = convertBaseRecords(src.bases, mm, store); + } +}; +function collectClassMap(marks) { + let n = 0; + const m = new Map(); + for (const gn in marks) { + const mark = marks[gn]; + if (!m.has(mark.class)) { + m.set(mark.class, n); + n++; + } + } + return m; +} +function convertMarkRecords(marks, mm, store) { + const out = new Map(); + for (const gn in marks) { + const mark = marks[gn]; + const g = store.glyphs.queryByName(gn); + if (!g) + continue; + let markAnchors = []; + markAnchors[mm.get(mark.class)] = { x: mark.x, y: mark.y }; + out.set(g, { markAnchors: markAnchors }); + } + return out; +} +function convertBaseRecords(bases, mm, store) { + const out = new Map(); + for (const gn in bases) { + const baseObj = bases[gn]; + const g = store.glyphs.queryByName(gn); + if (!g) + continue; + const baseArray = []; + for (const bkStr in baseObj) { + baseArray[mm.get(bkStr)] = baseObj[bkStr]; + } + out.set(g, { baseAnchors: baseArray }); + } + return out; +} +const GposHandlers = { + gpos_mark_to_base: GposMarkToBaseHandler, + gpos_mark_to_mark: GposMarkToMarkHandler +}; +class FeatureStore { + constructor(lookups) { + this.lookupStore = lookups; + this.m_mapping = new Map(); + } + extract() { + return Array.from(this.m_mapping.values()); + } + query(id) { + return this.m_mapping.get(id); + } + fill(id, data) { + const tag = id.slice(0, 4); + const lookups = []; + for (const lid of data) { + const lookup = this.lookupStore.query(lid); + if (lookup) + lookups.push(lookup); + } + this.m_mapping.set(id, { tag, lookups }); + } +} +class ScriptLanguageStore { + constructor(features) { + this.featureStore = features; + this.m_scriptMapping = new Map(); + } + extract() { + return this.m_scriptMapping; + } + fill(id, data) { + const scriptTag = id.slice(0, 4); + const languageTag = id.slice(5, 9).padEnd(4); + let sr = this.m_scriptMapping.get(scriptTag); + if (!sr) { + sr = { defaultLanguage: null, languages: new Map() }; + this.m_scriptMapping.set(scriptTag, sr); + } + const lr = this.createLanguageRecord(data); + if (languageTag === "dflt" || languageTag === "DFLT") + sr.defaultLanguage = lr; + else + sr.languages.set(languageTag, lr); + } + createLanguageRecord(data) { + const features = []; + for (const fid of data.features) { + const feature = this.featureStore.query(fid); + if (feature) + features.push(feature); + } + return { + requiredFeature: this.featureStore.query(data.requiredFeature) || null, + features: features + }; + } +} +function ConvertGsubGposT(handlers, T) { + return function (table, glyphs) { + if (!table) + return null; + const ls = new LookupStore(handlers, glyphs); + if (table.lookups) { + if (table.lookupOrder) { + for (const l of table.lookupOrder) + ls.declare(l, table.lookups[l]); + } + for (const l in table.lookups) + ls.declare(l, table.lookups[l]); + for (const l in table.lookups) + ls.fill(l, table.lookups[l]); + } + const fs = new FeatureStore(ls); + if (table.features) { + for (const f in table.features) + fs.fill(f, table.features[f]); + } + const ss = new ScriptLanguageStore(fs); + if (table.languages) { + for (const sl in table.languages) + ss.fill(sl, table.languages[sl]); + } + return new T(ss.extract(), fs.extract(), ls.extract()); + }; +} +function convertGdef(otdGdef, glyphs) { + const gdef = new Ot.Gdef.Table(); + gdef.glyphClassDef = new Map(); + for (const gn in otdGdef.glyphClassDef) { + const g = glyphs.queryByName(gn); + if (g) + gdef.glyphClassDef.set(g, otdGdef.glyphClassDef[gn]); + } + return gdef; +} +export const convertGsub = ConvertGsubGposT(GsubHandlers, Ot.Gsub.Table); +export const convertGpos = ConvertGsubGposT(GposHandlers, Ot.Gpos.Table); +export { convertGdef }; diff --git a/font-src/glyphs/auto-build/accents.ptl b/font-src/glyphs/auto-build/accents.ptl index b6e859960..49aeb39cc 100644 --- a/font-src/glyphs/auto-build/accents.ptl +++ b/font-src/glyphs/auto-build/accents.ptl @@ -1,9 +1,9 @@ ###### Automatic builds $$include '../../meta/macros.ptl' -import [Dotless AnyDerivingCv DotlessOrNot getGrTree CvDecompose CcmpDecompose RequireCcmpDecompose] from "../../support/gr" -import [fallback] from '../../support/utils' -import as UnicodeKnowledge from "../../meta/unicode-knowledge" +import [Dotless AnyDerivingCv DotlessOrNot getGrTree CvDecompose CcmpDecompose RequireCcmpDecompose] from"../../support/gr.mjs" +import [fallback] from"../../support/utils.mjs" +import as UnicodeKnowledge from"../../meta/unicode-knowledge.mjs" glyph-module diff --git a/font-src/glyphs/auto-build/composite.ptl b/font-src/glyphs/auto-build/composite.ptl index 8150daf89..2494b8caf 100644 --- a/font-src/glyphs/auto-build/composite.ptl +++ b/font-src/glyphs/auto-build/composite.ptl @@ -1,10 +1,10 @@ ###### Automatic builds $$include '../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../support/utils' -import [getGrMesh AnyCv CvDecompose Joining hashCv] from "../../support/gr" -import [hashGeometry] from "../../support/geometry/index" -import [Transform] from "../../support/geometry/transform" +import [mix linreg clamp fallback] from"../../support/utils.mjs" +import [getGrMesh AnyCv CvDecompose Joining hashCv] from"../../support/gr.mjs" +import [hashGeometry] from"../../support/geometry/index.mjs" +import [Transform] from"../../support/geometry/transform.mjs" extern Map extern Set diff --git a/font-src/glyphs/auto-build/transformed.ptl b/font-src/glyphs/auto-build/transformed.ptl index 6b21d15a1..35bb57ab2 100644 --- a/font-src/glyphs/auto-build/transformed.ptl +++ b/font-src/glyphs/auto-build/transformed.ptl @@ -1,10 +1,10 @@ ###### Automatic builds $$include '../../meta/macros.ptl' -import [linreg clamp mix fallback] from '../../support/utils' -import [getGrTree getGrMesh] from "../../support/gr" -import [AnyCv DotlessOrNot CvDecompose MathSansSerif] from "../../support/gr" -import [NumeratorForm DenominatorForm] from "../../support/gr" +import [linreg clamp mix fallback] from"../../support/utils.mjs" +import [getGrTree getGrMesh] from"../../support/gr.mjs" +import [AnyCv DotlessOrNot CvDecompose MathSansSerif] from"../../support/gr.mjs" +import [NumeratorForm DenominatorForm] from"../../support/gr.mjs" extern Map extern Set diff --git a/font-src/glyphs/common/derivatives.ptl b/font-src/glyphs/common/derivatives.ptl index 362cfaf41..84a1d1f73 100644 --- a/font-src/glyphs/common/derivatives.ptl +++ b/font-src/glyphs/common/derivatives.ptl @@ -1,7 +1,7 @@ $$include '../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../support/utils' -import [Cv AnyCv AnyDerivingCv Dotless SvInheritableRelations CvDecompose PseudoCvDecompose getGrMesh] from '../../support/gr' +import [mix linreg clamp fallback] from"../../support/utils.mjs" +import [Cv AnyCv AnyDerivingCv Dotless SvInheritableRelations CvDecompose PseudoCvDecompose getGrMesh] from"../../support/gr.mjs" extern Map diff --git a/font-src/glyphs/common/shapes.ptl b/font-src/glyphs/common/shapes.ptl index fcd06d395..f52ec7be8 100644 --- a/font-src/glyphs/common/shapes.ptl +++ b/font-src/glyphs/common/shapes.ptl @@ -1,9 +1,9 @@ $$include '../../meta/macros.ptl' -import [Transform] from '../../support/geometry/transform' +import [Transform] from"../../support/geometry/transform.mjs" -import [mix linreg clamp fallback] from '../../support/utils' -import [Radical] from '../../support/gr' +import [mix linreg clamp fallback] from"../../support/utils.mjs" +import [Radical] from"../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/index.ptl b/font-src/glyphs/index.ptl index 45d248a3f..6b63500b0 100644 --- a/font-src/glyphs/index.ptl +++ b/font-src/glyphs/index.ptl @@ -1,15 +1,15 @@ -import [Glyph] from '../support/glyph/index' -import [GlyphStore] from '../support/glyph-store' -import [GlyphBlock] from '../support/glyph-block' -import as Gr from '../support/gr' -import as SpiroKit from '../kits/spiro-kit' -import as BooleKit from '../kits/boole-kit' -import [ DesignParameters ] from "../meta/aesthetics" +import [Glyph] from"../support/glyph/index.mjs" +import [GlyphStore] from"../support/glyph-store.mjs" +import [GlyphBlock] from"../support/glyph-block.mjs" +import as Gr from"../support/gr.mjs" +import as SpiroKit from"../kits/spiro-kit.mjs" +import as BooleKit from"../kits/boole-kit.mjs" +import [ DesignParameters ] from"../meta/aesthetics.mjs" extern isFinite -import [mix linreg clamp fallback] from '../support/utils' -import [calculateMetrics setFontMetrics MarksetDiv GenDivFrame] from '../meta/aesthetics' +import [mix linreg clamp fallback] from"../support/utils.mjs" +import [calculateMetrics setFontMetrics MarksetDiv GenDivFrame] from"../meta/aesthetics.mjs" $$include '../meta/macros.ptl' @@ -118,39 +118,39 @@ export : define [buildGlyphs para recursive recursiveCodes] : begin define $$Capture$$ : object [metrics : Object.create metrics] $NamedParameterPair$ $donothing$ para recursive recursiveCodes glyphStore $createAndSaveGlyphImpl$ SpiroFns BooleFns MarkSet AS_BASE ALSO_METRICS pickHash buildGlyphs tagged DivFrame fontMetrics $assignUnicodeImpl$ $defineGlyphBlockImpl$ ### HERE WE GO - run-glyph-module './common/shapes.js' - run-glyph-module './common/derivatives.js' - run-glyph-module './space/index.js' - run-glyph-module './marks/index.js' + run-glyph-module "./common/shapes.mjs" + run-glyph-module "./common/derivatives.mjs" + run-glyph-module "./space/index.mjs" + run-glyph-module "./marks/index.mjs" # Unified letters - run-glyph-module './letter/shared.js' - run-glyph-module './letter/latin.js' - run-glyph-module './letter/greek.js' - run-glyph-module './letter/cyrillic.js' + run-glyph-module "./letter/shared.mjs" + run-glyph-module "./letter/latin.mjs" + run-glyph-module "./letter/greek.mjs" + run-glyph-module "./letter/cyrillic.mjs" # Numbers - run-glyph-module './number/index.js' + run-glyph-module "./number/index.mjs" # Symbols - run-glyph-module './symbol/shared.js' - run-glyph-module './symbol/punctuation.js' - run-glyph-module './symbol/arrow.js' - run-glyph-module './symbol/geometric.js' - run-glyph-module './symbol/enclosure.js' - run-glyph-module './symbol/math.js' - run-glyph-module './symbol/letter.js' - run-glyph-module './symbol/braille.js' - run-glyph-module './symbol/mosaic.js' - run-glyph-module './symbol/pictograph.js' - run-glyph-module './symbol/ligation.js' + run-glyph-module "./symbol/shared.mjs" + run-glyph-module "./symbol/punctuation.mjs" + run-glyph-module "./symbol/arrow.mjs" + run-glyph-module "./symbol/geometric.mjs" + run-glyph-module "./symbol/enclosure.mjs" + run-glyph-module "./symbol/math.mjs" + run-glyph-module "./symbol/letter.mjs" + run-glyph-module "./symbol/braille.mjs" + run-glyph-module "./symbol/mosaic.mjs" + run-glyph-module "./symbol/pictograph.mjs" + run-glyph-module "./symbol/ligation.mjs" # Autobuilds if [not recursive] : begin - run-glyph-module './auto-build/special-accented-letters.js' - run-glyph-module './auto-build/accents.js' - run-glyph-module './auto-build/composite.js' - run-glyph-module './auto-build/transformed.js' + run-glyph-module "./auto-build/special-accented-letters.mjs" + run-glyph-module "./auto-build/accents.mjs" + run-glyph-module "./auto-build/composite.mjs" + run-glyph-module "./auto-build/transformed.mjs" foreach [gb : items-of $$Capture$$.$pendingGlyphBlocks$] : gb.resolve diff --git a/font-src/glyphs/letter/cyrillic.ptl b/font-src/glyphs/letter/cyrillic.ptl index 69d06cc36..68b7ef3f7 100644 --- a/font-src/glyphs/letter/cyrillic.ptl +++ b/font-src/glyphs/letter/cyrillic.ptl @@ -2,26 +2,26 @@ $$include '../../meta/macros.ptl' export : define [apply] : begin define $$Capture$$ this - run-glyph-module './cyrillic/abk-ha.js' - run-glyph-module './cyrillic/big-yus.js' - run-glyph-module './cyrillic/che.js' - run-glyph-module './cyrillic/de.js' - run-glyph-module './cyrillic/dje.js' - run-glyph-module './cyrillic/dzhe.js' - run-glyph-module './cyrillic/el.js' - run-glyph-module './cyrillic/fita.js' - run-glyph-module './cyrillic/lje.js' - run-glyph-module './cyrillic/lower-be.js' - run-glyph-module './cyrillic/nje.js' - run-glyph-module './cyrillic/omega.js' - run-glyph-module './cyrillic/sha.js' - run-glyph-module './cyrillic/small-yus.js' - run-glyph-module './cyrillic/te-comb.js' - run-glyph-module './cyrillic/tse.js' - run-glyph-module './cyrillic/tshe.js' - run-glyph-module './cyrillic/yat.js' - run-glyph-module './cyrillic/yeri.js' - run-glyph-module './cyrillic/yu.js' - run-glyph-module './cyrillic/zhe.js' + run-glyph-module "./cyrillic/abk-ha.mjs" + run-glyph-module "./cyrillic/big-yus.mjs" + run-glyph-module "./cyrillic/che.mjs" + run-glyph-module "./cyrillic/de.mjs" + run-glyph-module "./cyrillic/dje.mjs" + run-glyph-module "./cyrillic/dzhe.mjs" + run-glyph-module "./cyrillic/el.mjs" + run-glyph-module "./cyrillic/fita.mjs" + run-glyph-module "./cyrillic/lje.mjs" + run-glyph-module "./cyrillic/lower-be.mjs" + run-glyph-module "./cyrillic/nje.mjs" + run-glyph-module "./cyrillic/omega.mjs" + run-glyph-module "./cyrillic/sha.mjs" + run-glyph-module "./cyrillic/small-yus.mjs" + run-glyph-module "./cyrillic/te-comb.mjs" + run-glyph-module "./cyrillic/tse.mjs" + run-glyph-module "./cyrillic/tshe.mjs" + run-glyph-module "./cyrillic/yat.mjs" + run-glyph-module "./cyrillic/yeri.mjs" + run-glyph-module "./cyrillic/yu.mjs" + run-glyph-module "./cyrillic/zhe.mjs" - run-glyph-module './cyrillic/orthography.js' + run-glyph-module "./cyrillic/orthography.mjs" diff --git a/font-src/glyphs/letter/cyrillic/abk-ha.ptl b/font-src/glyphs/letter/cyrillic/abk-ha.ptl index 68d155038..738397767 100644 --- a/font-src/glyphs/letter/cyrillic/abk-ha.ptl +++ b/font-src/glyphs/letter/cyrillic/abk-ha.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix barmixL linreg clamp fallback] from '../../../support/utils' +import [mix barmixL linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/letter/cyrillic/big-yus.ptl b/font-src/glyphs/letter/cyrillic/big-yus.ptl index a1c9bae25..c7f0d7969 100644 --- a/font-src/glyphs/letter/cyrillic/big-yus.ptl +++ b/font-src/glyphs/letter/cyrillic/big-yus.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix barmixL linreg clamp fallback] from '../../../support/utils' +import [mix barmixL linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/letter/cyrillic/che.ptl b/font-src/glyphs/letter/cyrillic/che.ptl index 8655c8133..0e3925188 100644 --- a/font-src/glyphs/letter/cyrillic/che.ptl +++ b/font-src/glyphs/letter/cyrillic/che.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix barmixL linreg clamp fallback] from '../../../support/utils' +import [mix barmixL linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/letter/cyrillic/de.ptl b/font-src/glyphs/letter/cyrillic/de.ptl index 530074ccc..fb66df04a 100644 --- a/font-src/glyphs/letter/cyrillic/de.ptl +++ b/font-src/glyphs/letter/cyrillic/de.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix barmixL linreg clamp fallback] from '../../../support/utils' +import [mix barmixL linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/letter/cyrillic/dje.ptl b/font-src/glyphs/letter/cyrillic/dje.ptl index aa98fa369..328a560b6 100644 --- a/font-src/glyphs/letter/cyrillic/dje.ptl +++ b/font-src/glyphs/letter/cyrillic/dje.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix barmixL linreg clamp fallback] from '../../../support/utils' +import [mix barmixL linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/letter/cyrillic/dzhe.ptl b/font-src/glyphs/letter/cyrillic/dzhe.ptl index ca973fc33..81629101a 100644 --- a/font-src/glyphs/letter/cyrillic/dzhe.ptl +++ b/font-src/glyphs/letter/cyrillic/dzhe.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix barmixL linreg clamp fallback] from '../../../support/utils' +import [mix barmixL linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/letter/cyrillic/el.ptl b/font-src/glyphs/letter/cyrillic/el.ptl index c34618a71..23a5b8815 100644 --- a/font-src/glyphs/letter/cyrillic/el.ptl +++ b/font-src/glyphs/letter/cyrillic/el.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix barmixL linreg clamp fallback] from '../../../support/utils' -import [Point] from '../../../support/geometry/point' +import [mix barmixL linreg clamp fallback] from"../../../support/utils.mjs" +import [Point] from"../../../support/geometry/point.mjs" glyph-module diff --git a/font-src/glyphs/letter/cyrillic/fita.ptl b/font-src/glyphs/letter/cyrillic/fita.ptl index 95c25c431..3f851eb84 100644 --- a/font-src/glyphs/letter/cyrillic/fita.ptl +++ b/font-src/glyphs/letter/cyrillic/fita.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix barmixL linreg clamp fallback] from '../../../support/utils' +import [mix barmixL linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/letter/cyrillic/lje.ptl b/font-src/glyphs/letter/cyrillic/lje.ptl index 1ad739e3d..2fe6735c7 100644 --- a/font-src/glyphs/letter/cyrillic/lje.ptl +++ b/font-src/glyphs/letter/cyrillic/lje.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix barmixL linreg clamp fallback] from '../../../support/utils' -import [Point] from '../../../support/geometry/point' +import [mix barmixL linreg clamp fallback] from"../../../support/utils.mjs" +import [Point] from"../../../support/geometry/point.mjs" glyph-module diff --git a/font-src/glyphs/letter/cyrillic/lower-be.ptl b/font-src/glyphs/letter/cyrillic/lower-be.ptl index 8f37ba9ba..16ae3299e 100644 --- a/font-src/glyphs/letter/cyrillic/lower-be.ptl +++ b/font-src/glyphs/letter/cyrillic/lower-be.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix barmixL linreg clamp fallback] from '../../../support/utils' +import [mix barmixL linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/letter/cyrillic/nje.ptl b/font-src/glyphs/letter/cyrillic/nje.ptl index 241335a46..8beb1e677 100644 --- a/font-src/glyphs/letter/cyrillic/nje.ptl +++ b/font-src/glyphs/letter/cyrillic/nje.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix barmixL linreg clamp fallback] from '../../../support/utils' -import [RightDependentLink RightDependentTrigger CvDecompose] from "../../../support/gr" +import [mix barmixL linreg clamp fallback] from"../../../support/utils.mjs" +import [RightDependentLink RightDependentTrigger CvDecompose] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/cyrillic/omega.ptl b/font-src/glyphs/letter/cyrillic/omega.ptl index 361e86fcc..9ea3b0b77 100644 --- a/font-src/glyphs/letter/cyrillic/omega.ptl +++ b/font-src/glyphs/letter/cyrillic/omega.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix barmixL linreg clamp fallback] from '../../../support/utils' +import [mix barmixL linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/letter/cyrillic/sha.ptl b/font-src/glyphs/letter/cyrillic/sha.ptl index 2bc40c49b..e0c67146f 100644 --- a/font-src/glyphs/letter/cyrillic/sha.ptl +++ b/font-src/glyphs/letter/cyrillic/sha.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix barmixL linreg clamp fallback] from '../../../support/utils' +import [mix barmixL linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/letter/cyrillic/small-yus.ptl b/font-src/glyphs/letter/cyrillic/small-yus.ptl index bfa94bc15..96335acdb 100644 --- a/font-src/glyphs/letter/cyrillic/small-yus.ptl +++ b/font-src/glyphs/letter/cyrillic/small-yus.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix barmixL linreg clamp fallback] from '../../../support/utils' +import [mix barmixL linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/letter/cyrillic/te-comb.ptl b/font-src/glyphs/letter/cyrillic/te-comb.ptl index dd739e3e3..b042ee0b4 100644 --- a/font-src/glyphs/letter/cyrillic/te-comb.ptl +++ b/font-src/glyphs/letter/cyrillic/te-comb.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix barmixL linreg clamp fallback] from '../../../support/utils' +import [mix barmixL linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/letter/cyrillic/tse.ptl b/font-src/glyphs/letter/cyrillic/tse.ptl index b22cc4f9a..ae7077914 100644 --- a/font-src/glyphs/letter/cyrillic/tse.ptl +++ b/font-src/glyphs/letter/cyrillic/tse.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix barmixL linreg clamp fallback] from '../../../support/utils' +import [mix barmixL linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/letter/cyrillic/tshe.ptl b/font-src/glyphs/letter/cyrillic/tshe.ptl index aae6847c1..3d3c23f39 100644 --- a/font-src/glyphs/letter/cyrillic/tshe.ptl +++ b/font-src/glyphs/letter/cyrillic/tshe.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix barmixL linreg clamp fallback] from '../../../support/utils' +import [mix barmixL linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/letter/cyrillic/yat.ptl b/font-src/glyphs/letter/cyrillic/yat.ptl index cf30946c6..8150b1d0f 100644 --- a/font-src/glyphs/letter/cyrillic/yat.ptl +++ b/font-src/glyphs/letter/cyrillic/yat.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix barmixL linreg clamp fallback] from '../../../support/utils' +import [mix barmixL linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/letter/cyrillic/yeri.ptl b/font-src/glyphs/letter/cyrillic/yeri.ptl index db6eb4589..ecc9b8333 100644 --- a/font-src/glyphs/letter/cyrillic/yeri.ptl +++ b/font-src/glyphs/letter/cyrillic/yeri.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix barmixL linreg clamp fallback] from '../../../support/utils' +import [mix barmixL linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/letter/cyrillic/yu.ptl b/font-src/glyphs/letter/cyrillic/yu.ptl index 8c875d39b..00eb5e176 100644 --- a/font-src/glyphs/letter/cyrillic/yu.ptl +++ b/font-src/glyphs/letter/cyrillic/yu.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix barmixL linreg clamp fallback] from '../../../support/utils' +import [mix barmixL linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/letter/cyrillic/zhe.ptl b/font-src/glyphs/letter/cyrillic/zhe.ptl index ceb5bacdd..a345802d1 100644 --- a/font-src/glyphs/letter/cyrillic/zhe.ptl +++ b/font-src/glyphs/letter/cyrillic/zhe.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix barmixL linreg clamp fallback] from '../../../support/utils' +import [mix barmixL linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/letter/greek.ptl b/font-src/glyphs/letter/greek.ptl index 8b782bf74..7e1f8f952 100644 --- a/font-src/glyphs/letter/greek.ptl +++ b/font-src/glyphs/letter/greek.ptl @@ -2,34 +2,34 @@ $$include '../../meta/macros.ptl' export : define [apply] : begin define $$Capture$$ this - run-glyph-module './greek/upper-gamma.js' - run-glyph-module './greek/upper-theta.js' - run-glyph-module './greek/upper-xi.js' - run-glyph-module './greek/pi.js' - run-glyph-module './greek/upper-sigma.js' - run-glyph-module './greek/upper-phi.js' - run-glyph-module './greek/psi.js' - run-glyph-module './greek/upper-omega.js' + run-glyph-module "./greek/upper-gamma.mjs" + run-glyph-module "./greek/upper-theta.mjs" + run-glyph-module "./greek/upper-xi.mjs" + run-glyph-module "./greek/pi.mjs" + run-glyph-module "./greek/upper-sigma.mjs" + run-glyph-module "./greek/upper-phi.mjs" + run-glyph-module "./greek/psi.mjs" + run-glyph-module "./greek/upper-omega.mjs" - run-glyph-module './greek/lower-alpha.js' - run-glyph-module './greek/lower-delta.js' - run-glyph-module './greek/lower-epsilon.js' - run-glyph-module './greek/lower-lunate-epsilon.js' - run-glyph-module './greek/lower-gamma.js' - run-glyph-module './greek/lower-zeta.js' - run-glyph-module './greek/lower-theta.js' - run-glyph-module './greek/lower-kappa-symbol.js' - run-glyph-module './greek/lower-mu.js' - run-glyph-module './greek/lower-nu.js' - run-glyph-module './greek/lower-xi.js' - run-glyph-module './greek/lower-rho.js' - run-glyph-module './greek/lower-sigma.js' - run-glyph-module './greek/lower-sigma-final.js' - run-glyph-module './greek/lower-tau.js' - run-glyph-module './greek/lower-upsilon.js' - run-glyph-module './greek/lower-phi.js' - run-glyph-module './greek/lower-omega.js' + run-glyph-module "./greek/lower-alpha.mjs" + run-glyph-module "./greek/lower-delta.mjs" + run-glyph-module "./greek/lower-epsilon.mjs" + run-glyph-module "./greek/lower-lunate-epsilon.mjs" + run-glyph-module "./greek/lower-gamma.mjs" + run-glyph-module "./greek/lower-zeta.mjs" + run-glyph-module "./greek/lower-theta.mjs" + run-glyph-module "./greek/lower-kappa-symbol.mjs" + run-glyph-module "./greek/lower-mu.mjs" + run-glyph-module "./greek/lower-nu.mjs" + run-glyph-module "./greek/lower-xi.mjs" + run-glyph-module "./greek/lower-rho.mjs" + run-glyph-module "./greek/lower-sigma.mjs" + run-glyph-module "./greek/lower-sigma-final.mjs" + run-glyph-module "./greek/lower-tau.mjs" + run-glyph-module "./greek/lower-upsilon.mjs" + run-glyph-module "./greek/lower-phi.mjs" + run-glyph-module "./greek/lower-omega.mjs" - run-glyph-module './greek/sampi.js' - run-glyph-module './greek/qoppa.js' + run-glyph-module "./greek/sampi.mjs" + run-glyph-module "./greek/qoppa.mjs" diff --git a/font-src/glyphs/letter/greek/lower-alpha.ptl b/font-src/glyphs/letter/greek/lower-alpha.ptl index ad2decf54..9af884019 100644 --- a/font-src/glyphs/letter/greek/lower-alpha.ptl +++ b/font-src/glyphs/letter/greek/lower-alpha.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix barmixL linreg clamp fallback] from '../../../support/utils' +import [mix barmixL linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/letter/greek/lower-delta.ptl b/font-src/glyphs/letter/greek/lower-delta.ptl index 2f9a4e1ae..28deaa8be 100644 --- a/font-src/glyphs/letter/greek/lower-delta.ptl +++ b/font-src/glyphs/letter/greek/lower-delta.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix barmixL linreg clamp fallback] from '../../../support/utils' +import [mix barmixL linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/letter/greek/lower-epsilon.ptl b/font-src/glyphs/letter/greek/lower-epsilon.ptl index 2ed60d608..41d2b2129 100644 --- a/font-src/glyphs/letter/greek/lower-epsilon.ptl +++ b/font-src/glyphs/letter/greek/lower-epsilon.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix barmixL linreg clamp fallback] from '../../../support/utils' +import [mix barmixL linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/letter/greek/lower-gamma.ptl b/font-src/glyphs/letter/greek/lower-gamma.ptl index 1a0c69792..bb15af664 100644 --- a/font-src/glyphs/letter/greek/lower-gamma.ptl +++ b/font-src/glyphs/letter/greek/lower-gamma.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix barmixL linreg clamp fallback] from '../../../support/utils' +import [mix barmixL linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/letter/greek/lower-kappa-symbol.ptl b/font-src/glyphs/letter/greek/lower-kappa-symbol.ptl index 61d2976fa..2135f5469 100644 --- a/font-src/glyphs/letter/greek/lower-kappa-symbol.ptl +++ b/font-src/glyphs/letter/greek/lower-kappa-symbol.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix barmixL linreg clamp fallback] from '../../../support/utils' +import [mix barmixL linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/letter/greek/lower-lunate-epsilon.ptl b/font-src/glyphs/letter/greek/lower-lunate-epsilon.ptl index 7ca744fd8..23665b1f1 100644 --- a/font-src/glyphs/letter/greek/lower-lunate-epsilon.ptl +++ b/font-src/glyphs/letter/greek/lower-lunate-epsilon.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix barmixL linreg clamp fallback] from '../../../support/utils' +import [mix barmixL linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/letter/greek/lower-mu.ptl b/font-src/glyphs/letter/greek/lower-mu.ptl index 07cbefedf..da2d3cd81 100644 --- a/font-src/glyphs/letter/greek/lower-mu.ptl +++ b/font-src/glyphs/letter/greek/lower-mu.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix barmixL linreg clamp fallback] from '../../../support/utils' +import [mix barmixL linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/letter/greek/lower-nu.ptl b/font-src/glyphs/letter/greek/lower-nu.ptl index 208893437..f4319cc4d 100644 --- a/font-src/glyphs/letter/greek/lower-nu.ptl +++ b/font-src/glyphs/letter/greek/lower-nu.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix barmixL linreg clamp fallback] from '../../../support/utils' +import [mix barmixL linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/letter/greek/lower-omega.ptl b/font-src/glyphs/letter/greek/lower-omega.ptl index 0da9d83f2..e16c5d0ce 100644 --- a/font-src/glyphs/letter/greek/lower-omega.ptl +++ b/font-src/glyphs/letter/greek/lower-omega.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix barmixL linreg clamp fallback] from '../../../support/utils' +import [mix barmixL linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/letter/greek/lower-phi.ptl b/font-src/glyphs/letter/greek/lower-phi.ptl index 6d971578f..94364e000 100644 --- a/font-src/glyphs/letter/greek/lower-phi.ptl +++ b/font-src/glyphs/letter/greek/lower-phi.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix barmixL linreg clamp fallback] from '../../../support/utils' +import [mix barmixL linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/letter/greek/lower-rho.ptl b/font-src/glyphs/letter/greek/lower-rho.ptl index 4d50c0210..654af32e9 100644 --- a/font-src/glyphs/letter/greek/lower-rho.ptl +++ b/font-src/glyphs/letter/greek/lower-rho.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix barmixL linreg clamp fallback] from '../../../support/utils' -import [DesignParameters] from '../../../meta/aesthetics' +import [mix barmixL linreg clamp fallback] from"../../../support/utils.mjs" +import [DesignParameters] from"../../../meta/aesthetics.mjs" glyph-module diff --git a/font-src/glyphs/letter/greek/lower-sigma-final.ptl b/font-src/glyphs/letter/greek/lower-sigma-final.ptl index 93f2c3efa..9dd6078a2 100644 --- a/font-src/glyphs/letter/greek/lower-sigma-final.ptl +++ b/font-src/glyphs/letter/greek/lower-sigma-final.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix barmixL linreg clamp fallback] from '../../../support/utils' -import [DesignParameters] from '../../../meta/aesthetics' +import [mix barmixL linreg clamp fallback] from"../../../support/utils.mjs" +import [DesignParameters] from"../../../meta/aesthetics.mjs" glyph-module diff --git a/font-src/glyphs/letter/greek/lower-sigma.ptl b/font-src/glyphs/letter/greek/lower-sigma.ptl index 928e474ab..342416e8c 100644 --- a/font-src/glyphs/letter/greek/lower-sigma.ptl +++ b/font-src/glyphs/letter/greek/lower-sigma.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix barmixL linreg clamp fallback] from '../../../support/utils' -import [DesignParameters] from '../../../meta/aesthetics' +import [mix barmixL linreg clamp fallback] from"../../../support/utils.mjs" +import [DesignParameters] from"../../../meta/aesthetics.mjs" glyph-module diff --git a/font-src/glyphs/letter/greek/lower-tau.ptl b/font-src/glyphs/letter/greek/lower-tau.ptl index 5e0beba8f..311afcaac 100644 --- a/font-src/glyphs/letter/greek/lower-tau.ptl +++ b/font-src/glyphs/letter/greek/lower-tau.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/greek/lower-theta.ptl b/font-src/glyphs/letter/greek/lower-theta.ptl index 5802594f5..c70168aa0 100644 --- a/font-src/glyphs/letter/greek/lower-theta.ptl +++ b/font-src/glyphs/letter/greek/lower-theta.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix barmixL linreg clamp fallback] from '../../../support/utils' -import [DesignParameters] from '../../../meta/aesthetics' +import [mix barmixL linreg clamp fallback] from"../../../support/utils.mjs" +import [DesignParameters] from"../../../meta/aesthetics.mjs" glyph-module diff --git a/font-src/glyphs/letter/greek/lower-upsilon.ptl b/font-src/glyphs/letter/greek/lower-upsilon.ptl index 32388ad44..fef34ef33 100644 --- a/font-src/glyphs/letter/greek/lower-upsilon.ptl +++ b/font-src/glyphs/letter/greek/lower-upsilon.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix barmixL linreg clamp fallback] from '../../../support/utils' -import [DesignParameters] from '../../../meta/aesthetics' +import [mix barmixL linreg clamp fallback] from"../../../support/utils.mjs" +import [DesignParameters] from"../../../meta/aesthetics.mjs" glyph-module diff --git a/font-src/glyphs/letter/greek/lower-xi.ptl b/font-src/glyphs/letter/greek/lower-xi.ptl index ddca001e9..b172cac74 100644 --- a/font-src/glyphs/letter/greek/lower-xi.ptl +++ b/font-src/glyphs/letter/greek/lower-xi.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix barmixL linreg clamp fallback] from '../../../support/utils' -import [DesignParameters] from '../../../meta/aesthetics' +import [mix barmixL linreg clamp fallback] from"../../../support/utils.mjs" +import [DesignParameters] from"../../../meta/aesthetics.mjs" glyph-module diff --git a/font-src/glyphs/letter/greek/lower-zeta.ptl b/font-src/glyphs/letter/greek/lower-zeta.ptl index ac9ce982b..7cbbcfcff 100644 --- a/font-src/glyphs/letter/greek/lower-zeta.ptl +++ b/font-src/glyphs/letter/greek/lower-zeta.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix barmixL linreg clamp fallback] from '../../../support/utils' -import [DesignParameters] from '../../../meta/aesthetics' +import [mix barmixL linreg clamp fallback] from"../../../support/utils.mjs" +import [DesignParameters] from"../../../meta/aesthetics.mjs" glyph-module diff --git a/font-src/glyphs/letter/greek/pi.ptl b/font-src/glyphs/letter/greek/pi.ptl index 84b995b8a..2b8da8e27 100644 --- a/font-src/glyphs/letter/greek/pi.ptl +++ b/font-src/glyphs/letter/greek/pi.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix barmixL linreg clamp fallback] from '../../../support/utils' -import [DesignParameters] from '../../../meta/aesthetics' +import [mix barmixL linreg clamp fallback] from"../../../support/utils.mjs" +import [DesignParameters] from"../../../meta/aesthetics.mjs" glyph-module diff --git a/font-src/glyphs/letter/greek/psi.ptl b/font-src/glyphs/letter/greek/psi.ptl index 1b3e81421..d8acc844c 100644 --- a/font-src/glyphs/letter/greek/psi.ptl +++ b/font-src/glyphs/letter/greek/psi.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix barmixL linreg clamp fallback] from '../../../support/utils' -import [DesignParameters] from '../../../meta/aesthetics' +import [mix barmixL linreg clamp fallback] from"../../../support/utils.mjs" +import [DesignParameters] from"../../../meta/aesthetics.mjs" glyph-module diff --git a/font-src/glyphs/letter/greek/qoppa.ptl b/font-src/glyphs/letter/greek/qoppa.ptl index dd2f81c5b..6b7dc82c3 100644 --- a/font-src/glyphs/letter/greek/qoppa.ptl +++ b/font-src/glyphs/letter/greek/qoppa.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix barmixL linreg clamp fallback] from '../../../support/utils' -import [DesignParameters] from '../../../meta/aesthetics' +import [mix barmixL linreg clamp fallback] from"../../../support/utils.mjs" +import [DesignParameters] from"../../../meta/aesthetics.mjs" glyph-module diff --git a/font-src/glyphs/letter/greek/sampi.ptl b/font-src/glyphs/letter/greek/sampi.ptl index 109203e50..3dc5eab43 100644 --- a/font-src/glyphs/letter/greek/sampi.ptl +++ b/font-src/glyphs/letter/greek/sampi.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix barmixL linreg clamp fallback] from '../../../support/utils' -import [DesignParameters] from '../../../meta/aesthetics' +import [mix barmixL linreg clamp fallback] from"../../../support/utils.mjs" +import [DesignParameters] from"../../../meta/aesthetics.mjs" glyph-module diff --git a/font-src/glyphs/letter/greek/upper-gamma.ptl b/font-src/glyphs/letter/greek/upper-gamma.ptl index d14afa20b..c4474533b 100644 --- a/font-src/glyphs/letter/greek/upper-gamma.ptl +++ b/font-src/glyphs/letter/greek/upper-gamma.ptl @@ -1,8 +1,8 @@ $$include '../../../meta/macros.ptl' -import [mix barmixL linreg clamp fallback] from '../../../support/utils' -import [MathSansSerif] from '../../../support/gr' -import [DesignParameters] from '../../../meta/aesthetics' +import [mix barmixL linreg clamp fallback] from"../../../support/utils.mjs" +import [MathSansSerif] from"../../../support/gr.mjs" +import [DesignParameters] from"../../../meta/aesthetics.mjs" glyph-module diff --git a/font-src/glyphs/letter/greek/upper-omega.ptl b/font-src/glyphs/letter/greek/upper-omega.ptl index 0a6adf89e..ddaffa468 100644 --- a/font-src/glyphs/letter/greek/upper-omega.ptl +++ b/font-src/glyphs/letter/greek/upper-omega.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix barmixL linreg clamp fallback] from '../../../support/utils' -import [DesignParameters] from '../../../meta/aesthetics' +import [mix barmixL linreg clamp fallback] from"../../../support/utils.mjs" +import [DesignParameters] from"../../../meta/aesthetics.mjs" glyph-module diff --git a/font-src/glyphs/letter/greek/upper-phi.ptl b/font-src/glyphs/letter/greek/upper-phi.ptl index e81c88fd3..03df54b00 100644 --- a/font-src/glyphs/letter/greek/upper-phi.ptl +++ b/font-src/glyphs/letter/greek/upper-phi.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix barmixL linreg clamp fallback] from '../../../support/utils' -import [DesignParameters] from '../../../meta/aesthetics' +import [mix barmixL linreg clamp fallback] from"../../../support/utils.mjs" +import [DesignParameters] from"../../../meta/aesthetics.mjs" glyph-module diff --git a/font-src/glyphs/letter/greek/upper-sigma.ptl b/font-src/glyphs/letter/greek/upper-sigma.ptl index 86a2eb9e2..b9e7fe34c 100644 --- a/font-src/glyphs/letter/greek/upper-sigma.ptl +++ b/font-src/glyphs/letter/greek/upper-sigma.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix barmixL linreg clamp fallback] from '../../../support/utils' -import [DesignParameters] from '../../../meta/aesthetics' +import [mix barmixL linreg clamp fallback] from"../../../support/utils.mjs" +import [DesignParameters] from"../../../meta/aesthetics.mjs" glyph-module diff --git a/font-src/glyphs/letter/greek/upper-theta.ptl b/font-src/glyphs/letter/greek/upper-theta.ptl index 9433297b1..e841bb49a 100644 --- a/font-src/glyphs/letter/greek/upper-theta.ptl +++ b/font-src/glyphs/letter/greek/upper-theta.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix barmixL linreg clamp fallback] from '../../../support/utils' -import [DesignParameters] from '../../../meta/aesthetics' +import [mix barmixL linreg clamp fallback] from"../../../support/utils.mjs" +import [DesignParameters] from"../../../meta/aesthetics.mjs" glyph-module diff --git a/font-src/glyphs/letter/greek/upper-xi.ptl b/font-src/glyphs/letter/greek/upper-xi.ptl index 35fb6c772..ae887b659 100644 --- a/font-src/glyphs/letter/greek/upper-xi.ptl +++ b/font-src/glyphs/letter/greek/upper-xi.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix barmixL linreg clamp fallback] from '../../../support/utils' -import [DesignParameters] from '../../../meta/aesthetics' +import [mix barmixL linreg clamp fallback] from"../../../support/utils.mjs" +import [DesignParameters] from"../../../meta/aesthetics.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin-ext/bidental-percussive.ptl b/font-src/glyphs/letter/latin-ext/bidental-percussive.ptl index e11657df7..cb096be5b 100644 --- a/font-src/glyphs/letter/latin-ext/bidental-percussive.ptl +++ b/font-src/glyphs/letter/latin-ext/bidental-percussive.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin-ext/egyptological.ptl b/font-src/glyphs/letter/latin-ext/egyptological.ptl index ad9bd3a70..aad830cf2 100644 --- a/font-src/glyphs/letter/latin-ext/egyptological.ptl +++ b/font-src/glyphs/letter/latin-ext/egyptological.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin-ext/eszet.ptl b/font-src/glyphs/letter/latin-ext/eszet.ptl index 1e6f4dc01..e60dfa727 100644 --- a/font-src/glyphs/letter/latin-ext/eszet.ptl +++ b/font-src/glyphs/letter/latin-ext/eszet.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin-ext/eth.ptl b/font-src/glyphs/letter/latin-ext/eth.ptl index da6759106..66dce7f04 100644 --- a/font-src/glyphs/letter/latin-ext/eth.ptl +++ b/font-src/glyphs/letter/latin-ext/eth.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin-ext/ezh.ptl b/font-src/glyphs/letter/latin-ext/ezh.ptl index 6070ac6c3..aff61cee8 100644 --- a/font-src/glyphs/letter/latin-ext/ezh.ptl +++ b/font-src/glyphs/letter/latin-ext/ezh.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin-ext/f-ligatures.ptl b/font-src/glyphs/letter/latin-ext/f-ligatures.ptl index 84795022b..4e777a970 100644 --- a/font-src/glyphs/letter/latin-ext/f-ligatures.ptl +++ b/font-src/glyphs/letter/latin-ext/f-ligatures.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin-ext/gha.ptl b/font-src/glyphs/letter/latin-ext/gha.ptl index f97cd7444..3e93c31e4 100644 --- a/font-src/glyphs/letter/latin-ext/gha.ptl +++ b/font-src/glyphs/letter/latin-ext/gha.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin-ext/glottal-stop.ptl b/font-src/glyphs/letter/latin-ext/glottal-stop.ptl index fc5c0983b..bb0f7b4d9 100644 --- a/font-src/glyphs/letter/latin-ext/glottal-stop.ptl +++ b/font-src/glyphs/letter/latin-ext/glottal-stop.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin-ext/hwair.ptl b/font-src/glyphs/letter/latin-ext/hwair.ptl index 466d5393b..0e1a0e1ea 100644 --- a/font-src/glyphs/letter/latin-ext/hwair.ptl +++ b/font-src/glyphs/letter/latin-ext/hwair.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin-ext/long-s.ptl b/font-src/glyphs/letter/latin-ext/long-s.ptl index 0f570f500..869e1b517 100644 --- a/font-src/glyphs/letter/latin-ext/long-s.ptl +++ b/font-src/glyphs/letter/latin-ext/long-s.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin-ext/lower-ae-oe.ptl b/font-src/glyphs/letter/latin-ext/lower-ae-oe.ptl index 92a3052b7..8c06bc663 100644 --- a/font-src/glyphs/letter/latin-ext/lower-ae-oe.ptl +++ b/font-src/glyphs/letter/latin-ext/lower-ae-oe.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose RequireCcmpDecompose] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose RequireCcmpDecompose] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin-ext/ou.ptl b/font-src/glyphs/letter/latin-ext/ou.ptl index 22d169d0e..fabb80b89 100644 --- a/font-src/glyphs/letter/latin-ext/ou.ptl +++ b/font-src/glyphs/letter/latin-ext/ou.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin-ext/rams-horn.ptl b/font-src/glyphs/letter/latin-ext/rams-horn.ptl index 2cacdf6c2..6c74c6bfa 100644 --- a/font-src/glyphs/letter/latin-ext/rams-horn.ptl +++ b/font-src/glyphs/letter/latin-ext/rams-horn.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin-ext/rhotic.ptl b/font-src/glyphs/letter/latin-ext/rhotic.ptl index 7761e1d49..682eaaac4 100644 --- a/font-src/glyphs/letter/latin-ext/rhotic.ptl +++ b/font-src/glyphs/letter/latin-ext/rhotic.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin-ext/thorn.ptl b/font-src/glyphs/letter/latin-ext/thorn.ptl index 77e331b75..0a471f364 100644 --- a/font-src/glyphs/letter/latin-ext/thorn.ptl +++ b/font-src/glyphs/letter/latin-ext/thorn.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin-ext/upper-ae-oe.ptl b/font-src/glyphs/letter/latin-ext/upper-ae-oe.ptl index c8374bda0..6e7933f7c 100644 --- a/font-src/glyphs/letter/latin-ext/upper-ae-oe.ptl +++ b/font-src/glyphs/letter/latin-ext/upper-ae-oe.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose RequireCcmpDecompose] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose RequireCcmpDecompose] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin-ext/wynn.ptl b/font-src/glyphs/letter/latin-ext/wynn.ptl index 94def60de..aca12e3e0 100644 --- a/font-src/glyphs/letter/latin-ext/wynn.ptl +++ b/font-src/glyphs/letter/latin-ext/wynn.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin-ext/yogh.ptl b/font-src/glyphs/letter/latin-ext/yogh.ptl index edeae1557..5cb65aa0d 100644 --- a/font-src/glyphs/letter/latin-ext/yogh.ptl +++ b/font-src/glyphs/letter/latin-ext/yogh.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin.ptl b/font-src/glyphs/letter/latin.ptl index f7297b053..d451533db 100644 --- a/font-src/glyphs/letter/latin.ptl +++ b/font-src/glyphs/letter/latin.ptl @@ -2,67 +2,67 @@ $$include '../../meta/macros.ptl' export : define [apply] : begin define $$Capture$$ this - run-glyph-module './latin/upper-a.js' - run-glyph-module './latin/lower-a.js' - run-glyph-module './latin/upper-b.js' - run-glyph-module './latin/lower-b.js' - run-glyph-module './latin/c.js' - run-glyph-module './latin/upper-d.js' - run-glyph-module './latin/lower-d.js' - run-glyph-module './latin/upper-e.js' - run-glyph-module './latin/lower-e.js' - run-glyph-module './latin/upper-f.js' - run-glyph-module './latin/lower-f.js' - run-glyph-module './latin/upper-g.js' - run-glyph-module './latin/lower-g.js' - run-glyph-module './latin/upper-h.js' - run-glyph-module './latin/lower-h.js' - run-glyph-module './latin/upper-i.js' - run-glyph-module './latin/lower-il.js' - run-glyph-module './latin/upper-j.js' - run-glyph-module './latin/lower-j.js' - run-glyph-module './latin/k.js' - run-glyph-module './latin/upper-l.js' - # run-glyph-module './latin/lower-l.js' - run-glyph-module './latin/upper-m.js' - run-glyph-module './latin/lower-m.js' - run-glyph-module './latin/upper-n.js' - run-glyph-module './latin/lower-n.js' - run-glyph-module './latin/o.js' - run-glyph-module './latin/upper-p.js' - run-glyph-module './latin/lower-p.js' - run-glyph-module './latin/upper-q.js' - run-glyph-module './latin/lower-q.js' - run-glyph-module './latin/upper-r.js' - run-glyph-module './latin/lower-r.js' - run-glyph-module './latin/s.js' - run-glyph-module './latin/upper-t.js' - run-glyph-module './latin/lower-t.js' - run-glyph-module './latin/u.js' - run-glyph-module './latin/v.js' - run-glyph-module './latin/w.js' - run-glyph-module './latin/x.js' - run-glyph-module './latin/upper-y.js' - run-glyph-module './latin/lower-y.js' - run-glyph-module './latin/z.js' + run-glyph-module "./latin/upper-a.mjs" + run-glyph-module "./latin/lower-a.mjs" + run-glyph-module "./latin/upper-b.mjs" + run-glyph-module "./latin/lower-b.mjs" + run-glyph-module "./latin/c.mjs" + run-glyph-module "./latin/upper-d.mjs" + run-glyph-module "./latin/lower-d.mjs" + run-glyph-module "./latin/upper-e.mjs" + run-glyph-module "./latin/lower-e.mjs" + run-glyph-module "./latin/upper-f.mjs" + run-glyph-module "./latin/lower-f.mjs" + run-glyph-module "./latin/upper-g.mjs" + run-glyph-module "./latin/lower-g.mjs" + run-glyph-module "./latin/upper-h.mjs" + run-glyph-module "./latin/lower-h.mjs" + run-glyph-module "./latin/upper-i.mjs" + run-glyph-module "./latin/lower-il.mjs" + run-glyph-module "./latin/upper-j.mjs" + run-glyph-module "./latin/lower-j.mjs" + run-glyph-module "./latin/k.mjs" + run-glyph-module "./latin/upper-l.mjs" + # run-glyph-module "./latin/lower-l.mjs" + run-glyph-module "./latin/upper-m.mjs" + run-glyph-module "./latin/lower-m.mjs" + run-glyph-module "./latin/upper-n.mjs" + run-glyph-module "./latin/lower-n.mjs" + run-glyph-module "./latin/o.mjs" + run-glyph-module "./latin/upper-p.mjs" + run-glyph-module "./latin/lower-p.mjs" + run-glyph-module "./latin/upper-q.mjs" + run-glyph-module "./latin/lower-q.mjs" + run-glyph-module "./latin/upper-r.mjs" + run-glyph-module "./latin/lower-r.mjs" + run-glyph-module "./latin/s.mjs" + run-glyph-module "./latin/upper-t.mjs" + run-glyph-module "./latin/lower-t.mjs" + run-glyph-module "./latin/u.mjs" + run-glyph-module "./latin/v.mjs" + run-glyph-module "./latin/w.mjs" + run-glyph-module "./latin/x.mjs" + run-glyph-module "./latin/upper-y.mjs" + run-glyph-module "./latin/lower-y.mjs" + run-glyph-module "./latin/z.mjs" - run-glyph-module './latin-ext/bidental-percussive.js' - run-glyph-module './latin-ext/egyptological.js' - run-glyph-module './latin-ext/eszet.js' - run-glyph-module './latin-ext/eth.js' - run-glyph-module './latin-ext/ezh.js' - run-glyph-module './latin-ext/gha.js' - run-glyph-module './latin-ext/f-ligatures.js' - run-glyph-module './latin-ext/glottal-stop.js' - run-glyph-module './latin-ext/hwair.js' - run-glyph-module './latin-ext/long-s.js' - run-glyph-module './latin-ext/lower-ae-oe.js' - run-glyph-module './latin-ext/ou.js' - run-glyph-module './latin-ext/rams-horn.js' - run-glyph-module './latin-ext/rhotic.js' - run-glyph-module './latin-ext/thorn.js' - run-glyph-module './latin-ext/upper-ae-oe.js' - run-glyph-module './latin-ext/wynn.js' - run-glyph-module './latin-ext/yogh.js' + run-glyph-module "./latin-ext/bidental-percussive.mjs" + run-glyph-module "./latin-ext/egyptological.mjs" + run-glyph-module "./latin-ext/eszet.mjs" + run-glyph-module "./latin-ext/eth.mjs" + run-glyph-module "./latin-ext/ezh.mjs" + run-glyph-module "./latin-ext/gha.mjs" + run-glyph-module "./latin-ext/f-ligatures.mjs" + run-glyph-module "./latin-ext/glottal-stop.mjs" + run-glyph-module "./latin-ext/hwair.mjs" + run-glyph-module "./latin-ext/long-s.mjs" + run-glyph-module "./latin-ext/lower-ae-oe.mjs" + run-glyph-module "./latin-ext/ou.mjs" + run-glyph-module "./latin-ext/rams-horn.mjs" + run-glyph-module "./latin-ext/rhotic.mjs" + run-glyph-module "./latin-ext/thorn.mjs" + run-glyph-module "./latin-ext/upper-ae-oe.mjs" + run-glyph-module "./latin-ext/wynn.mjs" + run-glyph-module "./latin-ext/yogh.mjs" - run-glyph-module './latin-ext/orthography.js' + run-glyph-module "./latin-ext/orthography.mjs" diff --git a/font-src/glyphs/letter/latin/c.ptl b/font-src/glyphs/letter/latin/c.ptl index 0ba9fb169..f7f646822 100644 --- a/font-src/glyphs/letter/latin/c.ptl +++ b/font-src/glyphs/letter/latin/c.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose MathSansSerif] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin/k.ptl b/font-src/glyphs/letter/latin/k.ptl index 1c1dc27f2..67ed87bef 100644 --- a/font-src/glyphs/letter/latin/k.ptl +++ b/font-src/glyphs/letter/latin/k.ptl @@ -1,8 +1,8 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose MathSansSerif] from "../../../support/gr" -import [maskBit maskBits popCountByte] from '../../../support/util/mask-bit' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs" +import [maskBit maskBits popCountByte] from"../../../support/util/mask-bit.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin/lower-a.ptl b/font-src/glyphs/letter/latin/lower-a.ptl index 4121c6e71..6626e2ecc 100644 --- a/font-src/glyphs/letter/latin/lower-a.ptl +++ b/font-src/glyphs/letter/latin/lower-a.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose MathSansSerif] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin/lower-b.ptl b/font-src/glyphs/letter/latin/lower-b.ptl index 56fb35929..49fc3fcc1 100644 --- a/font-src/glyphs/letter/latin/lower-b.ptl +++ b/font-src/glyphs/letter/latin/lower-b.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose MathSansSerif] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin/lower-d.ptl b/font-src/glyphs/letter/latin/lower-d.ptl index cdf586813..34d0dc6c1 100644 --- a/font-src/glyphs/letter/latin/lower-d.ptl +++ b/font-src/glyphs/letter/latin/lower-d.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose MathSansSerif] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin/lower-e.ptl b/font-src/glyphs/letter/latin/lower-e.ptl index c62fcf0f7..74f04c0aa 100644 --- a/font-src/glyphs/letter/latin/lower-e.ptl +++ b/font-src/glyphs/letter/latin/lower-e.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin/lower-f.ptl b/font-src/glyphs/letter/latin/lower-f.ptl index 1b93c09ae..227ff0601 100644 --- a/font-src/glyphs/letter/latin/lower-f.ptl +++ b/font-src/glyphs/letter/latin/lower-f.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose MathSansSerif] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin/lower-g.ptl b/font-src/glyphs/letter/latin/lower-g.ptl index ded5b74d3..8ca979c8f 100644 --- a/font-src/glyphs/letter/latin/lower-g.ptl +++ b/font-src/glyphs/letter/latin/lower-g.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose MathSansSerif] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin/lower-h.ptl b/font-src/glyphs/letter/latin/lower-h.ptl index 51bfd1a27..f3ba1e410 100644 --- a/font-src/glyphs/letter/latin/lower-h.ptl +++ b/font-src/glyphs/letter/latin/lower-h.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose MathSansSerif] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin/lower-il.ptl b/font-src/glyphs/letter/latin/lower-il.ptl index 285aaf6f3..725b2e818 100644 --- a/font-src/glyphs/letter/latin/lower-il.ptl +++ b/font-src/glyphs/letter/latin/lower-il.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose MathSansSerif] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin/lower-j.ptl b/font-src/glyphs/letter/latin/lower-j.ptl index c56d92519..7f9c40e5a 100644 --- a/font-src/glyphs/letter/latin/lower-j.ptl +++ b/font-src/glyphs/letter/latin/lower-j.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose MathSansSerif] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin/lower-m.ptl b/font-src/glyphs/letter/latin/lower-m.ptl index b52339610..a19ccf172 100644 --- a/font-src/glyphs/letter/latin/lower-m.ptl +++ b/font-src/glyphs/letter/latin/lower-m.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose MathSansSerif] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin/lower-n.ptl b/font-src/glyphs/letter/latin/lower-n.ptl index e85841b82..7860b0743 100644 --- a/font-src/glyphs/letter/latin/lower-n.ptl +++ b/font-src/glyphs/letter/latin/lower-n.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose MathSansSerif Joining] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose MathSansSerif Joining] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin/lower-p.ptl b/font-src/glyphs/letter/latin/lower-p.ptl index 87df4de12..301772af9 100644 --- a/font-src/glyphs/letter/latin/lower-p.ptl +++ b/font-src/glyphs/letter/latin/lower-p.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose MathSansSerif] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin/lower-q.ptl b/font-src/glyphs/letter/latin/lower-q.ptl index 4786dfeb5..29e238b4b 100644 --- a/font-src/glyphs/letter/latin/lower-q.ptl +++ b/font-src/glyphs/letter/latin/lower-q.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose MathSansSerif] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin/lower-r.ptl b/font-src/glyphs/letter/latin/lower-r.ptl index 8fec32375..ce8fb8227 100644 --- a/font-src/glyphs/letter/latin/lower-r.ptl +++ b/font-src/glyphs/letter/latin/lower-r.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose MathSansSerif] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin/lower-t.ptl b/font-src/glyphs/letter/latin/lower-t.ptl index 4eadbc826..53c2a3cd0 100644 --- a/font-src/glyphs/letter/latin/lower-t.ptl +++ b/font-src/glyphs/letter/latin/lower-t.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin/lower-y.ptl b/font-src/glyphs/letter/latin/lower-y.ptl index 98fd97197..966625dc0 100644 --- a/font-src/glyphs/letter/latin/lower-y.ptl +++ b/font-src/glyphs/letter/latin/lower-y.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [LowerYDotAtBelow Dotless CvDecompose MathSansSerif] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [LowerYDotAtBelow Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin/o.ptl b/font-src/glyphs/letter/latin/o.ptl index 3a13599ba..eb68c9250 100644 --- a/font-src/glyphs/letter/latin/o.ptl +++ b/font-src/glyphs/letter/latin/o.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin/s.ptl b/font-src/glyphs/letter/latin/s.ptl index 42ec38f2f..36629bc13 100644 --- a/font-src/glyphs/letter/latin/s.ptl +++ b/font-src/glyphs/letter/latin/s.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [RightDependentLink RightDependentTrigger CvDecompose MathSansSerif] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [RightDependentLink RightDependentTrigger CvDecompose MathSansSerif] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin/u.ptl b/font-src/glyphs/letter/latin/u.ptl index b34ab4bd9..69519612a 100644 --- a/font-src/glyphs/letter/latin/u.ptl +++ b/font-src/glyphs/letter/latin/u.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose MathSansSerif] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin/upper-a.ptl b/font-src/glyphs/letter/latin/upper-a.ptl index a6964b556..af2317cda 100644 --- a/font-src/glyphs/letter/latin/upper-a.ptl +++ b/font-src/glyphs/letter/latin/upper-a.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose MathSansSerif] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin/upper-b.ptl b/font-src/glyphs/letter/latin/upper-b.ptl index a2b11410d..df08e74b0 100644 --- a/font-src/glyphs/letter/latin/upper-b.ptl +++ b/font-src/glyphs/letter/latin/upper-b.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose MathSansSerif] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin/upper-d.ptl b/font-src/glyphs/letter/latin/upper-d.ptl index 5a38550ce..0661df47a 100644 --- a/font-src/glyphs/letter/latin/upper-d.ptl +++ b/font-src/glyphs/letter/latin/upper-d.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose MathSansSerif] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin/upper-e.ptl b/font-src/glyphs/letter/latin/upper-e.ptl index e2a62a7d7..d0e44c90b 100644 --- a/font-src/glyphs/letter/latin/upper-e.ptl +++ b/font-src/glyphs/letter/latin/upper-e.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose MathSansSerif] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin/upper-f.ptl b/font-src/glyphs/letter/latin/upper-f.ptl index 6b2474ee9..45eab2294 100644 --- a/font-src/glyphs/letter/latin/upper-f.ptl +++ b/font-src/glyphs/letter/latin/upper-f.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose MathSansSerif] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin/upper-g.ptl b/font-src/glyphs/letter/latin/upper-g.ptl index 57eb11a16..3ac4422c1 100644 --- a/font-src/glyphs/letter/latin/upper-g.ptl +++ b/font-src/glyphs/letter/latin/upper-g.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose MathSansSerif] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin/upper-h.ptl b/font-src/glyphs/letter/latin/upper-h.ptl index 334eee9e2..2fbda17ac 100644 --- a/font-src/glyphs/letter/latin/upper-h.ptl +++ b/font-src/glyphs/letter/latin/upper-h.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose MathSansSerif] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin/upper-i.ptl b/font-src/glyphs/letter/latin/upper-i.ptl index 6127c3e1c..9f31cd871 100644 --- a/font-src/glyphs/letter/latin/upper-i.ptl +++ b/font-src/glyphs/letter/latin/upper-i.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose MathSansSerif] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin/upper-j.ptl b/font-src/glyphs/letter/latin/upper-j.ptl index 93e027a53..daead4614 100644 --- a/font-src/glyphs/letter/latin/upper-j.ptl +++ b/font-src/glyphs/letter/latin/upper-j.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose MathSansSerif] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin/upper-l.ptl b/font-src/glyphs/letter/latin/upper-l.ptl index 4485f91e6..db2c0a902 100644 --- a/font-src/glyphs/letter/latin/upper-l.ptl +++ b/font-src/glyphs/letter/latin/upper-l.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose MathSansSerif] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin/upper-m.ptl b/font-src/glyphs/letter/latin/upper-m.ptl index 9e8892467..ed05a5333 100644 --- a/font-src/glyphs/letter/latin/upper-m.ptl +++ b/font-src/glyphs/letter/latin/upper-m.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose MathSansSerif] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin/upper-n.ptl b/font-src/glyphs/letter/latin/upper-n.ptl index 4550899a8..6d9df2213 100644 --- a/font-src/glyphs/letter/latin/upper-n.ptl +++ b/font-src/glyphs/letter/latin/upper-n.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose MathSansSerif] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin/upper-p.ptl b/font-src/glyphs/letter/latin/upper-p.ptl index d92fb2be8..fae3184fa 100644 --- a/font-src/glyphs/letter/latin/upper-p.ptl +++ b/font-src/glyphs/letter/latin/upper-p.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose MathSansSerif] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin/upper-q.ptl b/font-src/glyphs/letter/latin/upper-q.ptl index b119fc6ba..ffa5db0b9 100644 --- a/font-src/glyphs/letter/latin/upper-q.ptl +++ b/font-src/glyphs/letter/latin/upper-q.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin/upper-r.ptl b/font-src/glyphs/letter/latin/upper-r.ptl index d879804cb..4e8355c83 100644 --- a/font-src/glyphs/letter/latin/upper-r.ptl +++ b/font-src/glyphs/letter/latin/upper-r.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose MathSansSerif] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin/upper-t.ptl b/font-src/glyphs/letter/latin/upper-t.ptl index fb3ac9e64..6189d55e7 100644 --- a/font-src/glyphs/letter/latin/upper-t.ptl +++ b/font-src/glyphs/letter/latin/upper-t.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose MathSansSerif] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin/upper-y.ptl b/font-src/glyphs/letter/latin/upper-y.ptl index 279bbef19..7896cda78 100644 --- a/font-src/glyphs/letter/latin/upper-y.ptl +++ b/font-src/glyphs/letter/latin/upper-y.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose MathSansSerif] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin/v.ptl b/font-src/glyphs/letter/latin/v.ptl index 6d5a9459d..2d9fe67ad 100644 --- a/font-src/glyphs/letter/latin/v.ptl +++ b/font-src/glyphs/letter/latin/v.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose MathSansSerif] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin/w.ptl b/font-src/glyphs/letter/latin/w.ptl index 7561ccbd2..a689c7bfe 100644 --- a/font-src/glyphs/letter/latin/w.ptl +++ b/font-src/glyphs/letter/latin/w.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose MathSansSerif] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin/x.ptl b/font-src/glyphs/letter/latin/x.ptl index 846af1fcf..83992ae52 100644 --- a/font-src/glyphs/letter/latin/x.ptl +++ b/font-src/glyphs/letter/latin/x.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Dotless CvDecompose MathSansSerif] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Dotless CvDecompose MathSansSerif] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/latin/z.ptl b/font-src/glyphs/letter/latin/z.ptl index e0e5be5a5..233850ac8 100644 --- a/font-src/glyphs/letter/latin/z.ptl +++ b/font-src/glyphs/letter/latin/z.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [CvDecompose MathSansSerif] from "../../../support/gr" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [CvDecompose MathSansSerif] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/letter/shared.ptl b/font-src/glyphs/letter/shared.ptl index bbc9bbcea..95a3754c1 100644 --- a/font-src/glyphs/letter/shared.ptl +++ b/font-src/glyphs/letter/shared.ptl @@ -1,8 +1,8 @@ $$include '../../meta/macros.ptl' -import [mix clamp fallback] from '../../support/utils' -import [Dotless CvDecompose RightDependentTrigger RightDependentLink] from "../../support/gr" -import [DesignParameters] from "../../meta/aesthetics" +import [mix clamp fallback] from"../../support/utils.mjs" +import [Dotless CvDecompose RightDependentTrigger RightDependentLink] from"../../support/gr.mjs" +import [DesignParameters] from"../../meta/aesthetics.mjs" glyph-module diff --git a/font-src/glyphs/marks/above.ptl b/font-src/glyphs/marks/above.ptl index 18fa163bf..71248271c 100644 --- a/font-src/glyphs/marks/above.ptl +++ b/font-src/glyphs/marks/above.ptl @@ -1,12 +1,12 @@ $$include '../../meta/macros.ptl' import [Arcs Quadify ShapeConv] from "typo-geom" -import [OffsetCurve BezToContoursSink GEOMETRY_PRECISION] from '../../support/geometry/curve-util' -import [mix linreg clamp fallback] from '../../support/utils' -import [DesignParameters] from '../../meta/aesthetics' -import [TieMark TieGlyph] from "../../support/gr" -import [Box] from '../../support/geometry/box' -import [Point] from '../../support/geometry/point' +import [OffsetCurve BezToContoursSink GEOMETRY_PRECISION] from"../../support/geometry/curve-util.mjs" +import [mix linreg clamp fallback] from"../../support/utils.mjs" +import [DesignParameters] from"../../meta/aesthetics.mjs" +import [TieMark TieGlyph] from"../../support/gr.mjs" +import [Box] from"../../support/geometry/box.mjs" +import [Point] from"../../support/geometry/point.mjs" glyph-module diff --git a/font-src/glyphs/marks/below.ptl b/font-src/glyphs/marks/below.ptl index 19827ac67..b8586c3b3 100644 --- a/font-src/glyphs/marks/below.ptl +++ b/font-src/glyphs/marks/below.ptl @@ -1,11 +1,11 @@ $$include '../../meta/macros.ptl' import [Arcs Quadify ShapeConv] from "typo-geom" -import [OffsetCurve BezToContoursSink GEOMETRY_PRECISION] from '../../support/geometry/curve-util' -import [mix linreg clamp fallback] from '../../support/utils' -import [DesignParameters] from '../../meta/aesthetics' -import [TieMark TieGlyph] from "../../support/gr" -import [Box] from '../../support/geometry/box' +import [OffsetCurve BezToContoursSink GEOMETRY_PRECISION] from"../../support/geometry/curve-util.mjs" +import [mix linreg clamp fallback] from"../../support/utils.mjs" +import [DesignParameters] from"../../meta/aesthetics.mjs" +import [TieMark TieGlyph] from"../../support/gr.mjs" +import [Box] from"../../support/geometry/box.mjs" glyph-module diff --git a/font-src/glyphs/marks/composite.ptl b/font-src/glyphs/marks/composite.ptl index ec5a30c10..6877e6e1c 100644 --- a/font-src/glyphs/marks/composite.ptl +++ b/font-src/glyphs/marks/composite.ptl @@ -1,11 +1,11 @@ $$include '../../meta/macros.ptl' import [Arcs Quadify ShapeConv] from "typo-geom" -import [OffsetCurve BezToContoursSink GEOMETRY_PRECISION] from '../../support/geometry/curve-util' -import [mix linreg clamp fallback] from '../../support/utils' -import [DesignParameters] from '../../meta/aesthetics' -import [TieMark TieGlyph] from "../../support/gr" -import [Box] from '../../support/geometry/box' +import [OffsetCurve BezToContoursSink GEOMETRY_PRECISION] from"../../support/geometry/curve-util.mjs" +import [mix linreg clamp fallback] from"../../support/utils.mjs" +import [DesignParameters] from"../../meta/aesthetics.mjs" +import [TieMark TieGlyph] from"../../support/gr.mjs" +import [Box] from"../../support/geometry/box.mjs" glyph-module diff --git a/font-src/glyphs/marks/doppelganger.ptl b/font-src/glyphs/marks/doppelganger.ptl index c48c15f78..8bf22ee22 100644 --- a/font-src/glyphs/marks/doppelganger.ptl +++ b/font-src/glyphs/marks/doppelganger.ptl @@ -1,11 +1,11 @@ $$include '../../meta/macros.ptl' import [Arcs Quadify ShapeConv] from "typo-geom" -import [OffsetCurve BezToContoursSink GEOMETRY_PRECISION] from '../../support/geometry/curve-util' -import [mix linreg clamp fallback] from '../../support/utils' -import [DesignParameters] from '../../meta/aesthetics' -import [TieMark TieGlyph] from "../../support/gr" -import [Box] from '../../support/geometry/box' +import [OffsetCurve BezToContoursSink GEOMETRY_PRECISION] from"../../support/geometry/curve-util.mjs" +import [mix linreg clamp fallback] from"../../support/utils.mjs" +import [DesignParameters] from"../../meta/aesthetics.mjs" +import [TieMark TieGlyph] from"../../support/gr.mjs" +import [Box] from"../../support/geometry/box.mjs" glyph-module diff --git a/font-src/glyphs/marks/horn-and-angle.ptl b/font-src/glyphs/marks/horn-and-angle.ptl index 1be176740..22719652f 100644 --- a/font-src/glyphs/marks/horn-and-angle.ptl +++ b/font-src/glyphs/marks/horn-and-angle.ptl @@ -1,11 +1,11 @@ $$include '../../meta/macros.ptl' import [Arcs Quadify ShapeConv] from "typo-geom" -import [OffsetCurve BezToContoursSink GEOMETRY_PRECISION] from '../../support/geometry/curve-util' -import [mix linreg clamp fallback] from '../../support/utils' -import [DesignParameters] from '../../meta/aesthetics' -import [TieMark TieGlyph] from "../../support/gr" -import [Box] from '../../support/geometry/box' +import [OffsetCurve BezToContoursSink GEOMETRY_PRECISION] from"../../support/geometry/curve-util.mjs" +import [mix linreg clamp fallback] from"../../support/utils.mjs" +import [DesignParameters] from"../../meta/aesthetics.mjs" +import [TieMark TieGlyph] from"../../support/gr.mjs" +import [Box] from"../../support/geometry/box.mjs" glyph-module diff --git a/font-src/glyphs/marks/index.ptl b/font-src/glyphs/marks/index.ptl index 4365a151b..0b4c51330 100644 --- a/font-src/glyphs/marks/index.ptl +++ b/font-src/glyphs/marks/index.ptl @@ -4,11 +4,11 @@ glyph-module export : define [apply] : begin define $$Capture$$ this - run-glyph-module './shared-metrics.js' - run-glyph-module './above.js' - run-glyph-module './below.js' - run-glyph-module './horn-and-angle.js' - run-glyph-module './overlay.js' - run-glyph-module './tie.js' - run-glyph-module './composite.js' - run-glyph-module './doppelganger.js' + run-glyph-module "./shared-metrics.mjs" + run-glyph-module "./above.mjs" + run-glyph-module "./below.mjs" + run-glyph-module "./horn-and-angle.mjs" + run-glyph-module "./overlay.mjs" + run-glyph-module "./tie.mjs" + run-glyph-module "./composite.mjs" + run-glyph-module "./doppelganger.mjs" diff --git a/font-src/glyphs/marks/overlay.ptl b/font-src/glyphs/marks/overlay.ptl index 843c6d746..6e1fc0fdb 100644 --- a/font-src/glyphs/marks/overlay.ptl +++ b/font-src/glyphs/marks/overlay.ptl @@ -1,11 +1,11 @@ $$include '../../meta/macros.ptl' import [Arcs Quadify ShapeConv] from "typo-geom" -import [OffsetCurve BezToContoursSink GEOMETRY_PRECISION] from '../../support/geometry/curve-util' -import [mix linreg clamp fallback] from '../../support/utils' -import [DesignParameters] from '../../meta/aesthetics' -import [TieMark TieGlyph] from "../../support/gr" -import [Box] from '../../support/geometry/box' +import [OffsetCurve BezToContoursSink GEOMETRY_PRECISION] from"../../support/geometry/curve-util.mjs" +import [mix linreg clamp fallback] from"../../support/utils.mjs" +import [DesignParameters] from"../../meta/aesthetics.mjs" +import [TieMark TieGlyph] from"../../support/gr.mjs" +import [Box] from"../../support/geometry/box.mjs" glyph-module diff --git a/font-src/glyphs/marks/shared-metrics.ptl b/font-src/glyphs/marks/shared-metrics.ptl index a12dbf192..a071f485a 100644 --- a/font-src/glyphs/marks/shared-metrics.ptl +++ b/font-src/glyphs/marks/shared-metrics.ptl @@ -1,11 +1,11 @@ $$include '../../meta/macros.ptl' import [Arcs Quadify ShapeConv] from "typo-geom" -import [OffsetCurve BezToContoursSink GEOMETRY_PRECISION] from '../../support/geometry/curve-util' -import [mix linreg clamp fallback] from '../../support/utils' -import [DesignParameters] from '../../meta/aesthetics' -import [TieMark TieGlyph] from "../../support/gr" -import [Box] from '../../support/geometry/box' +import [OffsetCurve BezToContoursSink GEOMETRY_PRECISION] from"../../support/geometry/curve-util.mjs" +import [mix linreg clamp fallback] from"../../support/utils.mjs" +import [DesignParameters] from"../../meta/aesthetics.mjs" +import [TieMark TieGlyph] from"../../support/gr.mjs" +import [Box] from"../../support/geometry/box.mjs" glyph-module diff --git a/font-src/glyphs/marks/tie.ptl b/font-src/glyphs/marks/tie.ptl index 442482c6b..f0857bbf4 100644 --- a/font-src/glyphs/marks/tie.ptl +++ b/font-src/glyphs/marks/tie.ptl @@ -1,11 +1,11 @@ $$include '../../meta/macros.ptl' import [Arcs Quadify ShapeConv] from "typo-geom" -import [OffsetCurve BezToContoursSink GEOMETRY_PRECISION] from '../../support/geometry/curve-util' -import [mix linreg clamp fallback] from '../../support/utils' -import [DesignParameters] from '../../meta/aesthetics' -import [TieMark TieGlyph] from "../../support/gr" -import [Box] from '../../support/geometry/box' +import [OffsetCurve BezToContoursSink GEOMETRY_PRECISION] from"../../support/geometry/curve-util.mjs" +import [mix linreg clamp fallback] from"../../support/utils.mjs" +import [DesignParameters] from"../../meta/aesthetics.mjs" +import [TieMark TieGlyph] from"../../support/gr.mjs" +import [Box] from"../../support/geometry/box.mjs" glyph-module diff --git a/font-src/glyphs/number/0.ptl b/font-src/glyphs/number/0.ptl index 96e31c81a..522116b8b 100644 --- a/font-src/glyphs/number/0.ptl +++ b/font-src/glyphs/number/0.ptl @@ -1,7 +1,7 @@ $$include '../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../support/utils' -import [AnyCv getGrMesh] from "../../support/gr" +import [mix linreg clamp fallback] from"../../support/utils.mjs" +import [AnyCv getGrMesh] from"../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/number/1.ptl b/font-src/glyphs/number/1.ptl index 63d66196f..5b5eda238 100644 --- a/font-src/glyphs/number/1.ptl +++ b/font-src/glyphs/number/1.ptl @@ -1,7 +1,7 @@ $$include '../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../support/utils' -import [AnyCv getGrMesh] from "../../support/gr" +import [mix linreg clamp fallback] from"../../support/utils.mjs" +import [AnyCv getGrMesh] from"../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/number/2.ptl b/font-src/glyphs/number/2.ptl index 57af992e2..2680062f6 100644 --- a/font-src/glyphs/number/2.ptl +++ b/font-src/glyphs/number/2.ptl @@ -1,7 +1,7 @@ $$include '../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../support/utils' -import [AnyCv getGrMesh] from "../../support/gr" +import [mix linreg clamp fallback] from"../../support/utils.mjs" +import [AnyCv getGrMesh] from"../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/number/3.ptl b/font-src/glyphs/number/3.ptl index 8792e5923..4d79d611d 100644 --- a/font-src/glyphs/number/3.ptl +++ b/font-src/glyphs/number/3.ptl @@ -1,7 +1,7 @@ $$include '../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../support/utils' -import [AnyCv getGrMesh] from "../../support/gr" +import [mix linreg clamp fallback] from"../../support/utils.mjs" +import [AnyCv getGrMesh] from"../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/number/4.ptl b/font-src/glyphs/number/4.ptl index 04a59e6ff..10ba6f3c1 100644 --- a/font-src/glyphs/number/4.ptl +++ b/font-src/glyphs/number/4.ptl @@ -1,7 +1,7 @@ $$include '../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../support/utils' -import [AnyCv getGrMesh] from "../../support/gr" +import [mix linreg clamp fallback] from"../../support/utils.mjs" +import [AnyCv getGrMesh] from"../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/number/5.ptl b/font-src/glyphs/number/5.ptl index e839c29b7..1824b9bfd 100644 --- a/font-src/glyphs/number/5.ptl +++ b/font-src/glyphs/number/5.ptl @@ -1,7 +1,7 @@ $$include '../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../support/utils' -import [AnyCv getGrMesh] from "../../support/gr" +import [mix linreg clamp fallback] from"../../support/utils.mjs" +import [AnyCv getGrMesh] from"../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/number/6.ptl b/font-src/glyphs/number/6.ptl index 7744992cd..9e52a98f3 100644 --- a/font-src/glyphs/number/6.ptl +++ b/font-src/glyphs/number/6.ptl @@ -1,7 +1,7 @@ $$include '../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../support/utils' -import [AnyCv getGrMesh] from "../../support/gr" +import [mix linreg clamp fallback] from"../../support/utils.mjs" +import [AnyCv getGrMesh] from"../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/number/7.ptl b/font-src/glyphs/number/7.ptl index 40a1c6fd6..4da4ab045 100644 --- a/font-src/glyphs/number/7.ptl +++ b/font-src/glyphs/number/7.ptl @@ -1,7 +1,7 @@ $$include '../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../support/utils' -import [AnyCv getGrMesh] from "../../support/gr" +import [mix linreg clamp fallback] from"../../support/utils.mjs" +import [AnyCv getGrMesh] from"../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/number/8.ptl b/font-src/glyphs/number/8.ptl index e100bd2e1..ace2d17f9 100644 --- a/font-src/glyphs/number/8.ptl +++ b/font-src/glyphs/number/8.ptl @@ -1,7 +1,7 @@ $$include '../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../support/utils' -import [AnyCv getGrMesh] from "../../support/gr" +import [mix linreg clamp fallback] from"../../support/utils.mjs" +import [AnyCv getGrMesh] from"../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/number/9.ptl b/font-src/glyphs/number/9.ptl index cc2a3e65c..8aea48a78 100644 --- a/font-src/glyphs/number/9.ptl +++ b/font-src/glyphs/number/9.ptl @@ -1,7 +1,7 @@ $$include '../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../support/utils' -import [AnyCv getGrMesh] from "../../support/gr" +import [mix linreg clamp fallback] from"../../support/utils.mjs" +import [AnyCv getGrMesh] from"../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/number/index.ptl b/font-src/glyphs/number/index.ptl index 45b02c684..d68b095ef 100644 --- a/font-src/glyphs/number/index.ptl +++ b/font-src/glyphs/number/index.ptl @@ -4,14 +4,14 @@ glyph-module export : define [apply] : begin define $$Capture$$ this - run-glyph-module './shared.js' - run-glyph-module './0.js' - run-glyph-module './1.js' - run-glyph-module './2.js' - run-glyph-module './3.js' - run-glyph-module './4.js' - run-glyph-module './5.js' - run-glyph-module './6.js' - run-glyph-module './7.js' - run-glyph-module './8.js' - run-glyph-module './9.js' + run-glyph-module "./shared.mjs" + run-glyph-module "./0.mjs" + run-glyph-module "./1.mjs" + run-glyph-module "./2.mjs" + run-glyph-module "./3.mjs" + run-glyph-module "./4.mjs" + run-glyph-module "./5.mjs" + run-glyph-module "./6.mjs" + run-glyph-module "./7.mjs" + run-glyph-module "./8.mjs" + run-glyph-module "./9.mjs" diff --git a/font-src/glyphs/number/shared.ptl b/font-src/glyphs/number/shared.ptl index 65905d629..aacc8bfda 100644 --- a/font-src/glyphs/number/shared.ptl +++ b/font-src/glyphs/number/shared.ptl @@ -1,7 +1,7 @@ $$include '../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../support/utils' -import [AnyCv getGrMesh] from "../../support/gr" +import [mix linreg clamp fallback] from"../../support/utils.mjs" +import [AnyCv getGrMesh] from"../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/space/index.ptl b/font-src/glyphs/space/index.ptl index 06d1d457a..d2a43d72b 100644 --- a/font-src/glyphs/space/index.ptl +++ b/font-src/glyphs/space/index.ptl @@ -1,7 +1,7 @@ $$include '../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../support/utils' -import [Joining] from '../../support/gr' +import [mix linreg clamp fallback] from"../../support/utils.mjs" +import [Joining] from"../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/symbol/arrow.ptl b/font-src/glyphs/symbol/arrow.ptl index c9087dbb9..544989bea 100644 --- a/font-src/glyphs/symbol/arrow.ptl +++ b/font-src/glyphs/symbol/arrow.ptl @@ -1,6 +1,6 @@ $$include '../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../support/utils' +import [mix linreg clamp fallback] from"../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/symbol/braille.ptl b/font-src/glyphs/symbol/braille.ptl index 356c28e64..172a0a184 100644 --- a/font-src/glyphs/symbol/braille.ptl +++ b/font-src/glyphs/symbol/braille.ptl @@ -1,8 +1,8 @@ ###### Braille symbols $$include '../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../support/utils' -import [maskBit maskBits popCountByte] from '../../support/util/mask-bit' +import [mix linreg clamp fallback] from"../../support/utils.mjs" +import [maskBit maskBits popCountByte] from"../../support/util/mask-bit.mjs" glyph-module diff --git a/font-src/glyphs/symbol/enclosure.ptl b/font-src/glyphs/symbol/enclosure.ptl index f5bf5d504..d795f35a0 100644 --- a/font-src/glyphs/symbol/enclosure.ptl +++ b/font-src/glyphs/symbol/enclosure.ptl @@ -1,7 +1,7 @@ $$include '../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../support/utils' -import [DesignParameters] from '../../meta/aesthetics' +import [mix linreg clamp fallback] from"../../support/utils.mjs" +import [DesignParameters] from"../../meta/aesthetics.mjs" glyph-module diff --git a/font-src/glyphs/symbol/geometric.ptl b/font-src/glyphs/symbol/geometric.ptl index aadbaa5d2..549c0d2c1 100644 --- a/font-src/glyphs/symbol/geometric.ptl +++ b/font-src/glyphs/symbol/geometric.ptl @@ -2,12 +2,12 @@ $$include '../../meta/macros.ptl' export : define [apply] : begin define $$Capture$$ this - run-glyph-module './geometric/shared.js' - run-glyph-module './geometric/plain.js' - run-glyph-module './geometric/rounded.js' - run-glyph-module './geometric/shaded.js' - run-glyph-module './geometric/stars.js' - run-glyph-module './geometric/sun-and-gear.js' - run-glyph-module './geometric/dotted.js' - run-glyph-module './geometric/masked.js' - run-glyph-module './geometric/ballot-box.js' + run-glyph-module "./geometric/shared.mjs" + run-glyph-module "./geometric/plain.mjs" + run-glyph-module "./geometric/rounded.mjs" + run-glyph-module "./geometric/shaded.mjs" + run-glyph-module "./geometric/stars.mjs" + run-glyph-module "./geometric/sun-and-gear.mjs" + run-glyph-module "./geometric/dotted.mjs" + run-glyph-module "./geometric/masked.mjs" + run-glyph-module "./geometric/ballot-box.mjs" diff --git a/font-src/glyphs/symbol/geometric/ballot-box.ptl b/font-src/glyphs/symbol/geometric/ballot-box.ptl index cc0830fc9..e777023c6 100644 --- a/font-src/glyphs/symbol/geometric/ballot-box.ptl +++ b/font-src/glyphs/symbol/geometric/ballot-box.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [DesignParameters] from '../../../meta/aesthetics' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [DesignParameters] from"../../../meta/aesthetics.mjs" glyph-module diff --git a/font-src/glyphs/symbol/geometric/dotted.ptl b/font-src/glyphs/symbol/geometric/dotted.ptl index eceed9727..ce7e2be3e 100644 --- a/font-src/glyphs/symbol/geometric/dotted.ptl +++ b/font-src/glyphs/symbol/geometric/dotted.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [DesignParameters] from '../../../meta/aesthetics' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [DesignParameters] from"../../../meta/aesthetics.mjs" glyph-module diff --git a/font-src/glyphs/symbol/geometric/masked.ptl b/font-src/glyphs/symbol/geometric/masked.ptl index c3d9e6a5b..e5a7093e1 100644 --- a/font-src/glyphs/symbol/geometric/masked.ptl +++ b/font-src/glyphs/symbol/geometric/masked.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [DesignParameters] from '../../../meta/aesthetics' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [DesignParameters] from"../../../meta/aesthetics.mjs" glyph-module diff --git a/font-src/glyphs/symbol/geometric/plain.ptl b/font-src/glyphs/symbol/geometric/plain.ptl index e7071605e..c19a60b83 100644 --- a/font-src/glyphs/symbol/geometric/plain.ptl +++ b/font-src/glyphs/symbol/geometric/plain.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [DesignParameters] from '../../../meta/aesthetics' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [DesignParameters] from"../../../meta/aesthetics.mjs" glyph-module diff --git a/font-src/glyphs/symbol/geometric/rounded.ptl b/font-src/glyphs/symbol/geometric/rounded.ptl index 64aa648c2..bde249b5c 100644 --- a/font-src/glyphs/symbol/geometric/rounded.ptl +++ b/font-src/glyphs/symbol/geometric/rounded.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [DesignParameters] from '../../../meta/aesthetics' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [DesignParameters] from"../../../meta/aesthetics.mjs" glyph-module diff --git a/font-src/glyphs/symbol/geometric/shaded.ptl b/font-src/glyphs/symbol/geometric/shaded.ptl index d576653f4..2fed893a2 100644 --- a/font-src/glyphs/symbol/geometric/shaded.ptl +++ b/font-src/glyphs/symbol/geometric/shaded.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [DesignParameters] from '../../../meta/aesthetics' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [DesignParameters] from"../../../meta/aesthetics.mjs" glyph-module diff --git a/font-src/glyphs/symbol/geometric/shared.ptl b/font-src/glyphs/symbol/geometric/shared.ptl index d2cf64707..6529126b2 100644 --- a/font-src/glyphs/symbol/geometric/shared.ptl +++ b/font-src/glyphs/symbol/geometric/shared.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [DesignParameters] from '../../../meta/aesthetics' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [DesignParameters] from"../../../meta/aesthetics.mjs" glyph-module diff --git a/font-src/glyphs/symbol/geometric/stars.ptl b/font-src/glyphs/symbol/geometric/stars.ptl index 11ddc30be..dc024b854 100644 --- a/font-src/glyphs/symbol/geometric/stars.ptl +++ b/font-src/glyphs/symbol/geometric/stars.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [DesignParameters] from '../../../meta/aesthetics' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [DesignParameters] from"../../../meta/aesthetics.mjs" glyph-module diff --git a/font-src/glyphs/symbol/geometric/sun-and-gear.ptl b/font-src/glyphs/symbol/geometric/sun-and-gear.ptl index 7078fa001..ac08781a3 100644 --- a/font-src/glyphs/symbol/geometric/sun-and-gear.ptl +++ b/font-src/glyphs/symbol/geometric/sun-and-gear.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [DesignParameters] from '../../../meta/aesthetics' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [DesignParameters] from"../../../meta/aesthetics.mjs" glyph-module diff --git a/font-src/glyphs/symbol/letter.ptl b/font-src/glyphs/symbol/letter.ptl index f87a91b31..461a108e5 100644 --- a/font-src/glyphs/symbol/letter.ptl +++ b/font-src/glyphs/symbol/letter.ptl @@ -2,8 +2,8 @@ $$include '../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../support/utils' -import [DesignParameters] from '../../meta/aesthetics' +import [mix linreg clamp fallback] from"../../support/utils.mjs" +import [DesignParameters] from"../../meta/aesthetics.mjs" glyph-module diff --git a/font-src/glyphs/symbol/ligation.ptl b/font-src/glyphs/symbol/ligation.ptl index 3afbeb816..340ef8e96 100644 --- a/font-src/glyphs/symbol/ligation.ptl +++ b/font-src/glyphs/symbol/ligation.ptl @@ -1,9 +1,9 @@ ###### Other symbols $$include '../../meta/macros.ptl' -import [mix clamp fallback] from '../../support/utils' -import [Joining] from '../../support/gr' -import [DesignParameters] from '../../meta/aesthetics' +import [mix clamp fallback] from"../../support/utils.mjs" +import [Joining] from"../../support/gr.mjs" +import [DesignParameters] from"../../meta/aesthetics.mjs" glyph-module diff --git a/font-src/glyphs/symbol/math.ptl b/font-src/glyphs/symbol/math.ptl index a15f0da9f..7af2636ac 100644 --- a/font-src/glyphs/symbol/math.ptl +++ b/font-src/glyphs/symbol/math.ptl @@ -2,22 +2,22 @@ $$include '../../meta/macros.ptl' export : define [apply] : begin define $$Capture$$ this - run-glyph-module './math/not-glyph-fn.js' + run-glyph-module "./math/not-glyph-fn.mjs" - run-glyph-module './math/arith.js' - run-glyph-module './math/complement.js' - run-glyph-module './math/dots-and-colons.js' - run-glyph-module './math/frame.js' - run-glyph-module './math/geometry.js' - run-glyph-module './math/integrals.js' - run-glyph-module './math/large-operators.js' - run-glyph-module './math/letter-like.js' - run-glyph-module './math/logicals.js' - run-glyph-module './math/other.js' - run-glyph-module './math/relation.js' - run-glyph-module './math/v-and-cup.js' + run-glyph-module "./math/arith.mjs" + run-glyph-module "./math/complement.mjs" + run-glyph-module "./math/dots-and-colons.mjs" + run-glyph-module "./math/frame.mjs" + run-glyph-module "./math/geometry.mjs" + run-glyph-module "./math/integrals.mjs" + run-glyph-module "./math/large-operators.mjs" + run-glyph-module "./math/letter-like.mjs" + run-glyph-module "./math/logicals.mjs" + run-glyph-module "./math/other.mjs" + run-glyph-module "./math/relation.mjs" + run-glyph-module "./math/v-and-cup.mjs" - run-glyph-module './math/boxed.js' - run-glyph-module './math/circled.js' - run-glyph-module './math/negation.js' - run-glyph-module './math/apl.js' + run-glyph-module "./math/boxed.mjs" + run-glyph-module "./math/circled.mjs" + run-glyph-module "./math/negation.mjs" + run-glyph-module "./math/apl.mjs" diff --git a/font-src/glyphs/symbol/math/apl.ptl b/font-src/glyphs/symbol/math/apl.ptl index eab39833a..816cbc366 100644 --- a/font-src/glyphs/symbol/math/apl.ptl +++ b/font-src/glyphs/symbol/math/apl.ptl @@ -1,9 +1,9 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [DesignParameters] from '../../../meta/aesthetics' -import [Point] from '../../../support/geometry/point' -import [AplForm] from '../../../support/gr' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [DesignParameters] from"../../../meta/aesthetics.mjs" +import [Point] from"../../../support/geometry/point.mjs" +import [AplForm] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/symbol/math/arith.ptl b/font-src/glyphs/symbol/math/arith.ptl index 90ce88452..0a2b4c41f 100644 --- a/font-src/glyphs/symbol/math/arith.ptl +++ b/font-src/glyphs/symbol/math/arith.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/symbol/math/boxed.ptl b/font-src/glyphs/symbol/math/boxed.ptl index 4d8e55a4d..26fba658a 100644 --- a/font-src/glyphs/symbol/math/boxed.ptl +++ b/font-src/glyphs/symbol/math/boxed.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/symbol/math/circled.ptl b/font-src/glyphs/symbol/math/circled.ptl index 9dce5e30d..3574df59b 100644 --- a/font-src/glyphs/symbol/math/circled.ptl +++ b/font-src/glyphs/symbol/math/circled.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/symbol/math/complement.ptl b/font-src/glyphs/symbol/math/complement.ptl index 31d1ce6c5..e6a37fc8a 100644 --- a/font-src/glyphs/symbol/math/complement.ptl +++ b/font-src/glyphs/symbol/math/complement.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/symbol/math/dots-and-colons.ptl b/font-src/glyphs/symbol/math/dots-and-colons.ptl index 2b54a4691..2d92794c0 100644 --- a/font-src/glyphs/symbol/math/dots-and-colons.ptl +++ b/font-src/glyphs/symbol/math/dots-and-colons.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/symbol/math/frame.ptl b/font-src/glyphs/symbol/math/frame.ptl index bf7823543..4539a6785 100644 --- a/font-src/glyphs/symbol/math/frame.ptl +++ b/font-src/glyphs/symbol/math/frame.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/symbol/math/geometry.ptl b/font-src/glyphs/symbol/math/geometry.ptl index 3a0a801a7..08f8ab558 100644 --- a/font-src/glyphs/symbol/math/geometry.ptl +++ b/font-src/glyphs/symbol/math/geometry.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/symbol/math/integrals.ptl b/font-src/glyphs/symbol/math/integrals.ptl index e6ee66657..b593191d1 100644 --- a/font-src/glyphs/symbol/math/integrals.ptl +++ b/font-src/glyphs/symbol/math/integrals.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/symbol/math/large-operators.ptl b/font-src/glyphs/symbol/math/large-operators.ptl index adb0b4a50..3100c8645 100644 --- a/font-src/glyphs/symbol/math/large-operators.ptl +++ b/font-src/glyphs/symbol/math/large-operators.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/symbol/math/letter-like.ptl b/font-src/glyphs/symbol/math/letter-like.ptl index 4705dc409..d109b31e0 100644 --- a/font-src/glyphs/symbol/math/letter-like.ptl +++ b/font-src/glyphs/symbol/math/letter-like.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/symbol/math/logicals.ptl b/font-src/glyphs/symbol/math/logicals.ptl index 865204504..119e85eba 100644 --- a/font-src/glyphs/symbol/math/logicals.ptl +++ b/font-src/glyphs/symbol/math/logicals.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/symbol/math/negation.ptl b/font-src/glyphs/symbol/math/negation.ptl index d86eb1c18..20b47338a 100644 --- a/font-src/glyphs/symbol/math/negation.ptl +++ b/font-src/glyphs/symbol/math/negation.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/symbol/math/not-glyph-fn.ptl b/font-src/glyphs/symbol/math/not-glyph-fn.ptl index 52beaed2a..b9ae00a2d 100644 --- a/font-src/glyphs/symbol/math/not-glyph-fn.ptl +++ b/font-src/glyphs/symbol/math/not-glyph-fn.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/symbol/math/other.ptl b/font-src/glyphs/symbol/math/other.ptl index a45c9a57d..805a6003b 100644 --- a/font-src/glyphs/symbol/math/other.ptl +++ b/font-src/glyphs/symbol/math/other.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/symbol/math/relation.ptl b/font-src/glyphs/symbol/math/relation.ptl index f6d91504a..c8772c776 100644 --- a/font-src/glyphs/symbol/math/relation.ptl +++ b/font-src/glyphs/symbol/math/relation.ptl @@ -1,8 +1,8 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Box] from '../../../support/geometry/box' -import [Joining] from '../../../support/gr' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Box] from"../../../support/geometry/box.mjs" +import [Joining] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/symbol/math/v-and-cup.ptl b/font-src/glyphs/symbol/math/v-and-cup.ptl index fd4b3677f..1e2c2ccf2 100644 --- a/font-src/glyphs/symbol/math/v-and-cup.ptl +++ b/font-src/glyphs/symbol/math/v-and-cup.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/symbol/mosaic.ptl b/font-src/glyphs/symbol/mosaic.ptl index 67d406545..f48fbf4d8 100644 --- a/font-src/glyphs/symbol/mosaic.ptl +++ b/font-src/glyphs/symbol/mosaic.ptl @@ -1,7 +1,7 @@ ###### Teletext symbols $$include '../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../support/utils' +import [mix linreg clamp fallback] from"../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/symbol/pictograph.ptl b/font-src/glyphs/symbol/pictograph.ptl index 7aab624fe..7a962af97 100644 --- a/font-src/glyphs/symbol/pictograph.ptl +++ b/font-src/glyphs/symbol/pictograph.ptl @@ -3,18 +3,18 @@ $$include '../../meta/macros.ptl' export : define [apply] : begin define $$Capture$$ this - run-glyph-module './pictograph/astronomy.js' - run-glyph-module './pictograph/atom.js' - run-glyph-module './pictograph/bolt-symbol.js' - run-glyph-module './pictograph/checking-marks.js' - run-glyph-module './pictograph/corner-shape.js' - run-glyph-module './pictograph/faces.js' - run-glyph-module './pictograph/flags.js' - run-glyph-module './pictograph/heart.js' - run-glyph-module './pictograph/i-ching.js' - run-glyph-module './pictograph/iec-power-and-playback.js' - run-glyph-module './pictograph/kome.js' - run-glyph-module './pictograph/metric-marks.js' - run-glyph-module './pictograph/musical.js' - run-glyph-module './pictograph/powerline-and-gui.js' - run-glyph-module './pictograph/suit.js' + run-glyph-module "./pictograph/astronomy.mjs" + run-glyph-module "./pictograph/atom.mjs" + run-glyph-module "./pictograph/bolt-symbol.mjs" + run-glyph-module "./pictograph/checking-marks.mjs" + run-glyph-module "./pictograph/corner-shape.mjs" + run-glyph-module "./pictograph/faces.mjs" + run-glyph-module "./pictograph/flags.mjs" + run-glyph-module "./pictograph/heart.mjs" + run-glyph-module "./pictograph/i-ching.mjs" + run-glyph-module "./pictograph/iec-power-and-playback.mjs" + run-glyph-module "./pictograph/kome.mjs" + run-glyph-module "./pictograph/metric-marks.mjs" + run-glyph-module "./pictograph/musical.mjs" + run-glyph-module "./pictograph/powerline-and-gui.mjs" + run-glyph-module "./pictograph/suit.mjs" diff --git a/font-src/glyphs/symbol/pictograph/astronomy.ptl b/font-src/glyphs/symbol/pictograph/astronomy.ptl index 342b5e655..26729db7e 100644 --- a/font-src/glyphs/symbol/pictograph/astronomy.ptl +++ b/font-src/glyphs/symbol/pictograph/astronomy.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/symbol/pictograph/atom.ptl b/font-src/glyphs/symbol/pictograph/atom.ptl index baac7069d..494d287c6 100644 --- a/font-src/glyphs/symbol/pictograph/atom.ptl +++ b/font-src/glyphs/symbol/pictograph/atom.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/symbol/pictograph/bolt-symbol.ptl b/font-src/glyphs/symbol/pictograph/bolt-symbol.ptl index 1e8740532..73f127e07 100644 --- a/font-src/glyphs/symbol/pictograph/bolt-symbol.ptl +++ b/font-src/glyphs/symbol/pictograph/bolt-symbol.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/symbol/pictograph/checking-marks.ptl b/font-src/glyphs/symbol/pictograph/checking-marks.ptl index b2f9500f3..c075b83e5 100644 --- a/font-src/glyphs/symbol/pictograph/checking-marks.ptl +++ b/font-src/glyphs/symbol/pictograph/checking-marks.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/symbol/pictograph/corner-shape.ptl b/font-src/glyphs/symbol/pictograph/corner-shape.ptl index 2c83b8f7e..6cbd2ce6c 100644 --- a/font-src/glyphs/symbol/pictograph/corner-shape.ptl +++ b/font-src/glyphs/symbol/pictograph/corner-shape.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/symbol/pictograph/faces.ptl b/font-src/glyphs/symbol/pictograph/faces.ptl index 9ad1f8516..8a3ed870f 100644 --- a/font-src/glyphs/symbol/pictograph/faces.ptl +++ b/font-src/glyphs/symbol/pictograph/faces.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/symbol/pictograph/flags.ptl b/font-src/glyphs/symbol/pictograph/flags.ptl index 838783f3c..0c1a1c5a8 100644 --- a/font-src/glyphs/symbol/pictograph/flags.ptl +++ b/font-src/glyphs/symbol/pictograph/flags.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/symbol/pictograph/heart.ptl b/font-src/glyphs/symbol/pictograph/heart.ptl index ad2d7b378..f1f5e655e 100644 --- a/font-src/glyphs/symbol/pictograph/heart.ptl +++ b/font-src/glyphs/symbol/pictograph/heart.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Box] from "../../../support/geometry/box" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Box] from"../../../support/geometry/box.mjs" glyph-module diff --git a/font-src/glyphs/symbol/pictograph/i-ching.ptl b/font-src/glyphs/symbol/pictograph/i-ching.ptl index b0dfe0480..58efdb473 100644 --- a/font-src/glyphs/symbol/pictograph/i-ching.ptl +++ b/font-src/glyphs/symbol/pictograph/i-ching.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [maskBit] from '../../../support/util/mask-bit' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [maskBit] from"../../../support/util/mask-bit.mjs" glyph-module diff --git a/font-src/glyphs/symbol/pictograph/iec-power-and-playback.ptl b/font-src/glyphs/symbol/pictograph/iec-power-and-playback.ptl index 04a511bc9..9f1a82db3 100644 --- a/font-src/glyphs/symbol/pictograph/iec-power-and-playback.ptl +++ b/font-src/glyphs/symbol/pictograph/iec-power-and-playback.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/symbol/pictograph/kome.ptl b/font-src/glyphs/symbol/pictograph/kome.ptl index 52fd7b2d6..8f8f21452 100644 --- a/font-src/glyphs/symbol/pictograph/kome.ptl +++ b/font-src/glyphs/symbol/pictograph/kome.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/symbol/pictograph/metric-marks.ptl b/font-src/glyphs/symbol/pictograph/metric-marks.ptl index c8938e115..8460e3dc6 100644 --- a/font-src/glyphs/symbol/pictograph/metric-marks.ptl +++ b/font-src/glyphs/symbol/pictograph/metric-marks.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/symbol/pictograph/musical.ptl b/font-src/glyphs/symbol/pictograph/musical.ptl index 38acc6498..863a8fcc8 100644 --- a/font-src/glyphs/symbol/pictograph/musical.ptl +++ b/font-src/glyphs/symbol/pictograph/musical.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Transform] from '../../../support/geometry/transform' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Transform] from"../../../support/geometry/transform.mjs" glyph-module diff --git a/font-src/glyphs/symbol/pictograph/powerline-and-gui.ptl b/font-src/glyphs/symbol/pictograph/powerline-and-gui.ptl index e817b8862..fd707799e 100644 --- a/font-src/glyphs/symbol/pictograph/powerline-and-gui.ptl +++ b/font-src/glyphs/symbol/pictograph/powerline-and-gui.ptl @@ -1,6 +1,6 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/symbol/pictograph/suit.ptl b/font-src/glyphs/symbol/pictograph/suit.ptl index 843b84a14..373bf5abf 100644 --- a/font-src/glyphs/symbol/pictograph/suit.ptl +++ b/font-src/glyphs/symbol/pictograph/suit.ptl @@ -1,7 +1,7 @@ $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Box] from "../../../support/geometry/box" +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Box] from"../../../support/geometry/box.mjs" glyph-module diff --git a/font-src/glyphs/symbol/punctuation.ptl b/font-src/glyphs/symbol/punctuation.ptl index f36bedeaf..8fa3e6478 100644 --- a/font-src/glyphs/symbol/punctuation.ptl +++ b/font-src/glyphs/symbol/punctuation.ptl @@ -3,28 +3,28 @@ $$include '../../meta/macros.ptl' export : define [apply] : begin define $$Capture$$ this - run-glyph-module './punctuation/ampersand.js' - run-glyph-module './punctuation/ascii-marks.js' - run-glyph-module './punctuation/asterisk.js' - run-glyph-module './punctuation/at.js' - run-glyph-module './punctuation/bar.js' - run-glyph-module './punctuation/brackets.js' - run-glyph-module './punctuation/bullets.js' - run-glyph-module './punctuation/daggers.js' - run-glyph-module './punctuation/dashes.js' - run-glyph-module './punctuation/ellipsis.js' - run-glyph-module './punctuation/emotion.js' - run-glyph-module './punctuation/guillemet.js' - run-glyph-module './punctuation/interpuncts.js' - run-glyph-module './punctuation/joiners.js' - run-glyph-module './punctuation/other-phonetic.js' - run-glyph-module './punctuation/pilcrow.js' - run-glyph-module './punctuation/percentages.js' - run-glyph-module './punctuation/quotes-and-primes.js' - run-glyph-module './punctuation/section.js' - run-glyph-module './punctuation/slashes-and-number-sign.js' - run-glyph-module './punctuation/small.js' - run-glyph-module './punctuation/ties.js' - run-glyph-module './punctuation/caret.js' + run-glyph-module "./punctuation/ampersand.mjs" + run-glyph-module "./punctuation/ascii-marks.mjs" + run-glyph-module "./punctuation/asterisk.mjs" + run-glyph-module "./punctuation/at.mjs" + run-glyph-module "./punctuation/bar.mjs" + run-glyph-module "./punctuation/brackets.mjs" + run-glyph-module "./punctuation/bullets.mjs" + run-glyph-module "./punctuation/daggers.mjs" + run-glyph-module "./punctuation/dashes.mjs" + run-glyph-module "./punctuation/ellipsis.mjs" + run-glyph-module "./punctuation/emotion.mjs" + run-glyph-module "./punctuation/guillemet.mjs" + run-glyph-module "./punctuation/interpuncts.mjs" + run-glyph-module "./punctuation/joiners.mjs" + run-glyph-module "./punctuation/other-phonetic.mjs" + run-glyph-module "./punctuation/pilcrow.mjs" + run-glyph-module "./punctuation/percentages.mjs" + run-glyph-module "./punctuation/quotes-and-primes.mjs" + run-glyph-module "./punctuation/section.mjs" + run-glyph-module "./punctuation/slashes-and-number-sign.mjs" + run-glyph-module "./punctuation/small.mjs" + run-glyph-module "./punctuation/ties.mjs" + run-glyph-module "./punctuation/caret.mjs" - run-glyph-module './punctuation/ligation-variants.js' + run-glyph-module "./punctuation/ligation-variants.mjs" diff --git a/font-src/glyphs/symbol/punctuation/ampersand.ptl b/font-src/glyphs/symbol/punctuation/ampersand.ptl index 942f8d3d9..7224d3416 100644 --- a/font-src/glyphs/symbol/punctuation/ampersand.ptl +++ b/font-src/glyphs/symbol/punctuation/ampersand.ptl @@ -1,7 +1,7 @@ ### Punctuation symbols $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/symbol/punctuation/ascii-marks.ptl b/font-src/glyphs/symbol/punctuation/ascii-marks.ptl index 08d694358..75fd7e9a1 100644 --- a/font-src/glyphs/symbol/punctuation/ascii-marks.ptl +++ b/font-src/glyphs/symbol/punctuation/ascii-marks.ptl @@ -1,7 +1,7 @@ ### Punctuation symbols $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/symbol/punctuation/asterisk.ptl b/font-src/glyphs/symbol/punctuation/asterisk.ptl index 0ae726a0c..a4415d87c 100644 --- a/font-src/glyphs/symbol/punctuation/asterisk.ptl +++ b/font-src/glyphs/symbol/punctuation/asterisk.ptl @@ -1,7 +1,7 @@ ### Punctuation symbols $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/symbol/punctuation/at.ptl b/font-src/glyphs/symbol/punctuation/at.ptl index 2b311fa8b..a2dc7f0ac 100644 --- a/font-src/glyphs/symbol/punctuation/at.ptl +++ b/font-src/glyphs/symbol/punctuation/at.ptl @@ -1,7 +1,7 @@ ### Punctuation symbols $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/symbol/punctuation/bar.ptl b/font-src/glyphs/symbol/punctuation/bar.ptl index 6008c7df4..310abbad2 100644 --- a/font-src/glyphs/symbol/punctuation/bar.ptl +++ b/font-src/glyphs/symbol/punctuation/bar.ptl @@ -1,9 +1,9 @@ ### Punctuation symbols $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Joining] from '../../../support/gr' -import [DesignParameters] from '../../../meta/aesthetics' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Joining] from"../../../support/gr.mjs" +import [DesignParameters] from"../../../meta/aesthetics.mjs" glyph-module diff --git a/font-src/glyphs/symbol/punctuation/brackets.ptl b/font-src/glyphs/symbol/punctuation/brackets.ptl index 154500b62..68d9ddf6a 100644 --- a/font-src/glyphs/symbol/punctuation/brackets.ptl +++ b/font-src/glyphs/symbol/punctuation/brackets.ptl @@ -1,9 +1,9 @@ ### Punctuation symbols $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Joining] from '../../../support/gr' -import [DesignParameters] from '../../../meta/aesthetics' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Joining] from"../../../support/gr.mjs" +import [DesignParameters] from"../../../meta/aesthetics.mjs" glyph-module diff --git a/font-src/glyphs/symbol/punctuation/bullets.ptl b/font-src/glyphs/symbol/punctuation/bullets.ptl index dfebb52b7..7f32b48ba 100644 --- a/font-src/glyphs/symbol/punctuation/bullets.ptl +++ b/font-src/glyphs/symbol/punctuation/bullets.ptl @@ -1,7 +1,7 @@ ### Punctuation symbols $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/symbol/punctuation/caret.ptl b/font-src/glyphs/symbol/punctuation/caret.ptl index 83a64d416..b98ad2453 100644 --- a/font-src/glyphs/symbol/punctuation/caret.ptl +++ b/font-src/glyphs/symbol/punctuation/caret.ptl @@ -1,7 +1,7 @@ ### Punctuation symbols $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/symbol/punctuation/daggers.ptl b/font-src/glyphs/symbol/punctuation/daggers.ptl index 8be46011f..d92919c62 100644 --- a/font-src/glyphs/symbol/punctuation/daggers.ptl +++ b/font-src/glyphs/symbol/punctuation/daggers.ptl @@ -1,7 +1,7 @@ ### Punctuation symbols $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/symbol/punctuation/dashes.ptl b/font-src/glyphs/symbol/punctuation/dashes.ptl index 5b3805f1d..cd86ab645 100644 --- a/font-src/glyphs/symbol/punctuation/dashes.ptl +++ b/font-src/glyphs/symbol/punctuation/dashes.ptl @@ -1,8 +1,8 @@ ### Punctuation symbols $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Joining] from '../../../support/gr' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Joining] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/symbol/punctuation/ellipsis.ptl b/font-src/glyphs/symbol/punctuation/ellipsis.ptl index 67a78660b..a363e809c 100644 --- a/font-src/glyphs/symbol/punctuation/ellipsis.ptl +++ b/font-src/glyphs/symbol/punctuation/ellipsis.ptl @@ -1,7 +1,7 @@ ### Punctuation symbols $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/symbol/punctuation/emotion.ptl b/font-src/glyphs/symbol/punctuation/emotion.ptl index 9103e665c..c7506e44b 100644 --- a/font-src/glyphs/symbol/punctuation/emotion.ptl +++ b/font-src/glyphs/symbol/punctuation/emotion.ptl @@ -1,7 +1,7 @@ ### Punctuation symbols $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/symbol/punctuation/guillemet.ptl b/font-src/glyphs/symbol/punctuation/guillemet.ptl index 8bf182df7..1ad0e483d 100644 --- a/font-src/glyphs/symbol/punctuation/guillemet.ptl +++ b/font-src/glyphs/symbol/punctuation/guillemet.ptl @@ -1,7 +1,7 @@ ### Punctuation symbols $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/symbol/punctuation/interpuncts.ptl b/font-src/glyphs/symbol/punctuation/interpuncts.ptl index be8a850e4..98bfcbc9c 100644 --- a/font-src/glyphs/symbol/punctuation/interpuncts.ptl +++ b/font-src/glyphs/symbol/punctuation/interpuncts.ptl @@ -1,7 +1,7 @@ ### Punctuation symbols $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/symbol/punctuation/joiners.ptl b/font-src/glyphs/symbol/punctuation/joiners.ptl index 9baaedc9d..c7495ad3a 100644 --- a/font-src/glyphs/symbol/punctuation/joiners.ptl +++ b/font-src/glyphs/symbol/punctuation/joiners.ptl @@ -1,7 +1,7 @@ ### Punctuation symbols $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/symbol/punctuation/ligation-variants.ptl b/font-src/glyphs/symbol/punctuation/ligation-variants.ptl index cba3031a5..eed86c4e2 100644 --- a/font-src/glyphs/symbol/punctuation/ligation-variants.ptl +++ b/font-src/glyphs/symbol/punctuation/ligation-variants.ptl @@ -1,7 +1,7 @@ ### Punctuation symbols $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/symbol/punctuation/other-phonetic.ptl b/font-src/glyphs/symbol/punctuation/other-phonetic.ptl index 6d98a82be..b48bd2a8d 100644 --- a/font-src/glyphs/symbol/punctuation/other-phonetic.ptl +++ b/font-src/glyphs/symbol/punctuation/other-phonetic.ptl @@ -1,8 +1,8 @@ ### Punctuation symbols $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Joining] from '../../../support/gr' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Joining] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/symbol/punctuation/percentages.ptl b/font-src/glyphs/symbol/punctuation/percentages.ptl index 08ca0aa0e..b18efe274 100644 --- a/font-src/glyphs/symbol/punctuation/percentages.ptl +++ b/font-src/glyphs/symbol/punctuation/percentages.ptl @@ -1,7 +1,7 @@ ### Punctuation symbols $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/symbol/punctuation/pilcrow.ptl b/font-src/glyphs/symbol/punctuation/pilcrow.ptl index fc912219b..acfe785bd 100644 --- a/font-src/glyphs/symbol/punctuation/pilcrow.ptl +++ b/font-src/glyphs/symbol/punctuation/pilcrow.ptl @@ -1,7 +1,7 @@ ### Punctuation symbols $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/symbol/punctuation/quotes-and-primes.ptl b/font-src/glyphs/symbol/punctuation/quotes-and-primes.ptl index 338789b8e..d4a527c32 100644 --- a/font-src/glyphs/symbol/punctuation/quotes-and-primes.ptl +++ b/font-src/glyphs/symbol/punctuation/quotes-and-primes.ptl @@ -1,7 +1,7 @@ ### Punctuation symbols $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/symbol/punctuation/section.ptl b/font-src/glyphs/symbol/punctuation/section.ptl index 7c3d4a0ac..a2bd87b68 100644 --- a/font-src/glyphs/symbol/punctuation/section.ptl +++ b/font-src/glyphs/symbol/punctuation/section.ptl @@ -1,7 +1,7 @@ ### Punctuation symbols $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/symbol/punctuation/slashes-and-number-sign.ptl b/font-src/glyphs/symbol/punctuation/slashes-and-number-sign.ptl index 79d388c3d..601f198c5 100644 --- a/font-src/glyphs/symbol/punctuation/slashes-and-number-sign.ptl +++ b/font-src/glyphs/symbol/punctuation/slashes-and-number-sign.ptl @@ -1,8 +1,8 @@ ### Punctuation symbols $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [Joining] from '../../../support/gr' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [Joining] from"../../../support/gr.mjs" glyph-module diff --git a/font-src/glyphs/symbol/punctuation/small.ptl b/font-src/glyphs/symbol/punctuation/small.ptl index b23c167f9..ea7297929 100644 --- a/font-src/glyphs/symbol/punctuation/small.ptl +++ b/font-src/glyphs/symbol/punctuation/small.ptl @@ -1,8 +1,8 @@ ### Punctuation symbols $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' -import [DesignParameters] from '../../../meta/aesthetics' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" +import [DesignParameters] from"../../../meta/aesthetics.mjs" glyph-module diff --git a/font-src/glyphs/symbol/punctuation/ties.ptl b/font-src/glyphs/symbol/punctuation/ties.ptl index b772a2077..d1525f1c1 100644 --- a/font-src/glyphs/symbol/punctuation/ties.ptl +++ b/font-src/glyphs/symbol/punctuation/ties.ptl @@ -1,7 +1,7 @@ ### Punctuation symbols $$include '../../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../../support/utils' +import [mix linreg clamp fallback] from"../../../support/utils.mjs" glyph-module diff --git a/font-src/glyphs/symbol/shared.ptl b/font-src/glyphs/symbol/shared.ptl index b3796448d..289366887 100644 --- a/font-src/glyphs/symbol/shared.ptl +++ b/font-src/glyphs/symbol/shared.ptl @@ -1,6 +1,6 @@ $$include '../../meta/macros.ptl' -import [mix linreg clamp fallback] from '../../support/utils' +import [mix linreg clamp fallback] from"../../support/utils.mjs" glyph-module diff --git a/font-src/index.js b/font-src/index.mjs similarity index 80% rename from font-src/index.js rename to font-src/index.mjs index 117ca7ecb..be0e8782f 100644 --- a/font-src/index.js +++ b/font-src/index.mjs @@ -1,27 +1,19 @@ -"use strict"; +import fs from "fs"; +import path from "path"; +import zlib from "zlib"; +import * as url from "url"; +import { encode } from "@msgpack/msgpack"; +import { FontIo } from "ot-builder"; +import * as Toml from "@iarna/toml"; +import { buildFont } from "./gen/build-font.mjs"; +import * as Parameters from "./support/parameters.mjs"; +import { applyMetricOverride } from "./support/metric-override.mjs"; +import * as VariantData from "./support/variant-data.mjs"; +import { applyLigationData } from "./support/ligation-data.mjs"; +import { createGrDisplaySheet } from "./support/gr.mjs"; -const fs = require("fs"); -const path = require("path"); -const zlib = require("zlib"); -const { encode } = require("@msgpack/msgpack"); - -const { FontIo } = require("ot-builder"); -const Toml = require("@iarna/toml"); - -const { buildFont } = require("./gen/build-font.js"); -const Parameters = require("./support/parameters"); -const { applyMetricOverride } = require("./support/metric-override"); -const VariantData = require("./support/variant-data"); -const { applyLigationData } = require("./support/ligation-data"); -const { createGrDisplaySheet } = require("./support/gr"); - -module.exports = async function main(argv) { - const paraT = await getParameters(); - const { font, glyphStore, cacheUpdated } = await buildFont(argv, paraT(argv)); - if (argv.oCharMap) await saveCharMap(argv, glyphStore); - if (argv.o) await saveTTF(argv, font); - return { cacheUpdated }; -}; +const __filename = url.fileURLToPath(import.meta.url); +const __dirname = url.fileURLToPath(new URL(".", import.meta.url)); // Parameter preparation async function getParameters() { @@ -32,7 +24,6 @@ async function getParameters() { const PRIVATE_TOML = path.resolve(__dirname, "../params/private-parameters.toml"); const VARIANTS_TOML = path.resolve(__dirname, "../params/variants.toml"); const LIGATIONS_TOML = path.resolve(__dirname, "../params/ligation-set.toml"); - const parametersData = Object.assign( {}, await tryParseToml(PARAMETERS_TOML), @@ -43,16 +34,13 @@ async function getParameters() { ); const rawVariantsData = await tryParseToml(VARIANTS_TOML); const rawLigationData = await tryParseToml(LIGATIONS_TOML); - function createParaImpl(argv) { let para = Parameters.init(deepClone(parametersData), argv); VariantData.apply(deepClone(rawVariantsData), para, argv); applyLigationData(deepClone(rawLigationData), para, argv); - if (argv.excludedCharRanges) para.excludedCharRanges = argv.excludedCharRanges; if (argv.compatibilityLigatures) para.compLig = argv.compatibilityLigatures; if (argv.metricOverride) applyMetricOverride(para, argv.metricOverride, argv); - para.naming = { ...para.naming, family: argv.menu.family, @@ -63,7 +51,6 @@ async function getParameters() { }; return para; } - function reinit(argv) { const para = createParaImpl(argv); para.reinit = function (tf) { @@ -75,7 +62,6 @@ async function getParameters() { } return reinit; } - async function tryParseToml(str) { try { return Toml.parse(await fs.promises.readFile(str, "utf-8")); @@ -85,11 +71,9 @@ async function tryParseToml(str) { ); } } - function deepClone(pod) { return JSON.parse(JSON.stringify(pod)); } - // Save TTF async function saveTTF(argv, font) { const sfnt = FontIo.writeFont(font, { @@ -99,7 +83,6 @@ async function saveTTF(argv, font) { const buf = FontIo.writeSfntOtf(sfnt); await fs.promises.writeFile(argv.o, buf); } - // Save character map file async function saveCharMap(argv, glyphStore) { let charMap = []; @@ -112,3 +95,10 @@ async function saveCharMap(argv, glyphStore) { } await fs.promises.writeFile(argv.oCharMap, zlib.gzipSync(encode(charMap))); } +export default (async function main(argv) { + const paraT = await getParameters(); + const { font, glyphStore, cacheUpdated } = await buildFont(argv, paraT(argv)); + if (argv.oCharMap) await saveCharMap(argv, glyphStore); + if (argv.o) await saveTTF(argv, font); + return { cacheUpdated }; +}); diff --git a/font-src/kits/boole-kit.js b/font-src/kits/boole-kit.js index e01240e4b..cb28e1aac 100644 --- a/font-src/kits/boole-kit.js +++ b/font-src/kits/boole-kit.js @@ -1,31 +1,13 @@ -"use strict"; - -const TypoGeom = require("typo-geom"); -const { BooleanGeometry, TransformedGeometry } = require("../support/geometry/index"); - -exports.SetupBuilders = function (bindings) { - const union = (...operands) => - new BooleImpl(bindings, TypoGeom.Boolean.ClipType.ctUnion, operands); - const intersection = (...operands) => - new BooleImpl(bindings, TypoGeom.Boolean.ClipType.ctIntersection, operands); - const difference = (...operands) => - new BooleImpl(bindings, TypoGeom.Boolean.ClipType.ctDifference, operands); - return { - union: union, - intersection: intersection, - difference: difference - }; -}; +import * as TypoGeom from "typo-geom"; +import { BooleanGeometry, TransformedGeometry } from "../support/geometry/index.mjs"; /////////////////////////////////////////////////////////////////////////////////////////////////// - class BooleImpl { constructor(bindings, operator, operands) { this.bindings = bindings; this.operator = operator; this.operands = operands; } - applyToGlyph(glyph) { const operandGeometries = []; const forwardGizmo = glyph.gizmo || this.bindings.GlobalTransform; @@ -44,3 +26,16 @@ class BooleImpl { ); } } +export const SetupBuilders = function (bindings) { + const union = (...operands) => + new BooleImpl(bindings, TypoGeom.Boolean.ClipType.ctUnion, operands); + const intersection = (...operands) => + new BooleImpl(bindings, TypoGeom.Boolean.ClipType.ctIntersection, operands); + const difference = (...operands) => + new BooleImpl(bindings, TypoGeom.Boolean.ClipType.ctDifference, operands); + return { + union: union, + intersection: intersection, + difference: difference + }; +}; diff --git a/font-src/kits/boole-kit.mjs b/font-src/kits/boole-kit.mjs new file mode 100644 index 000000000..cb28e1aac --- /dev/null +++ b/font-src/kits/boole-kit.mjs @@ -0,0 +1,41 @@ +import * as TypoGeom from "typo-geom"; +import { BooleanGeometry, TransformedGeometry } from "../support/geometry/index.mjs"; + +/////////////////////////////////////////////////////////////////////////////////////////////////// +class BooleImpl { + constructor(bindings, operator, operands) { + this.bindings = bindings; + this.operator = operator; + this.operands = operands; + } + applyToGlyph(glyph) { + const operandGeometries = []; + const forwardGizmo = glyph.gizmo || this.bindings.GlobalTransform; + const backwardGizmo = forwardGizmo.inverse(); + for (const operand of this.operands) { + const g1 = new this.bindings.Glyph(); + g1.gizmo = forwardGizmo; + g1.include(operand); + operandGeometries.push(new TransformedGeometry(g1.geometry, backwardGizmo)); + } + return glyph.includeGeometry( + new TransformedGeometry( + new BooleanGeometry(this.operator, operandGeometries), + forwardGizmo + ) + ); + } +} +export const SetupBuilders = function (bindings) { + const union = (...operands) => + new BooleImpl(bindings, TypoGeom.Boolean.ClipType.ctUnion, operands); + const intersection = (...operands) => + new BooleImpl(bindings, TypoGeom.Boolean.ClipType.ctIntersection, operands); + const difference = (...operands) => + new BooleImpl(bindings, TypoGeom.Boolean.ClipType.ctDifference, operands); + return { + union: union, + intersection: intersection, + difference: difference + }; +}; diff --git a/font-src/kits/spiro-kit.js b/font-src/kits/spiro-kit.mjs similarity index 96% rename from font-src/kits/spiro-kit.js rename to font-src/kits/spiro-kit.mjs index 31240147d..715328198 100644 --- a/font-src/kits/spiro-kit.js +++ b/font-src/kits/spiro-kit.mjs @@ -1,18 +1,107 @@ -"use strict"; +import * as CurveUtil from "../support/geometry/curve-util.mjs"; +import { BiKnotCollector } from "../support/geometry/spiro-expand.mjs"; +import { fallback, mix, bez3 } from "../support/utils.mjs"; +import { SpiroGeometry, DiSpiroGeometry } from "../support/geometry/index.mjs"; -const CurveUtil = require("../support/geometry/curve-util"); -const { BiKnotCollector } = require("../support/geometry/spiro-expand"); -const { fallback, mix, bez3 } = require("../support/utils"); -const { SpiroGeometry, DiSpiroGeometry } = require("../support/geometry/index"); - -exports.SetupBuilders = function (bindings) { +/////////////////////////////////////////////////////////////////////////////////////////////////// +class DispiroImpl { + constructor(bindings, args) { + this.bindings = bindings; + this.args = args; + } + applyToGlyph(glyph) { + const gizmo = glyph.gizmo || this.bindings.GlobalTransform; + const collector = new BiKnotCollector(gizmo, this.bindings.Contrast); + const { knots, closed } = prepareSpiroKnots(this.args, collector); + for (const knot of knots) { + collector.pushKnot(knot.type, knot.x, knot.y); + if (knot.af) knot.af.call(collector); + } + const dsp = new DiSpiroProxy(closed, collector, knots); + glyph.includeGeometry(dsp.geometry); + return dsp; + } +} +class SpiroOutlineImpl { + constructor(bindings, args) { + this.bindings = bindings; + this.args = args; + } + applyToGlyph(glyph) { + const gizmo = glyph.gizmo || this.bindings.GlobalTransform; + const g = new CurveUtil.BezToContoursSink(gizmo); + const { knots, closed } = prepareSpiroKnots(this.args, g); + return glyph.includeGeometry(new SpiroGeometry(gizmo, closed, knots)); + } +} +class DiSpiroProxy { + constructor(closed, collector, origKnots) { + this.geometry = new DiSpiroGeometry( + collector.gizmo, + collector.contrast, + closed, + collector.controlKnots + ); + this.m_origKnots = origKnots; + } + get knots() { + return this.m_origKnots; + } + get lhsKnots() { + return this.geometry.expand().lhs; + } + get rhsKnots() { + return this.geometry.expand().rhs; + } +} +function prepareSpiroKnots(_knots, s) { + let knots = [..._knots]; + while (knots[0] && knots[0] instanceof Function) { + knots[0].call(s); + knots.splice(0, 1); + } + const closed = dropTailKnot(knots); + knots = flatten(s, knots); + return { knots, closed }; +} +function dropTailKnot(knots) { + let last = knots[knots.length - 1]; + if (last && (last.type === "close" || last.type === "end")) { + knots.length = knots.length - 1; + return last.type === "close"; + } else { + return false; + } +} +function flatten(s, knots0) { + let knots = []; + flattenImpl(knots, knots0); + let unwrapped = false; + for (let j = 0; j < knots.length; j = j + 1) + if (knots[j] && knots[j].type === "interpolate") { + const kBefore = knots[nCyclic(j - 1, knots.length)]; + const kAfter = knots[nCyclic(j + 1, knots.length)]; + knots[j] = knots[j].blender(kBefore, kAfter, knots[j]); + unwrapped = true; + } + if (unwrapped) return flatten(s, knots); + return knots; +} +function flattenImpl(sink, knots) { + for (const p of knots) { + if (p instanceof Array) flattenImpl(sink, p); + else sink.push(p); + } +} +function nCyclic(p, n) { + return (p + n + n) % n; +} +export const SetupBuilders = function (bindings) { const { Contrast, GlobalTransform, Stroke, Superness } = bindings; - function validateCoord(x) { if (!isFinite(x)) throw new TypeError("NaN detected"); return x; } - function KnotType(type) { return (x, y, f) => ({ type, @@ -28,7 +117,6 @@ exports.SetupBuilders = function (bindings) { const curl = KnotType("right"); const close = f => ({ type: "close", af: f }); const end = f => ({ type: "end", af: f }); - const straight = { l: flat, r: curl }; { let directions = [ @@ -60,7 +148,6 @@ exports.SetupBuilders = function (bindings) { } } } - function widths(l, r) { return function () { return this.setWidth ? this.setWidth(validateCoord(l), validateCoord(r)) : void 0; @@ -75,7 +162,6 @@ exports.SetupBuilders = function (bindings) { widths.center = function (w) { return widths(fallback(w, Stroke) / 2, fallback(w, Stroke) / 2); }; - function heading(d) { return function () { return this.headsTo ? this.headsTo(d) : void 0; @@ -105,7 +191,6 @@ exports.SetupBuilders = function (bindings) { return this.headsTo ? this.headsTo(d) : void 0; }; }; - function disableContrast() { return function () { return (this.contrast = 1); @@ -180,9 +265,7 @@ exports.SetupBuilders = function (bindings) { raf ); } - let DEFAULT_STEPS = 6; - let [buildHV, buildVH] = (function (cache) { function build(samples, _superness) { const superness = fallback(_superness, Superness); @@ -209,7 +292,6 @@ exports.SetupBuilders = function (bindings) { } return [buildHVImpl, buildVHImpl]; })([]); - function archv(samples, superness) { return alsoThruThem(buildHV(fallback(samples, DEFAULT_STEPS), superness)); } @@ -222,15 +304,12 @@ exports.SetupBuilders = function (bindings) { arcvh.superness = function (s) { return arcvh(DEFAULT_STEPS, s); }; - function dispiro(...args) { return new DispiroImpl(bindings, args); } - function spiroOutline(...args) { return new SpiroOutlineImpl(bindings, args); } - return { g4, g2, @@ -255,108 +334,3 @@ exports.SetupBuilders = function (bindings) { "spiro-outline": spiroOutline }; }; - -/////////////////////////////////////////////////////////////////////////////////////////////////// - -class DispiroImpl { - constructor(bindings, args) { - this.bindings = bindings; - this.args = args; - } - applyToGlyph(glyph) { - const gizmo = glyph.gizmo || this.bindings.GlobalTransform; - const collector = new BiKnotCollector(gizmo, this.bindings.Contrast); - const { knots, closed } = prepareSpiroKnots(this.args, collector); - for (const knot of knots) { - collector.pushKnot(knot.type, knot.x, knot.y); - if (knot.af) knot.af.call(collector); - } - - const dsp = new DiSpiroProxy(closed, collector, knots); - glyph.includeGeometry(dsp.geometry); - return dsp; - } -} - -class SpiroOutlineImpl { - constructor(bindings, args) { - this.bindings = bindings; - this.args = args; - } - - applyToGlyph(glyph) { - const gizmo = glyph.gizmo || this.bindings.GlobalTransform; - const g = new CurveUtil.BezToContoursSink(gizmo); - const { knots, closed } = prepareSpiroKnots(this.args, g); - return glyph.includeGeometry(new SpiroGeometry(gizmo, closed, knots)); - } -} - -class DiSpiroProxy { - constructor(closed, collector, origKnots) { - this.geometry = new DiSpiroGeometry( - collector.gizmo, - collector.contrast, - closed, - collector.controlKnots - ); - this.m_origKnots = origKnots; - } - - get knots() { - return this.m_origKnots; - } - get lhsKnots() { - return this.geometry.expand().lhs; - } - get rhsKnots() { - return this.geometry.expand().rhs; - } -} - -function prepareSpiroKnots(_knots, s) { - let knots = [..._knots]; - while (knots[0] && knots[0] instanceof Function) { - knots[0].call(s); - knots.splice(0, 1); - } - const closed = dropTailKnot(knots); - knots = flatten(s, knots); - return { knots, closed }; -} - -function dropTailKnot(knots) { - let last = knots[knots.length - 1]; - if (last && (last.type === "close" || last.type === "end")) { - knots.length = knots.length - 1; - return last.type === "close"; - } else { - return false; - } -} - -function flatten(s, knots0) { - let knots = []; - flattenImpl(knots, knots0); - let unwrapped = false; - for (let j = 0; j < knots.length; j = j + 1) - if (knots[j] && knots[j].type === "interpolate") { - const kBefore = knots[nCyclic(j - 1, knots.length)]; - const kAfter = knots[nCyclic(j + 1, knots.length)]; - knots[j] = knots[j].blender(kBefore, kAfter, knots[j]); - unwrapped = true; - } - if (unwrapped) return flatten(s, knots); - return knots; -} - -function flattenImpl(sink, knots) { - for (const p of knots) { - if (p instanceof Array) flattenImpl(sink, p); - else sink.push(p); - } -} - -function nCyclic(p, n) { - return (p + n + n) % n; -} diff --git a/font-src/merge-cache.js b/font-src/merge-cache.js deleted file mode 100644 index b6c761b94..000000000 --- a/font-src/merge-cache.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; - -const Caching = require("./gen/caching/index"); - -module.exports = async function main(argv) { - await Caching.merge(argv.base, argv.diff, argv.version, argv.freshAgeKey); -}; diff --git a/font-src/merge-cache.mjs b/font-src/merge-cache.mjs new file mode 100644 index 000000000..7276b0006 --- /dev/null +++ b/font-src/merge-cache.mjs @@ -0,0 +1,5 @@ +import * as Caching from "./gen/caching/index.mjs"; + +export default (async function main(argv) { + await Caching.merge(argv.base, argv.diff, argv.version, argv.freshAgeKey); +}); diff --git a/font-src/meta/aesthetics.ptl b/font-src/meta/aesthetics.ptl index 10ffc9c80..55ec6c9d4 100644 --- a/font-src/meta/aesthetics.ptl +++ b/font-src/meta/aesthetics.ptl @@ -1,7 +1,7 @@ -import [Point] from '../support/geometry/point' -import [Transform] from '../support/geometry/transform' -import [Anchor] from '../support/geometry/anchor' -import [mix linreg clamp fallback] from '../support/utils' +import [Point] from"../support/geometry/point.mjs" +import [Transform] from"../support/geometry/transform.mjs" +import [Anchor] from"../support/geometry/anchor.mjs" +import [mix linreg clamp fallback] from"../support/utils.mjs" # Parameter generation export : define [calculateMetrics para] : begin diff --git a/font-src/meta/naming.ptl b/font-src/meta/naming.ptl index 06755b937..5c5fd0e19 100644 --- a/font-src/meta/naming.ptl +++ b/font-src/meta/naming.ptl @@ -1,8 +1,8 @@ -import as semver from 'semver' +import semver from 'semver' import [Ot] from "ot-builder" extern Buffer -import [fallback] from '../support/utils' +import [fallback] from"../support/utils.mjs" define COPYRIGHT 0 define FAMILY 1 diff --git a/font-src/otl/compat-ligature.ptl b/font-src/otl/compat-ligature.ptl index e322c3116..0ee9caed1 100644 --- a/font-src/otl/compat-ligature.ptl +++ b/font-src/otl/compat-ligature.ptl @@ -1,5 +1,5 @@ -import [Glyph] from '../support/glyph' -import [Transform] from '../support/geometry/transform' +import [Glyph] from"../support/glyph/index.mjs" +import [Transform] from"../support/geometry/transform.mjs" define GDEF_SIMPLE 1 define GDEF_LIGATURE 2 diff --git a/font-src/otl/gpos-mark-mkmk.ptl b/font-src/otl/gpos-mark-mkmk.ptl index 9d6d11a1d..7a7696d8c 100644 --- a/font-src/otl/gpos-mark-mkmk.ptl +++ b/font-src/otl/gpos-mark-mkmk.ptl @@ -1,4 +1,4 @@ -import [add-common-feature add-feature add-lookup] from "./table-util" +import [AddCommonFeature AddFeature AddLookup] from"./table-util.mjs" extern Set define MarkClasses { @@ -9,10 +9,10 @@ define MarkClasses { } export : define [buildMarkMkmk sink glyphStore] : begin - define mark : add-feature sink 'mark' - define mkmk : add-feature sink 'mkmk' - add-common-feature sink mark - add-common-feature sink mkmk + define mark : AddFeature sink 'mark' + define mkmk : AddFeature sink 'mkmk' + AddCommonFeature sink mark + AddCommonFeature sink mkmk local markLookupNames {} local mkmkLookupNames {} @@ -20,12 +20,12 @@ export : define [buildMarkMkmk sink glyphStore] : begin foreach markCls [items-of MarkClasses] : begin local [object markLookup mkmkLookup] : createMTLookups glyphStore { markCls } if ([objectIsNotEmpty markLookup.marks] && [objectIsNotEmpty markLookup.bases]) : begin - local lidMark : add-lookup sink markLookup + local lidMark : AddLookup sink markLookup mark.lookups.push lidMark markLookupNames.push lidMark if ([objectIsNotEmpty mkmkLookup.marks] && [objectIsNotEmpty mkmkLookup.bases]) : begin - local lidMkmk : add-lookup sink mkmkLookup + local lidMkmk : AddLookup sink mkmkLookup mkmk.lookups.push lidMkmk mkmkLookupNames.push lidMkmk diff --git a/font-src/otl/gsub-ccmp.ptl b/font-src/otl/gsub-ccmp.ptl index 2a4781e7c..1602151ab 100644 --- a/font-src/otl/gsub-ccmp.ptl +++ b/font-src/otl/gsub-ccmp.ptl @@ -1,6 +1,6 @@ -import [add-common-feature add-feature add-lookup add-feature-lookup ChainRuleBuilder BeginLookupBlock EndLookupBlock UkMapToLookup UkMap2ToLookup] from "./table-util" -import [AnyCv Dotless TieMark TieGlyph CcmpDecompose] from "../support/gr" -import as UnicodeKnowledge from "../meta/unicode-knowledge" +import [AddCommonFeature AddFeature AddLookup AdeFeatureLookup ChainRuleBuilder BeginLookupBlock EndLookupBlock UkMapToLookup UkMap2ToLookup] from"./table-util.mjs" +import [AnyCv Dotless TieMark TieGlyph CcmpDecompose] from"../support/gr.mjs" +import as UnicodeKnowledge from"../meta/unicode-knowledge.mjs" extern Set @@ -10,7 +10,7 @@ define-operator "~>" 880 'right' : syntax-rules export : define [buildCCMP sink glyphStore markGlyphs] : begin local rec : BeginLookupBlock sink - define ccmp : add-feature sink 'ccmp' + define ccmp : AddFeature sink 'ccmp' define {chain-rule} : ChainRuleBuilder sink define groupGrekUpperTonos {} @@ -102,7 +102,7 @@ export : define [buildCCMP sink glyphStore markGlyphs] : begin e.push ('toneSandhiMid' + toneStart + toneMid + toneEnd) return (f ~> e) - define lookupMarks1 : add-lookup sink : object + define lookupMarks1 : AddLookup sink : object .type 'gsub_chaining' .rules : list # Dot removal (max 6 middle marks are supported) @@ -131,22 +131,22 @@ export : define [buildCCMP sink glyphStore markGlyphs] : begin chain-rule groupTR markGlyphs.all markGlyphs.all markGlyphs.all markGlyphs.all markGlyphs.all [OgonekTrailing] chain-rule groupTR markGlyphs.all markGlyphs.all markGlyphs.all markGlyphs.all markGlyphs.all markGlyphs.all [OgonekTrailing] - define lookupMarks2 : add-lookup sink : object + define lookupMarks2 : AddLookup sink : object .type 'gsub_ligature' .substitutions : UkMap2ToLookup UnicodeKnowledge.markCompositionTf - define lookupMarks3 : add-lookup sink : object + define lookupMarks3 : AddLookup sink : object .type 'gsub_chaining' .rules : list chain-rule groupGrekUpperTonos [GrekUpperTonosTf] - define lookupCcmp-TieMarkLigature : add-lookup sink : object + define lookupCcmp-TieMarkLigature : AddLookup sink : object .type 'gsub_ligature' .substitutions : {}.concat TieMarkFrom.map : lambda [gnFrom idx] object [from {'cgj' gnFrom}] [to TieMarkTo.(idx)] - define lookupTieMarkContextual : add-lookup sink : object + define lookupTieMarkContextual : AddLookup sink : object .type 'gsub_chaining' .rules : list : object match {[TieGlyphs.concat TieMarkTo] {'cgj'} TieMarkFrom} @@ -154,7 +154,7 @@ export : define [buildCCMP sink glyphStore markGlyphs] : begin inputEnds 3 apply {{.at 1 .lookup lookupCcmp-TieMarkLigature}} - define lookupToneStart : add-lookup sink : object + define lookupToneStart : AddLookup sink : object .type 'gsub_chaining' .rules : list chain-rule [ToneToToneStart 0] {'tone0'} @@ -163,7 +163,7 @@ export : define [buildCCMP sink glyphStore markGlyphs] : begin chain-rule [ToneToToneStart 3] {'tone3'} chain-rule [ToneToToneStart 4] {'tone4'} - define lookupToneMid : add-lookup sink : object + define lookupToneMid : AddLookup sink : object .type 'gsub_chaining' .rules : list chain-rule [ToneStartOrMidAt 0] [ToneStartToToneMid 0] @@ -172,7 +172,7 @@ export : define [buildCCMP sink glyphStore markGlyphs] : begin chain-rule [ToneStartOrMidAt 3] [ToneStartToToneMid 3] chain-rule [ToneStartOrMidAt 4] [ToneStartToToneMid 4] - define lookupToneEnd : add-lookup sink : object + define lookupToneEnd : AddLookup sink : object .type 'gsub_chaining' .rules : list chain-rule [ToneStartOrMidAt 0] [ToneToToneEnd 0] @@ -181,7 +181,7 @@ export : define [buildCCMP sink glyphStore markGlyphs] : begin chain-rule [ToneStartOrMidAt 3] [ToneToToneEnd 3] chain-rule [ToneStartOrMidAt 4] [ToneToToneEnd 4] - define lookupToneSandhiStart : add-lookup sink : object + define lookupToneSandhiStart : AddLookup sink : object .type 'gsub_chaining' .rules : list chain-rule [ToneSandhiToToneStart 0] {'toneSandhi0'} @@ -190,7 +190,7 @@ export : define [buildCCMP sink glyphStore markGlyphs] : begin chain-rule [ToneSandhiToToneStart 3] {'toneSandhi3'} chain-rule [ToneSandhiToToneStart 4] {'toneSandhi4'} - define lookupToneSandhiMid : add-lookup sink : object + define lookupToneSandhiMid : AddLookup sink : object .type 'gsub_chaining' .rules : list chain-rule [ToneSandhiStartOrMidAt 0] [ToneSandhiStartToToneMid 0] @@ -199,7 +199,7 @@ export : define [buildCCMP sink glyphStore markGlyphs] : begin chain-rule [ToneSandhiStartOrMidAt 3] [ToneSandhiStartToToneMid 3] chain-rule [ToneSandhiStartOrMidAt 4] [ToneSandhiStartToToneMid 4] - define lookupToneSandhiEnd : add-lookup sink : object + define lookupToneSandhiEnd : AddLookup sink : object .type 'gsub_chaining' .rules : list chain-rule [ToneSandhiStartOrMidAt 0] [ToneSandhiToToneEnd 0] @@ -227,12 +227,12 @@ export : define [buildCCMP sink glyphStore markGlyphs] : begin if (parts && parts.length) : set decompositions.(gid) parts if [objectIsNotEmpty decompositions] : begin - define lookupCcmp-Decompose : add-lookup sink : object + define lookupCcmp-Decompose : AddLookup sink : object .type 'gsub_multiple' .substitutions decompositions - add-feature-lookup ccmp lookupCcmp-Decompose + AdeFeatureLookup ccmp lookupCcmp-Decompose - add-common-feature sink ccmp + AddCommonFeature sink ccmp EndLookupBlock rec sink define [objectIsNotEmpty obj] : obj && [Object.keys obj].length diff --git a/font-src/otl/gsub-cv-ss.ptl b/font-src/otl/gsub-cv-ss.ptl index 1f34a868b..5f5c758ab 100644 --- a/font-src/otl/gsub-cv-ss.ptl +++ b/font-src/otl/gsub-cv-ss.ptl @@ -1,5 +1,5 @@ -import [add-lookup add-common-feature pick-feature add-feature-lookup pick-lookup BeginLookupBlock EndLookupBlock ChainRuleBuilder] from "./table-util" -import [Cv AnyCv CvDecompose RightDependentLink RightDependentTrigger] from "../support/gr" +import [AddLookup AddCommonFeature PickFeature AdeFeatureLookup PickLookup BeginLookupBlock EndLookupBlock ChainRuleBuilder] from"./table-util.mjs" +import [Cv AnyCv CvDecompose RightDependentLink RightDependentTrigger] from"../support/gr.mjs" extern Map extern Set @@ -26,17 +26,17 @@ export : define [buildCVSS sink para glyphStore] : begin local parts : CvDecompose.get g if (parts && parts.length) : set decompositions.(gid) parts - define lookupNameCvDecompose : add-lookup sink : object + define lookupNameCvDecompose : AddLookup sink : object .type 'gsub_multiple' .substitutions decompositions define [addFeatureAndLookup tag lookupName init] : begin - define feature : pick-feature sink [FeatureName tag] - add-common-feature sink feature + define feature : PickFeature sink [FeatureName tag] + AddCommonFeature sink feature - define lookup : pick-lookup sink lookupName init - add-feature-lookup feature lookupNameCvDecompose - add-feature-lookup feature lookupName + define lookup : PickLookup sink lookupName init + AdeFeatureLookup feature lookupNameCvDecompose + AdeFeatureLookup feature lookupName sink.lookupDep.push { lookupNameCvDecompose lookupName } cvLookupNameSet.add lookupName @@ -49,7 +49,7 @@ export : define [buildCVSS sink para glyphStore] : begin addFeatureAndLookup gr.tag lookupName {.type 'gsub_alternate' .substitutions {.}} cvLookupNameSet.add lookupName - local st [pick-lookup sink lookupName].substitutions + local st [PickLookup sink lookupName].substitutions if [not st.(gn)] : set st.(gn) { } set st.(gn).(gr.rank - 1) : glyphStore.ensureExists : gr.get glyph @@ -60,7 +60,7 @@ export : define [buildCVSS sink para glyphStore] : begin addFeatureAndLookup composition.tag lookupName {.type 'gsub_single' .substitutions {.}} cvLookupNameSet.add lookupName - define st [pick-lookup sink lookupName].substitutions + define st [PickLookup sink lookupName].substitutions define decomp : composition.decompose para para.variants.selectorTree foreach { prime pv } [items-of decomp] : if (pv.tag && pv.rank) : begin local gr : Cv pv.tag pv.rank @@ -70,7 +70,7 @@ export : define [buildCVSS sink para glyphStore] : begin # If there are holes in the alternates list, fill them foreach lutn cvLookupNameSet : begin - local st [pick-lookup sink lutn].substitutions + local st [PickLookup sink lutn].substitutions foreach { k v } [pairs-of st] : foreach idx [range 0 v.length] : if [not v.(idx)] set v.(idx) k diff --git a/font-src/otl/gsub-frac.ptl b/font-src/otl/gsub-frac.ptl index 979220b22..f3717af33 100644 --- a/font-src/otl/gsub-frac.ptl +++ b/font-src/otl/gsub-frac.ptl @@ -1,5 +1,5 @@ -import [add-common-feature add-feature add-lookup BeginLookupBlock EndLookupBlock ChainRuleBuilder] from "./table-util" -import [NumeratorForm DenominatorForm] from "../support/gr" +import [AddCommonFeature AddFeature AddLookup BeginLookupBlock EndLookupBlock ChainRuleBuilder] from"./table-util.mjs" +import [NumeratorForm DenominatorForm] from"../support/gr.mjs" define-operator "~>" 880 'right' : syntax-rules `(@l ~> @r) `{.left @l .right @r} @@ -8,10 +8,10 @@ define-operator "~>" 880 'right' : syntax-rules export : define [buildFrac sink glyphStore] : begin local rec : BeginLookupBlock sink - define frac : add-feature sink 'frac' + define frac : AddFeature sink 'frac' define { chain-rule reverse-rule } : ChainRuleBuilder sink - define subSolidus : add-lookup sink : object + define subSolidus : AddLookup sink : object .type 'gsub_single' .substitutions : object ['solidus' 'fractionBar'] ['slash' 'fractionBar'] @@ -27,12 +27,12 @@ export : define [buildFrac sink glyphStore] : begin numSet.push numForm denSet.push denForm - define subDen : add-lookup sink : object + define subDen : AddLookup sink : object .type 'gsub_chaining' .rules : list chain-rule [{'fractionBar'}.concat denSet] [digitSet ~> denSet] - define subNum : add-lookup sink : object + define subNum : AddLookup sink : object .type 'gsub_reverse' .rules : list reverse-rule [digitSet ~> numSet] [{'fractionBar'}.concat numSet] @@ -43,7 +43,7 @@ export : define [buildFrac sink glyphStore] : begin sink.lookupDep.push {subSolidus subDen} sink.lookupDep.push {subSolidus subNum} - add-common-feature sink frac + AddCommonFeature sink frac EndLookupBlock rec sink diff --git a/font-src/otl/gsub-gr.ptl b/font-src/otl/gsub-gr.ptl index 4d2d63e10..628098707 100644 --- a/font-src/otl/gsub-gr.ptl +++ b/font-src/otl/gsub-gr.ptl @@ -1,4 +1,4 @@ -import [add-common-feature add-feature add-lookup BeginLookupBlock EndLookupBlock] from "./table-util" +import [AddCommonFeature AddFeature AddLookup BeginLookupBlock EndLookupBlock] from"./table-util.mjs" # Name-driven feature pairs export : define [buildGrFeature sink glyphStore gr] : begin @@ -12,10 +12,10 @@ export : define [buildGrFeature sink glyphStore gr] : begin set mapping.(gnSrc) gnDst if [objectIsNotEmpty mapping] : begin - define lookup1 : add-lookup sink {.type 'gsub_single' .substitutions mapping} - define feature1 : add-feature sink gr.otlTag + define lookup1 : AddLookup sink {.type 'gsub_single' .substitutions mapping} + define feature1 : AddFeature sink gr.otlTag feature1.lookups.push lookup1 - add-common-feature sink feature1 + AddCommonFeature sink feature1 EndLookupBlock rec sink diff --git a/font-src/otl/gsub-ligation.ptl b/font-src/otl/gsub-ligation.ptl index f43cb94d6..0bf60b802 100644 --- a/font-src/otl/gsub-ligation.ptl +++ b/font-src/otl/gsub-ligation.ptl @@ -1,4 +1,4 @@ -import [add-common-feature add-feature ChainRuleBuilder BeginLookupBlock EndLookupBlock] from "./table-util" +import [AddCommonFeature AddFeature ChainRuleBuilder BeginLookupBlock EndLookupBlock] from"./table-util.mjs" extern Set define-operator "~>" 880 'right' : syntax-rules @@ -54,7 +54,7 @@ define [buildLigationsImpl sink para featureName mappedFeature rankedLookups] : define [hasLG ln] : [mappedFeature.indexOf ln] >= 0 - define feature : add-common-feature sink : add-feature sink featureName + define feature : AddCommonFeature sink : AddFeature sink featureName local lastLookupName null local lookupRank 0 diff --git a/font-src/otl/gsub-locl.ptl b/font-src/otl/gsub-locl.ptl index 420bedc2e..4ec9cfa55 100644 --- a/font-src/otl/gsub-locl.ptl +++ b/font-src/otl/gsub-locl.ptl @@ -1,17 +1,17 @@ -import [copy-language add-feature add-lookup BeginLookupBlock EndLookupBlock] from "./table-util" +import [CopyLanguage AddFeature AddLookup BeginLookupBlock EndLookupBlock] from"./table-util.mjs" export : define [buildLOCL sink para glyphStore] : begin local rec : BeginLookupBlock sink - define cyrlSRB : copy-language sink 'cyrl_SRB ' 'cyrl_DFLT' - define cyrlMKD : copy-language sink 'cyrl_MKD ' 'cyrl_DFLT' - define cyrlBGR : copy-language sink 'cyrl_BGR ' 'cyrl_DFLT' + define cyrlSRB : CopyLanguage sink 'cyrl_SRB ' 'cyrl_DFLT' + define cyrlMKD : CopyLanguage sink 'cyrl_MKD ' 'cyrl_DFLT' + define cyrlBGR : CopyLanguage sink 'cyrl_BGR ' 'cyrl_DFLT' # SRB - define loclSRB : add-feature sink 'locl' + define loclSRB : AddFeature sink 'locl' cyrlSRB.features.unshift loclSRB.name cyrlMKD.features.unshift loclSRB.name - loclSRB.lookups.push : add-lookup sink : object + loclSRB.lookups.push : AddLookup sink : object type 'gsub_single' substitutions : if para.isItalic object @@ -25,9 +25,9 @@ export : define [buildLOCL sink para glyphStore] : begin 'cyrl/be' : glyphStore.ensureExists 'cyrl/be.SRB' # BGR - define loclBGR : add-feature sink 'locl' + define loclBGR : AddFeature sink 'locl' cyrlBGR.features.unshift loclBGR.name - loclBGR.lookups.push : add-lookup sink : object + loclBGR.lookups.push : AddLookup sink : object type 'gsub_single' substitutions : object 'cyrl/ve' : glyphStore.ensureExists 'cyrl/ve.BGR' diff --git a/font-src/otl/gsub-thousands.ptl b/font-src/otl/gsub-thousands.ptl index d89dbb608..dc87a3cb5 100644 --- a/font-src/otl/gsub-thousands.ptl +++ b/font-src/otl/gsub-thousands.ptl @@ -1,4 +1,4 @@ -import [add-common-feature add-feature add-lookup ChainRuleBuilder query-related-glyphs BeginLookupBlock EndLookupBlock] from "./table-util" +import [AddCommonFeature AddFeature AddLookup ChainRuleBuilder QueryRelatedGlyphs BeginLookupBlock EndLookupBlock] from"./table-util.mjs" define-operator "~>" 880 'right' : syntax-rules `(@l ~> @r) `{.left @l .right @r} @@ -6,7 +6,7 @@ define-operator "~>" 880 'right' : syntax-rules export : define [buildGsubThousands sink para] : begin local rec : BeginLookupBlock sink - define Thousand : add-feature sink 'THND' + define Thousand : AddFeature sink 'THND' define {chain-rule reverse-rule} : ChainRuleBuilder sink define numberGlyphIDs { 'zero.lnum' 'one.lnum' 'two.lnum' 'three.lnum' 'four.lnum' @@ -15,7 +15,7 @@ export : define [buildGsubThousands sink para] : begin define [nd s] : numberGlyphIDs.map : lambda [x] "\(x).nd\(s)" - define lookupThousand1 : add-lookup sink : object + define lookupThousand1 : AddLookup sink : object .type 'gsub_chaining' .rules : list chain-rule ({'period'} ~> null) (numberGlyphIDs ~> [nd 2]) (numberGlyphIDs ~> null) (numberGlyphIDs ~> null) @@ -26,13 +26,13 @@ export : define [buildGsubThousands sink para] : begin chain-rule ([nd 4] ~> null) (numberGlyphIDs ~> [nd 3]) chain-rule ([nd 3] ~> null) (numberGlyphIDs ~> [nd 2]) - define lookupThousand2 : add-lookup sink : object + define lookupThousand2 : AddLookup sink : object .type 'gsub_chaining' .rules : list chain-rule (numberGlyphIDs ~> [nd 0]) (numberGlyphIDs ~> null) (numberGlyphIDs ~> null) (numberGlyphIDs ~> null) chain-rule ([nd 0] ~> null) (numberGlyphIDs ~> [nd 0]) - define lookupThousand3 : add-lookup sink : object + define lookupThousand3 : AddLookup sink : object .type 'gsub_reverse' .rules : list reverse-rule ([nd 0] ~> [nd 1]) ([nd 0] ~> null) @@ -45,5 +45,5 @@ export : define [buildGsubThousands sink para] : begin Thousand.lookups.push lookupThousand1 lookupThousand2 lookupThousand3 - add-common-feature sink Thousand + AddCommonFeature sink Thousand EndLookupBlock rec sink diff --git a/font-src/otl/index.ptl b/font-src/otl/index.ptl index 301975d17..a52952d39 100644 --- a/font-src/otl/index.ptl +++ b/font-src/otl/index.ptl @@ -1,17 +1,17 @@ import as toposort from 'toposort' -import as Gr from '../support/gr' +import as Gr from"../support/gr.mjs" -import [CreateEmptyTable finalizeTable MoveBackUtilityLookups] from "./table-util" +import [CreateEmptyTable FinalizeTable MoveBackUtilityLookups] from"./table-util.mjs" -import [buildLigations] from './gsub-ligation' -import [buildCCMP] from './gsub-ccmp' -import [buildGrFeature] from './gsub-gr' -import [buildFrac] from './gsub-frac' -import [buildCVSS] from './gsub-cv-ss' -import [buildLOCL] from './gsub-locl' -import [buildGsubThousands] from './gsub-thousands' -import [buildMarkMkmk] from "./gpos-mark-mkmk" -import [BuildCompatLigatures] from './compat-ligature' +import [buildLigations] from"./gsub-ligation.mjs" +import [buildCCMP] from"./gsub-ccmp.mjs" +import [buildGrFeature] from"./gsub-gr.mjs" +import [buildFrac] from"./gsub-frac.mjs" +import [buildCVSS] from"./gsub-cv-ss.mjs" +import [buildLOCL] from"./gsub-locl.mjs" +import [buildGsubThousands] from"./gsub-thousands.mjs" +import [buildMarkMkmk] from"./gpos-mark-mkmk.mjs" +import [BuildCompatLigatures] from"./compat-ligature.mjs" define GDEF_SIMPLE 1 define GDEF_LIGATURE 2 @@ -61,14 +61,14 @@ define [buildGSUB para glyphStore markGlyphs] : begin buildLOCL gsub para glyphStore MoveBackUtilityLookups gsub - finalizeTable gsub + FinalizeTable gsub return gsub # GPOS define [buildGPOS para glyphStore markGlyphs] : begin define gpos : CreateEmptyTable buildMarkMkmk gpos glyphStore - finalizeTable gpos + FinalizeTable gpos return gpos # GDEF diff --git a/font-src/otl/table-util.ptl b/font-src/otl/table-util.ptl index b7c839ba5..35671d878 100644 --- a/font-src/otl/table-util.ptl +++ b/font-src/otl/table-util.ptl @@ -1,27 +1,27 @@ -import as toposort from 'toposort' -import [AnyCv] from "../support/gr" +import toposort from 'toposort' +import [AnyCv] from"../support/gr.mjs" export : define [CreateEmptyTable] {.languages {.} .features {.} .lookups {.} .lookupDep {}} extern Map extern Set -export : define [pick-language sink tag] : begin +export : define [PickLanguage sink tag] : begin if sink.languages.(tag) : return sink.languages.(tag) define lang {.features {}} set sink.languages.(tag) lang return lang -export : define [copy-language sink tag tagFrom] : begin - define langFrom : pick-language sink tagFrom - define langTo : pick-language sink tag +export : define [CopyLanguage sink tag tagFrom] : begin + define langFrom : PickLanguage sink tagFrom + define langTo : PickLanguage sink tag foreach [feat : items-of langFrom.features] : langTo.features.push feat return langTo -export : define [add-lang-feature lang fea] : begin +export : define [AddLangFeature lang fea] : begin define index : lang.features.indexOf fea.name if (index < 0) : lang.features.push fea.name -export : define [add-feature sink tag] : begin +export : define [AddFeature sink tag] : begin define lookupArray {} local n 0 while true : begin @@ -30,17 +30,17 @@ export : define [add-feature sink tag] : begin return {.name (tag + '_' + n) .lookups lookupArray} set n : n + 1 -export : define [pick-feature sink name] : begin +export : define [PickFeature sink name] : begin if sink.features.(name) : return { .name name .lookups sink.features.(name) } define featObj { .name name .lookups {} } set sink.features.(name) featObj.lookups return featObj -export : define [add-feature-lookup fea lookupName] : begin +export : define [AdeFeatureLookup fea lookupName] : begin define index : fea.lookups.indexOf lookupName if (index < 0) : fea.lookups.push lookupName -export : define [add-lookup sink data _prefix] : begin +export : define [AddLookup sink data _prefix] : begin local prefix : _prefix || '_lut_' local n 0 while true : begin @@ -49,21 +49,21 @@ export : define [add-lookup sink data _prefix] : begin return (prefix + n) set n : n + 1 -export : define [pick-lookup sink name fallback] : begin +export : define [PickLookup sink name fallback] : begin if sink.lookups.(name) : return sink.lookups.(name) set sink.lookups.(name) fallback return sink.lookups.(name) -export : define [add-common-feature sink fea] : begin - define dfltDflt : pick-language sink 'DFLT_DFLT' - define latnDflt : pick-language sink 'latn_DFLT' - define grekDflt : pick-language sink 'grek_DFLT' - define cyrlDflt : pick-language sink 'cyrl_DFLT' +export : define [AddCommonFeature sink fea] : begin + define dfltDflt : PickLanguage sink 'DFLT_DFLT' + define latnDflt : PickLanguage sink 'latn_DFLT' + define grekDflt : PickLanguage sink 'grek_DFLT' + define cyrlDflt : PickLanguage sink 'cyrl_DFLT' - add-lang-feature dfltDflt fea - add-lang-feature latnDflt fea - add-lang-feature grekDflt fea - add-lang-feature cyrlDflt fea + AddLangFeature dfltDflt fea + AddLangFeature latnDflt fea + AddLangFeature grekDflt fea + AddLangFeature cyrlDflt fea return fea @@ -97,7 +97,7 @@ export : define [ChainRuleBuilder sink] : begin define [createNewLookup f t] : begin local subst {.} foreach [j : range 0 f.length] : set subst.(f.(j)) t.(j) - return : add-lookup sink {.type 'gsub_single' .substitutions subst} UtilityLookupPrefix + return : AddLookup sink {.type 'gsub_single' .substitutions subst} UtilityLookupPrefix define [getSubLookup left right] : piecewise [not right] null @@ -172,7 +172,7 @@ export : define [ChainRuleBuilder sink] : begin return {chain-rule reverse-rule} -export : define [query-related-glyphs glyphs para entries] : begin +export : define [QueryRelatedGlyphs glyphs para entries] : begin define sink {} foreach [gid : items-of entries] : if glyphs.(gid) : begin sink.push gid @@ -180,7 +180,7 @@ export : define [query-related-glyphs glyphs para entries] : begin sink.push : gr.get glyphs.(gid) return sink -export : define [finalizeTable table] : begin +export : define [FinalizeTable table] : begin set table.lookupOrder : toposort table.lookupDep foreach [{key lang} : pairs-of table.languages] : begin if lang.features : lang.features.sort diff --git a/font-src/support/geometry/anchor.js b/font-src/support/geometry/anchor.mjs similarity index 83% rename from font-src/support/geometry/anchor.js rename to font-src/support/geometry/anchor.mjs index 9e4daec54..46aa62989 100644 --- a/font-src/support/geometry/anchor.js +++ b/font-src/support/geometry/anchor.mjs @@ -1,6 +1,4 @@ -"use strict"; - -exports.Anchor = class Anchor { +export class Anchor { constructor(x, y) { this.x = x; this.y = y; @@ -13,4 +11,4 @@ exports.Anchor = class Anchor { const y = a.x * tfm.xy + a.y * tfm.yy + tfm.y; return new Anchor(x, y); } -}; +} diff --git a/font-src/support/geometry/box.js b/font-src/support/geometry/box.mjs similarity index 92% rename from font-src/support/geometry/box.js rename to font-src/support/geometry/box.mjs index daeaccac9..0d8778bb4 100644 --- a/font-src/support/geometry/box.js +++ b/font-src/support/geometry/box.mjs @@ -1,6 +1,4 @@ -"use strict"; - -const { mix } = require("../utils"); +import { mix } from "../utils.mjs"; class Box { constructor(t, b, l, r) { @@ -11,7 +9,6 @@ class Box { this.xMid = this.xMiddle = mix(l, r, 0.5); this.yMid = this.yMiddle = mix(b, t, 0.5); } - withTop(t) { return new Box(t, this.bottom, this.left, this.right); } @@ -24,14 +21,12 @@ class Box { withRight(r) { return new Box(this.top, this.bottom, this.left, r); } - withXPadding(d) { return new Box(this.top, this.bottom, this.left + d, this.right - d); } withYPadding(d) { return new Box(this.top - d, this.bottom + d, this.left, this.right); } - mixX(t) { return mix(this.left, this.right, t); } @@ -45,5 +40,4 @@ class Box { return mix(this.bottom, this.top, t); } } - -exports.Box = Box; +export { Box }; diff --git a/font-src/support/geometry/curve-util.js b/font-src/support/geometry/curve-util.mjs similarity index 85% rename from font-src/support/geometry/curve-util.js rename to font-src/support/geometry/curve-util.mjs index 55207df75..33fed0206 100644 --- a/font-src/support/geometry/curve-util.js +++ b/font-src/support/geometry/curve-util.mjs @@ -1,80 +1,21 @@ -"use strict"; - -const TypoGeom = require("typo-geom"); -const { Point } = require("./point"); -const { Transform } = require("./transform"); - -exports.SPIRO_PRECISION = 1 / 2; -exports.OCCURRENT_PRECISION = 1 / 16; -exports.GEOMETRY_PRECISION = 1 / 4; -exports.BOOLE_RESOLUTION = 0x4000; - -exports.OffsetCurve = class OffsetCurve { - constructor(bone, offset, contrast) { - this.bone = bone; - this.offset = offset; - this.contrast = contrast; - } - eval(t) { - const c = this.bone.eval(t); - const d = this.bone.derivative(t); - const absD = Math.hypot(d.x, d.y); - return { - x: c.x - (d.y / absD) * this.offset * this.contrast, - y: c.y + (d.x / absD) * this.offset - }; - } - derivative(t) { - const DELTA = 1 / 0x10000; - const forward = this.eval(t + DELTA); - const backward = this.eval(t - DELTA); - return { - x: (forward.x - backward.x) / (2 * DELTA), - y: (forward.y - backward.y) / (2 * DELTA) - }; - } -}; - -exports.ReverseCurve = class ReverseCurve { - constructor(original) { - this.m_original = original; - } - eval(t) { - return this.m_original.eval(1 - t); - } - derivative(t) { - return -this.m_original.derivative(1 - t); - } -}; - -exports.convertShapeToArcs = function convertShapeToArcs(shape) { - return shape.map(convertContourToArcs); -}; +import * as TypoGeom from "typo-geom"; +import { Point } from "./point.mjs"; +import { Transform } from "./transform.mjs"; function contourToRep(contour) { let c = []; for (const z of contour) c.push({ type: z.type, x: z.x, y: z.y }); return c; } -exports.shapeToRep = function (shape) { - return shape.map(contourToRep); -}; - function repToContour(contourRep) { let c = []; for (const z of contourRep) c.push(Point.fromXY(z.type, z.x, z.y)); return c; } -exports.repToShape = function (shapeRep) { - return shapeRep.map(repToContour); -}; - function convertContourToArcs(contour) { if (!contour || !contour.length) return []; - const newContour = []; let z0 = Point.from(Point.Type.Corner, contour[0]); - for (let j = 1; j < contour.length; j++) { const z = contour[j]; switch (z.type) { @@ -99,7 +40,6 @@ function convertContourToArcs(contour) { let zf = contour[j + 1] || contour[0]; const zfIsCorner = zf.type === Point.Type.contour; if (!zfIsCorner) zf = Point.from(Point.Type.Corner, zc).mix(0.5, zf); - newContour.push( new TypoGeom.Arcs.Bez3( z0, @@ -108,7 +48,6 @@ function convertContourToArcs(contour) { Point.from(Point.Type.Corner, zf) ) ); - z0 = zf; if (zfIsCorner) j++; break; @@ -124,11 +63,58 @@ function convertContourToArcs(contour) { } } } - return newContour; } - -exports.BezToContoursSink = class BezToContoursSink { +export const SPIRO_PRECISION = 1 / 2; +export const OCCURRENT_PRECISION = 1 / 16; +export const GEOMETRY_PRECISION = 1 / 4; +export const BOOLE_RESOLUTION = 0x4000; +export class OffsetCurve { + constructor(bone, offset, contrast) { + this.bone = bone; + this.offset = offset; + this.contrast = contrast; + } + eval(t) { + const c = this.bone.eval(t); + const d = this.bone.derivative(t); + const absD = Math.hypot(d.x, d.y); + return { + x: c.x - (d.y / absD) * this.offset * this.contrast, + y: c.y + (d.x / absD) * this.offset + }; + } + derivative(t) { + const DELTA = 1 / 0x10000; + const forward = this.eval(t + DELTA); + const backward = this.eval(t - DELTA); + return { + x: (forward.x - backward.x) / (2 * DELTA), + y: (forward.y - backward.y) / (2 * DELTA) + }; + } +} +export class ReverseCurve { + constructor(original) { + this.m_original = original; + } + eval(t) { + return this.m_original.eval(1 - t); + } + derivative(t) { + return -this.m_original.derivative(1 - t); + } +} +export function convertShapeToArcs(shape) { + return shape.map(convertContourToArcs); +} +export const shapeToRep = function (shape) { + return shape.map(contourToRep); +}; +export const repToShape = function (shapeRep) { + return shapeRep.map(repToContour); +}; +export class BezToContoursSink { constructor(gizmo) { this.gizmo = gizmo || Transform.Id(); this.contours = []; @@ -157,4 +143,4 @@ exports.BezToContoursSink = class BezToContoursSink { this.lastContour.push(Point.transformedXY(this.gizmo, Point.Type.CubicEnd, x2, y2)); this.lastContour.push(Point.transformedXY(this.gizmo, Point.Type.Corner, x, y)); } -}; +} diff --git a/font-src/support/geometry/index.js b/font-src/support/geometry/index.mjs similarity index 93% rename from font-src/support/geometry/index.js rename to font-src/support/geometry/index.mjs index 51b9c651f..a19f44448 100644 --- a/font-src/support/geometry/index.js +++ b/font-src/support/geometry/index.mjs @@ -1,14 +1,11 @@ -"use strict"; - -const crypto = require("crypto"); -const TypoGeom = require("typo-geom"); -const SpiroJs = require("spiro"); - -const CurveUtil = require("./curve-util"); -const Format = require("../util/formatter"); -const { Point } = require("./point"); -const { Transform } = require("./transform"); -const { SpiroExpander } = require("./spiro-expand"); +import crypto from "crypto"; +import * as TypoGeom from "typo-geom"; +import * as SpiroJs from "spiro"; +import * as CurveUtil from "./curve-util.mjs"; +import * as Format from "../util/formatter.mjs"; +import { Point } from "./point.mjs"; +import { Transform } from "./transform.mjs"; +import { SpiroExpander } from "./spiro-expand.mjs"; class GeometryBase { asContours() { @@ -33,7 +30,6 @@ class GeometryBase { return null; } } - class ContourGeometry extends GeometryBase { constructor(points) { super(); @@ -67,7 +63,6 @@ class ContourGeometry extends GeometryBase { return Format.struct(`ContourGeometry`, Format.list(this.m_points.map(Format.typedPoint))); } } - class SpiroGeometry extends GeometryBase { constructor(gizmo, closed, knots) { super(); @@ -110,28 +105,22 @@ class SpiroGeometry extends GeometryBase { ); } } - class DiSpiroGeometry extends GeometryBase { constructor(gizmo, contrast, closed, biKnots) { super(); - this.m_biKnots = []; for (const k of biKnots) this.m_biKnots.push(k.clone()); - this.m_closed = closed; this.m_gizmo = gizmo; this.m_contrast = contrast; - this.m_cachedExpansionResults = null; this.m_cachedContours = null; } - asContours() { if (this.m_cachedContours) return this.m_cachedContours; const expandResult = this.expand(); const lhs = [...expandResult.lhs]; const rhs = [...expandResult.rhs]; - let rawGeometry; if (this.m_closed) { rawGeometry = new CombineGeometry([ @@ -161,7 +150,6 @@ class DiSpiroGeometry extends GeometryBase { this.m_cachedExpansionResults = expander.expand(); return this.m_cachedExpansionResults; } - asReferences() { return null; } @@ -177,7 +165,6 @@ class DiSpiroGeometry extends GeometryBase { } return this.m_biKnots.length; } - toShapeStringOrNull() { return Format.struct( "DiSpiroGeometry", @@ -188,7 +175,6 @@ class DiSpiroGeometry extends GeometryBase { ); } } - class ReferenceGeometry extends GeometryBase { constructor(glyph, x, y) { super(); @@ -231,7 +217,6 @@ class ReferenceGeometry extends GeometryBase { return Format.struct("ReferenceGeometry", sTarget, Format.n(this.m_x), Format.n(this.m_y)); } } - class TaggedGeometry extends GeometryBase { constructor(g, tag) { super(); @@ -261,7 +246,6 @@ class TaggedGeometry extends GeometryBase { return this.m_geom.toShapeStringOrNull(); } } - class TransformedGeometry extends GeometryBase { constructor(g, tfm) { super(); @@ -281,7 +265,6 @@ class TransformedGeometry extends GeometryBase { if (!Transform.isTranslate(this.m_transform)) return null; const rs = this.m_geom.asReferences(); if (!rs) return null; - let result = []; for (const { glyph, x, y } of rs) result.push({ glyph, x: x + this.m_transform.x, y: y + this.m_transform.y }); @@ -324,7 +307,6 @@ class TransformedGeometry extends GeometryBase { return Format.struct("TransformedGeometry", sTarget, Format.gizmo(this.m_transform)); } } - class CombineGeometry extends GeometryBase { constructor(parts) { super(); @@ -373,7 +355,6 @@ class CombineGeometry extends GeometryBase { let s = 0; for (const part of this.m_parts) s += part.measureComplexity(); } - unlinkReferences() { let parts = []; for (const part of this.m_parts) { @@ -396,7 +377,6 @@ class CombineGeometry extends GeometryBase { return Format.struct("CombineGeometry", Format.list(sParts)); } } - class BooleanGeometry extends GeometryBase { constructor(operator, operands) { super(); @@ -411,7 +391,6 @@ class BooleanGeometry extends GeometryBase { } asContoursImpl() { if (this.m_operands.length === 0) return []; - let arcs = CurveUtil.convertShapeToArcs(this.m_operands[0].asContours()); if (this.m_operands.length === 1) { arcs = TypoGeom.Boolean.removeOverlap( @@ -456,7 +435,6 @@ class BooleanGeometry extends GeometryBase { unlinkReferences() { if (this.m_operands.length === 0) return new CombineGeometry([]); if (this.m_operands.length === 1) return this.m_operands[0].unlinkReferences(); - let operands = []; for (const operand of this.m_operands) { operands.push(operand.unlinkReferences()); @@ -473,13 +451,6 @@ class BooleanGeometry extends GeometryBase { return Format.struct("BooleanGeometry", this.m_operator, Format.list(sParts)); } } - -exports.hashGeometry = function (geom) { - const s = geom.toShapeStringOrNull(); - if (!s) return null; - return crypto.createHash("sha256").update(s).digest("hex"); -}; - function combineWith(a, b) { if (a instanceof CombineGeometry) { return a.with(b); @@ -487,15 +458,18 @@ function combineWith(a, b) { return new CombineGeometry([a, b]); } } - -exports.GeometryBase = GeometryBase; -exports.SpiroGeometry = SpiroGeometry; -exports.DiSpiroGeometry = DiSpiroGeometry; -exports.ContourGeometry = ContourGeometry; -exports.ReferenceGeometry = ReferenceGeometry; -exports.TaggedGeometry = TaggedGeometry; -exports.TransformedGeometry = TransformedGeometry; -exports.CombineGeometry = CombineGeometry; -exports.BooleanGeometry = BooleanGeometry; - -exports.combineWith = combineWith; +export const hashGeometry = function (geom) { + const s = geom.toShapeStringOrNull(); + if (!s) return null; + return crypto.createHash("sha256").update(s).digest("hex"); +}; +export { GeometryBase }; +export { SpiroGeometry }; +export { DiSpiroGeometry }; +export { ContourGeometry }; +export { ReferenceGeometry }; +export { TaggedGeometry }; +export { TransformedGeometry }; +export { CombineGeometry }; +export { BooleanGeometry }; +export { combineWith }; diff --git a/font-src/support/geometry/point.js b/font-src/support/geometry/point.mjs similarity index 96% rename from font-src/support/geometry/point.js rename to font-src/support/geometry/point.mjs index d3ff2aad9..cf347e1e1 100644 --- a/font-src/support/geometry/point.js +++ b/font-src/support/geometry/point.mjs @@ -1,5 +1,3 @@ -"use strict"; - class Point { constructor(type, x, y) { this.type = type; @@ -31,7 +29,6 @@ class Point { round(d) { return new Point(this.type, Math.round(d * this.x) / d, Math.round(d * this.y) / d); } - static from(type, z) { return new Point(type, z.x || 0, z.y || 0); } @@ -61,12 +58,10 @@ class Point { return new Point(z.type, z.x + dx || 0, z.y + dy || 0); } } - Point.Type = { Corner: 0, CubicStart: 1, CubicEnd: 2, Quadratic: 3 }; - -exports.Point = Point; +export { Point }; diff --git a/font-src/support/geometry/spiro-expand.js b/font-src/support/geometry/spiro-expand.mjs similarity index 96% rename from font-src/support/geometry/spiro-expand.js rename to font-src/support/geometry/spiro-expand.mjs index 0080e248e..ff22159ca 100644 --- a/font-src/support/geometry/spiro-expand.js +++ b/font-src/support/geometry/spiro-expand.mjs @@ -1,9 +1,6 @@ -"use strict"; - -const SpiroJs = require("spiro"); - -const { linreg } = require("../utils"); -const Format = require("../util/formatter"); +import * as SpiroJs from "spiro"; +import { linreg } from "../utils.mjs"; +import * as Format from "../util/formatter.mjs"; class BiKnot { constructor(type, x, y, d1, d2) { @@ -23,7 +20,6 @@ class BiKnot { k1.unimportant = this.unimportant; return k1; } - toShapeString() { return Format.tuple( this.type, @@ -41,17 +37,14 @@ class BiKnot { ); } } - class BiKnotCollector { constructor(gizmo, contrast) { this.gizmo = gizmo; this.contrast = contrast; - this.controlKnots = []; this.defaultD1 = 0; this.defaultD2 = 0; } - pushKnot(type, x, y) { const tfZ = this.gizmo.applyXY(x, y); const k0 = this.controlKnots[this.controlKnots.length - 1]; @@ -61,7 +54,6 @@ class BiKnotCollector { this.controlKnots.push(new BiKnot(type, tfZ.x, tfZ.y, this.defaultD1, this.defaultD2)); } } - setWidth(l, r) { const k0 = this.controlKnots[this.controlKnots.length - 1]; if (k0) { @@ -83,7 +75,6 @@ class BiKnotCollector { if (k0) k0.unimportant = 1; } } - class SpiroExpander { constructor(gizmo, contrast, closed, cks) { this.gizmo = gizmo; @@ -91,12 +82,10 @@ class SpiroExpander { this.closed = closed; this.controlKnots = cks; } - initializeNormals() { const normalRectifier = new NormalRectifier(this.controlKnots, this.gizmo); SpiroJs.spiroToArcsOnContext(this.controlKnots, this.closed, normalRectifier); } - iterateNormals() { const centerBone = this.getPass2Knots(); const normalRectifier = new NormalRectifier(this.controlKnots, this.gizmo); @@ -117,7 +106,6 @@ class SpiroExpander { } return middles; } - expand() { const lhs = [], rhs = []; @@ -137,12 +125,10 @@ class SpiroExpander { y: 0 }; } - // Create important knots for (let j = 0; j < this.controlKnots.length; j++) { const knot = this.controlKnots[j]; if (knot.unimportant) continue; - let dx, dy; if (knot.proposedNormal) { dx = knot.proposedNormal.x; @@ -153,14 +139,12 @@ class SpiroExpander { } lhs[j].x = knot.x + knot.d1 * dx; lhs[j].y = knot.y + knot.d1 * dy; - rhs[j].x = knot.x - knot.d2 * dx; rhs[j].y = knot.y - knot.d2 * dy; } this.interpolateUnimportantKnots(lhs, rhs); return { lhs, rhs }; } - interpolateUnimportantKnots(lhs, rhs) { for (let j = 0; j < this.controlKnots.length; j++) { const knot = this.controlKnots[j]; @@ -168,7 +152,6 @@ class SpiroExpander { let jBefore, jAfter; for (jBefore = j - 1; cyNth(this.controlKnots, jBefore).unimportant; jBefore--); for (jAfter = j + 1; cyNth(this.controlKnots, jAfter).unimportant; jAfter++); - const knotBefore = this.gizmo.unapply(cyNth(this.controlKnots, jBefore)), knotAfter = this.gizmo.unapply(cyNth(this.controlKnots, jAfter)), ref = this.gizmo.unapply(knot), @@ -176,7 +159,6 @@ class SpiroExpander { lhsAfter = this.gizmo.unapply(cyNth(lhs, jAfter)), rhsBefore = this.gizmo.unapply(cyNth(rhs, jBefore)), rhsAfter = this.gizmo.unapply(cyNth(rhs, jAfter)); - const lhsTf = this.gizmo.applyXY( linreg(knotBefore.x, lhsBefore.x, knotAfter.x, lhsAfter.x, ref.x), linreg(knotBefore.y, lhsBefore.y, knotAfter.y, lhsAfter.y, ref.y) @@ -185,20 +167,17 @@ class SpiroExpander { linreg(knotBefore.x, rhsBefore.x, knotAfter.x, rhsAfter.x, ref.x), linreg(knotBefore.y, rhsBefore.y, knotAfter.y, rhsAfter.y, ref.y) ); - (lhs[j].x = lhsTf.x), (lhs[j].y = lhsTf.y); (rhs[j].x = rhsTf.x), (rhs[j].y = rhsTf.y); } } } - class NormalRectifier { constructor(stage1ControlKnots, gizmo) { this.gizmo = gizmo; this.controlKnots = stage1ControlKnots; this.nKnotsProcessed = 0; } - beginShape() {} endShape() {} moveTo(x, y) { @@ -224,7 +203,6 @@ class NormalRectifier { this.nKnotsProcessed += 1; } } - function isTangentValid(d) { return isFinite(d.x) && isFinite(d.y); } @@ -240,6 +218,5 @@ function reverseKnotType(ty) { function cyNth(a, j) { return a[j % a.length]; } - -exports.BiKnotCollector = BiKnotCollector; -exports.SpiroExpander = SpiroExpander; +export { BiKnotCollector }; +export { SpiroExpander }; diff --git a/font-src/support/geometry/transform.js b/font-src/support/geometry/transform.mjs similarity index 96% rename from font-src/support/geometry/transform.js rename to font-src/support/geometry/transform.mjs index fad35d759..6cd539166 100644 --- a/font-src/support/geometry/transform.js +++ b/font-src/support/geometry/transform.mjs @@ -1,6 +1,4 @@ -"use strict"; - -exports.Transform = class Transform { +export class Transform { constructor(xx, yx, xy, yy, x, y) { this.xx = xx; this.yx = yx; @@ -9,15 +7,12 @@ exports.Transform = class Transform { this.x = x; this.y = y; } - static Id() { return new Transform(1, 0, 0, 1, 0, 0); } - static Translate(x, y) { return new Transform(1, 0, 0, 1, x, y); } - apply(pt) { return this.applyXY(pt.x, pt.y); } @@ -56,11 +51,9 @@ exports.Transform = class Transform { -(-this.x * this.xy + this.y * this.xx) / denom ); } - toString() { return `[[${this.xx} ${this.xy}] [${this.yx} ${this.yy}]] + [[${this.x}] [${this.y}]]`; } - static isTranslate(tfm) { return tfm.xx === 1 && tfm.yy === 1 && tfm.xy === 0 && tfm.yx === 0; } @@ -85,4 +78,4 @@ exports.Transform = class Transform { z00.y ); } -}; +} diff --git a/font-src/support/glyph-block.js b/font-src/support/glyph-block.mjs similarity index 90% rename from font-src/support/glyph-block.js rename to font-src/support/glyph-block.mjs index 6763837c7..5166c702e 100644 --- a/font-src/support/glyph-block.js +++ b/font-src/support/glyph-block.mjs @@ -1,18 +1,14 @@ -"use strict"; - -exports.GlyphBlock = class GlyphBlock { +export class GlyphBlock { constructor(capture, blockName, body) { this.capture = capture; this.blockName = blockName; this.body = body; - this.resolved = false; this.exports = {}; } resolve() { if (this.resolved) return this.exports; this.resolved = true; - const pendingApplications = []; const ExportCapture = fnObj => { pendingApplications.push(() => { @@ -21,9 +17,8 @@ exports.GlyphBlock = class GlyphBlock { } }); }; - this.body(this.capture, ExportCapture); for (const f of pendingApplications) f(); return this.exports; } -}; +} diff --git a/font-src/support/glyph-store.js b/font-src/support/glyph-store.mjs similarity index 97% rename from font-src/support/glyph-store.js rename to font-src/support/glyph-store.mjs index 77fec3813..e8877ba30 100644 --- a/font-src/support/glyph-store.js +++ b/font-src/support/glyph-store.mjs @@ -1,13 +1,10 @@ -"use strict"; - -exports.GlyphStore = class GlyphStore { +export class GlyphStore { constructor() { this.nameForward = new Map(); this.nameBackward = new Map(); this.encodingForward = new Map(); this.encodingBackward = new Map(); } - get size() { return this.nameForward.size; } @@ -20,13 +17,11 @@ exports.GlyphStore = class GlyphStore { encodedEntries() { return this.encodingForward.entries(); } - *flattenCodes(g, flatteners) { { const codes = this.encodingBackward.get(g); if (codes) for (const c of codes) yield c; } - for (const gr of flatteners) { const gn = gr.get(g); if (!gn) continue; @@ -36,7 +31,6 @@ exports.GlyphStore = class GlyphStore { if (codes2) for (const c of codes2) yield c; } } - addGlyph(name, g) { this.nameForward.set(name, g); this.nameBackward.set(g, name); @@ -57,7 +51,6 @@ exports.GlyphStore = class GlyphStore { queryNameOf(g) { return this.nameBackward.get(g); } - deleteGlyph(g) { const name = this.nameBackward.get(g); this.nameBackward.delete(g); @@ -72,7 +65,6 @@ exports.GlyphStore = class GlyphStore { this.deleteUnicodeAssignmentsOf(g); } } - encodeGlyph(u, g) { this.encodingForward.set(u, g); let s = this.encodingBackward.get(g); @@ -108,7 +100,6 @@ exports.GlyphStore = class GlyphStore { if (s) for (const u of s) this.encodingForward.delete(u); this.encodingBackward.delete(g); } - filterByName(nameSet) { const gs1 = new GlyphStore(); for (const [name, g] of this.nameForward) { @@ -119,4 +110,4 @@ exports.GlyphStore = class GlyphStore { } return gs1; } -}; +} diff --git a/font-src/support/glyph/index.js b/font-src/support/glyph/index.mjs similarity index 95% rename from font-src/support/glyph/index.js rename to font-src/support/glyph/index.mjs index 196c6be55..8b00fc74b 100644 --- a/font-src/support/glyph/index.js +++ b/font-src/support/glyph/index.mjs @@ -1,41 +1,33 @@ -"use strict"; +import { Transform } from "../geometry/transform.mjs"; +import { Point } from "../geometry/point.mjs"; +import { Anchor } from "../geometry/anchor.mjs"; +import * as Geom from "../geometry/index.mjs"; -const { Transform } = require("../geometry/transform"); -const { Point } = require("../geometry/point"); -const { Anchor } = require("../geometry/anchor"); -const Geom = require("../geometry"); - -exports.Glyph = class Glyph { +export class Glyph { constructor(_identifier) { this._m_identifier = _identifier; - // Ranks this.glyphRank = 0; this.grRank = 0; this.codeRank = 0xffffffff; this.subRank = 0xffffffff; - // Geometry this.geometry = new Geom.CombineGeometry(); this.gizmo = Transform.Id(); - // Metrics this.advanceWidth = 500; this.markAnchors = {}; this.baseAnchors = {}; - // Tracking this.dependencies = []; this.ctxTag = null; } - get contours() { throw new TypeError("Glyph::contours has been deprecated"); } get semanticInclusions() { throw new TypeError("Glyph::semanticInclusions has been deprecated"); } - get name() { throw new TypeError("Glyph::name has been deprecated"); } @@ -77,11 +69,9 @@ exports.Glyph = class Glyph { } includeGlyph(g, copyAnchors, copyWidth) { if (g instanceof Function) throw new Error("Unreachable"); - // Combine anchors and get offset let shift = { x: 0, y: 0 }; this.combineMarks(g, shift); - this.includeGlyphImpl(g, shift.x, shift.y); if (g.isMarkSet) throw new Error("Invalid component to be introduced."); if (copyAnchors) this.copyAnchors(g); @@ -100,7 +90,6 @@ exports.Glyph = class Glyph { this.glyphRank = g.glyphRank; this.avoidBeingComposite = g.avoidBeingComposite; } - includeGeometry(g) { if (this.ctxTag) g = new Geom.TaggedGeometry(g, this.ctxTag); this.geometry = Geom.combineWith(this.geometry, g); @@ -114,7 +103,6 @@ exports.Glyph = class Glyph { ); } } - includeContours(cs, shiftX, shiftY) { let parts = []; for (const contour of cs) { @@ -124,7 +112,6 @@ exports.Glyph = class Glyph { } this.includeGeometry(new Geom.CombineGeometry(parts)); } - applyTransform(tfm, alsoAnchors) { this.geometry = new Geom.TransformedGeometry(this.geometry, tfm); if (alsoAnchors) { @@ -134,7 +121,6 @@ exports.Glyph = class Glyph { this.markAnchors[k] = Anchor.transform(tfm, this.markAnchors[k]); } } - tryBecomeMirrorOf(dst, rankSet) { if (rankSet.has(this) || rankSet.has(dst)) return; const csThis = this.geometry.unlinkReferences().toShapeStringOrNull(); @@ -144,14 +130,12 @@ exports.Glyph = class Glyph { rankSet.add(this); } } - clearGeometry() { this.geometry = new Geom.CombineGeometry(); } ejectTagged(tag) { this.geometry = this.geometry.filterTag(t => tag !== t); } - // Anchors combineMarks(g, shift) { if (!g.markAnchors) return; @@ -198,4 +182,4 @@ exports.Glyph = class Glyph { deleteMarkAnchor(id) { delete this.markAnchors[id]; } -}; +} diff --git a/font-src/support/gr.js b/font-src/support/gr.mjs similarity index 90% rename from font-src/support/gr.js rename to font-src/support/gr.mjs index 5f630fb42..85b9a7c7e 100644 --- a/font-src/support/gr.js +++ b/font-src/support/gr.mjs @@ -1,6 +1,4 @@ -"use strict"; - -const crypto = require("crypto"); +import crypto from "crypto"; const Dotless = { tag: "dtls", @@ -17,7 +15,6 @@ const Dotless = { return name + ".dotless"; } }; - function SimpleProp(key) { return { get(glyph) { @@ -31,11 +28,9 @@ function SimpleProp(key) { } }; } - const LowerYDotAtBelow = SimpleProp("LowerYDotAtBelow"); const RightDependentTrigger = SimpleProp("RightDependentTrigger"); const MathSansSerif = SimpleProp("MathSansSerif"); - function DependentLinkProp(key) { return { get(glyph, subKey) { @@ -57,13 +52,10 @@ function DependentLinkProp(key) { } }; } - const RightDependentLink = DependentLinkProp("RightDependentLink"); - function OtlTaggedProp(key, otlTag) { return { ...SimpleProp(key), otlTag }; } - const Nwid = OtlTaggedProp("Nwid", "NWID"); const Wwid = OtlTaggedProp("Wwid", "WWID"); const Lnum = OtlTaggedProp("Lnum", "lnum"); @@ -71,7 +63,6 @@ const Onum = OtlTaggedProp("Onum", "onum"); const AplForm = OtlTaggedProp("AplForm", "APLF"); const NumeratorForm = OtlTaggedProp("Numerator", "numr"); const DenominatorForm = OtlTaggedProp("Denominator", "dnom"); - function DecompositionProp(key) { return { get(glyph) { @@ -85,11 +76,9 @@ function DecompositionProp(key) { } }; } - const CvDecompose = DecompositionProp("CvDecompose"); const PseudoCvDecompose = DecompositionProp("PseudoCvDecompose"); const CcmpDecompose = DecompositionProp("CcmpDecompose"); - const TieMark = { tag: "TMRK", get(glyph) { @@ -108,7 +97,6 @@ const TieMark = { return name + ".tieMark"; } }; - const TieGlyph = { get(glyph) { if (glyph && glyph.related) return glyph.related.TieGlyph; @@ -120,7 +108,6 @@ const TieGlyph = { Joining.or(glyph, Joining.Classes.Mid); } }; - const Radical = { get(glyph) { if (glyph && glyph.related) return !!glyph.related.radical; @@ -131,7 +118,6 @@ const Radical = { glyph.related.radical = true; } }; - const RequireCcmpDecompose = { get(glyph) { if (glyph && glyph.related) return !!glyph.related.RequireCcmpDecompose; @@ -142,7 +128,6 @@ const RequireCcmpDecompose = { glyph.related.RequireCcmpDecompose = true; } }; - const Joining = { get(glyph) { if (glyph && glyph.related) return glyph.related.joining || 0; @@ -173,7 +158,6 @@ const Joining = { Mid: 3 } }; - const CvTagCache = new Map(); function Cv(tag, rank) { const key = tag + "#" + rank; @@ -213,14 +197,12 @@ function Cv(tag, rank) { CvTagCache.set(key, rel); return rel; } - const DotlessOrNot = { query(glyph) { if (Dotless.get(glyph)) return [Dotless]; return null; } }; - const AnyCv = { query(glyph) { let ret = []; @@ -235,7 +217,6 @@ const AnyCv = { return ret; } }; - const AnyDerivingCv = { query(glyph) { let ret = []; @@ -261,14 +242,11 @@ const AnyDerivingCv = { return false; } }; - function getGrTreeImpl(gid, grSetList, fnGidToGlyph, sink) { if (!grSetList.length) return; const g = fnGidToGlyph(gid); if (!g) return; - const grs = grSetList[0].query(g); - getGrTreeImpl(gid, grSetList.slice(1), fnGidToGlyph, sink); if (grs && grs.length) { for (const gr of grs) { @@ -283,7 +261,6 @@ function getGrTree(gid, grSetList, fnGidToGlyph) { getGrTreeImpl(gid, grSetList, fnGidToGlyph, sink); return sink; } - function gidListSame(a, b) { for (let j = 0; j < a.length; j++) { if (a[j] !== b[j]) return false; @@ -303,7 +280,6 @@ function gidListMap(gidList, gr, fnGidToGlyph) { if (effective) return gidList1; else return null; } - function collectGidLists(gidListOrig, gidList, grl, excluded, fnGidToGlyph, sink) { if (!grl.length) { sink.push(gidList); @@ -319,16 +295,13 @@ function collectGidLists(gidListOrig, gidList, grl, excluded, fnGidToGlyph, sink } } } - function getGrMesh(gidList, grq, fnGidToGlyph) { if (typeof gidList === "string" || !Array.isArray(gidList)) throw new TypeError(`glyphs must be a glyph array!`); - const allGrSet = new Set(); for (const g of gidList) { for (const gr of grq.query(fnGidToGlyph(g))) allGrSet.add(gr); } - const allGrList = Array.from(allGrSet); let ret = []; for (const gr of allGrList) { @@ -342,20 +315,16 @@ function getGrMesh(gidList, grq, fnGidToGlyph) { } } } - return ret; } - function createGrDisplaySheet(glyphStore, gid) { const glyph = glyphStore.queryByName(gid); if (!glyph) return []; - // Query selected typographic features -- mostly NWID and WWID let typographicFeatures = []; displayQueryPairFeatures(glyphStore, gid, Nwid, Wwid, typographicFeatures); displayQueryPairFeatures(glyphStore, gid, Lnum, Onum, typographicFeatures); displayQuerySingleFeature(glyphStore, gid, AplForm, typographicFeatures); - let charVariantFeatures = []; const decomposition = CvDecompose.get(glyph) || PseudoCvDecompose.get(glyph); if (decomposition) { @@ -368,7 +337,6 @@ function createGrDisplaySheet(glyphStore, gid) { } else { queryCvFeatureTagsOf(charVariantFeatures, gid, glyph, null); } - return [typographicFeatures, charVariantFeatures]; } function displayQueryPairFeatures(gs, gid, grCis, grTrans, sink) { @@ -389,7 +357,6 @@ function displayQuerySingleFeature(gs, gid, grCis, sink) { sink.push(`'${grCis.otlTag}' 0`, `'${grCis.otlTag}' 1`); } } - function byTagPreference(a, b) { const ua = a.tag.toUpperCase(), ub = b.tag.toUpperCase(); @@ -407,13 +374,11 @@ function queryCvFeatureTagsOf(sink, gid, glyph, variantAssignmentSet) { if (target === gid) continue; if (existingGlyphs.has(target)) continue; existingGlyphs.add(target); - let g = m.get(tag); if (!g) { g = []; m.set(tag, g); } - const assignCss = `'${tag}' ${gr.rank}`; if (!variantAssignmentSet) { g.push(assignCss); @@ -424,7 +389,6 @@ function queryCvFeatureTagsOf(sink, gid, glyph, variantAssignmentSet) { } for (const g of m.values()) if (g.length) sink.push(g); } - function linkSuffixGr(gs, suffix, gr) { const reSuffix = new RegExp("\\." + suffix + "$"); for (const [gnSuffixed, gSuffixed] of gs.namedEntries()) { @@ -448,7 +412,6 @@ function linkSuffixPairGr(gs, tagCis, tagTrans, grCis, grTrans) { } } } - function hashCv(g) { const hasher = crypto.createHash("sha256"); for (const gr of AnyCv.query(g)) { @@ -456,37 +419,34 @@ function hashCv(g) { } return hasher.digest("hex"); } - -exports.Dotless = Dotless; -exports.LowerYDotAtBelow = LowerYDotAtBelow; -exports.Cv = Cv; -exports.AnyCv = AnyCv; -exports.DotlessOrNot = DotlessOrNot; -exports.getGrTree = getGrTree; -exports.getGrMesh = getGrMesh; -exports.TieMark = TieMark; -exports.TieGlyph = TieGlyph; -exports.Radical = Radical; -exports.RequireCcmpDecompose = RequireCcmpDecompose; -exports.Joining = Joining; -exports.AnyDerivingCv = AnyDerivingCv; -exports.CcmpDecompose = CcmpDecompose; -exports.CvDecompose = CvDecompose; -exports.PseudoCvDecompose = PseudoCvDecompose; -exports.RightDependentLink = RightDependentLink; -exports.RightDependentTrigger = RightDependentTrigger; -exports.MathSansSerif = MathSansSerif; -exports.Nwid = Nwid; -exports.Wwid = Wwid; -exports.Lnum = Lnum; -exports.Onum = Onum; -exports.AplForm = AplForm; -exports.NumeratorForm = NumeratorForm; -exports.DenominatorForm = DenominatorForm; -exports.hashCv = hashCv; - -exports.createGrDisplaySheet = createGrDisplaySheet; -exports.linkSuffixGr = linkSuffixGr; -exports.linkSuffixPairGr = linkSuffixPairGr; - -exports.SvInheritableRelations = [RightDependentLink, RightDependentTrigger, Joining]; +export const SvInheritableRelations = [RightDependentLink, RightDependentTrigger, Joining]; +export { Dotless }; +export { LowerYDotAtBelow }; +export { Cv }; +export { AnyCv }; +export { DotlessOrNot }; +export { getGrTree }; +export { getGrMesh }; +export { TieMark }; +export { TieGlyph }; +export { Radical }; +export { RequireCcmpDecompose }; +export { Joining }; +export { AnyDerivingCv }; +export { CcmpDecompose }; +export { CvDecompose }; +export { PseudoCvDecompose }; +export { RightDependentLink }; +export { RightDependentTrigger }; +export { MathSansSerif }; +export { Nwid }; +export { Wwid }; +export { Lnum }; +export { Onum }; +export { AplForm }; +export { NumeratorForm }; +export { DenominatorForm }; +export { hashCv }; +export { createGrDisplaySheet }; +export { linkSuffixGr }; +export { linkSuffixPairGr }; diff --git a/font-src/support/ligation-data.js b/font-src/support/ligation-data.mjs similarity index 91% rename from font-src/support/ligation-data.js rename to font-src/support/ligation-data.mjs index 0082218bd..b794827fe 100644 --- a/font-src/support/ligation-data.js +++ b/font-src/support/ligation-data.mjs @@ -1,10 +1,15 @@ -"use strict"; +import * as Parameters from "./parameters.mjs"; -const Parameters = require("./parameters"); - -exports.applyLigationData = function (data, para, argv) { +function createBuildup(simple, buildup) { + let ligSet = new Set(); + for (const s of buildup) { + if (!simple[s]) throw new Error("Cannot find simple ligation group " + s); + ligSet.add(simple[s].ligGroup); + } + return Array.from(ligSet); +} +export const applyLigationData = function (data, para, argv) { const defaultBuildup = {}; - const hives = {}; hives["default"] = { caltBuildup: [] }; for (const gr in data.simple) { @@ -14,12 +19,10 @@ exports.applyLigationData = function (data, para, argv) { for (const gr in data.composite) { const comp = data.composite[gr]; if (!comp.tag) continue; - const ligSets = createBuildup(data.simple, comp.buildup); defaultBuildup[comp.tag] = ligSets; hives[`ligset-inherit-${gr}`] = { caltBuildup: ligSets }; } - para.ligation = { defaultBuildup, caltBuildup: [] @@ -41,12 +44,3 @@ exports.applyLigationData = function (data, para, argv) { ); } }; - -function createBuildup(simple, buildup) { - let ligSet = new Set(); - for (const s of buildup) { - if (!simple[s]) throw new Error("Cannot find simple ligation group " + s); - ligSet.add(simple[s].ligGroup); - } - return Array.from(ligSet); -} diff --git a/font-src/support/metric-override.js b/font-src/support/metric-override.mjs similarity index 97% rename from font-src/support/metric-override.js rename to font-src/support/metric-override.mjs index e3971ff06..fec06105e 100644 --- a/font-src/support/metric-override.js +++ b/font-src/support/metric-override.mjs @@ -1,8 +1,5 @@ -"use strict"; +import { monotonicInterpolate } from "./util/monotonic-interpolate.mjs"; -const { monotonicInterpolate } = require("./util/monotonic-interpolate"); - -exports.applyMetricOverride = applyMetricOverride; function applyMetricOverride(para, mo, argv) { const bindings = initBindings(para, argv); for (const [field, expr] of Object.entries(mo)) { @@ -22,7 +19,6 @@ function applyMetricOverride(para, mo, argv) { } } } - const validMetricOverrideFields = new Set([ "cap", "ascender", @@ -51,10 +47,8 @@ const validMetricOverrideFields = new Set([ "archDepth", "smallArchDepth" ]); - /////////////////////////////////////////////////////////////////////////////////////////////////// // Function bindings - function initBindings(para, argv) { const valueBindings = new Map(); for (const k of validMetricOverrideFields) { @@ -63,12 +57,10 @@ function initBindings(para, argv) { valueBindings.set("weight", argv.shape.weight); valueBindings.set("width", argv.shape.width); valueBindings.set("slopeAngle", argv.shape.slopeAngle); - const functionBindings = new Map(); functionBindings.set("blend", blend); return { val: valueBindings, functions: functionBindings }; } - function blend(against, ...pairs) { const xs = [], ys = []; @@ -77,7 +69,6 @@ function blend(against, ...pairs) { } return monotonicInterpolate(xs, ys)(against); } - /////////////////////////////////////////////////////////////////////////////////////////////////// // Simple expression parser class State { @@ -108,7 +99,6 @@ class State { throw new SyntaxError("Failed to parse expression: " + this.input + "@" + this.cp); } } - function RootExpression(state, bindings) { const e = Expression(state, bindings); state.expectEnd(); @@ -120,7 +110,6 @@ function Expression(state, bindings) { skipSpaces(state); return e; } - function Sum(state, bindings) { let f = Term(state, bindings); skipSpaces(state); @@ -159,7 +148,6 @@ function Term(state, bindings) { } return f; } - function Factor(state, bindings) { if (state.test("+")) { state.advance(); @@ -173,7 +161,6 @@ function Factor(state, bindings) { return Primitive(state, bindings); } } - function Primitive(state, bindings) { if (state.testCk(isDigit)) return Lit(state, bindings); if (state.testCk(isAlpha)) return BindingOrCall(state, bindings); @@ -181,7 +168,6 @@ function Primitive(state, bindings) { if (state.test("[")) return List("[", "]", state, bindings); state.fail(); } - function Lit(state, bindings) { let integerPart = 0; let fractionPart = 0; @@ -200,7 +186,6 @@ function Lit(state, bindings) { } return integerPart + fractionPart; } - function BindingOrCall(state, bindings) { let symbolName = ""; while (state.testCk(isAlpha)) symbolName += state.advance(); @@ -213,7 +198,6 @@ function BindingOrCall(state, bindings) { else throw new TypeError(`Unknown identifier ${symbolName}.`); } } - function Group(state, bindings) { state.expectAndAdvance("("); skipSpaces(state); @@ -237,11 +221,9 @@ function List(start, end, state, bindings) { state.expectAndAdvance(end); return results; } - function skipSpaces(state) { while (state.testCk(isSpace)) state.advance(); } - function isSpace(ch) { return ch === " " || ch === "\t"; } @@ -251,3 +233,4 @@ function isDigit(ch) { function isAlpha(ch) { return (ch >= "A" && ch <= "Z") || (ch >= "a" && ch <= "z") || ch === "_"; } +export { applyMetricOverride }; diff --git a/font-src/support/parameters.js b/font-src/support/parameters.mjs similarity index 95% rename from font-src/support/parameters.js rename to font-src/support/parameters.mjs index 98b9f1fe3..a8f200101 100644 --- a/font-src/support/parameters.js +++ b/font-src/support/parameters.mjs @@ -1,24 +1,18 @@ -"use strict"; +import { monotonicInterpolate } from "./util/monotonic-interpolate.mjs"; -const { monotonicInterpolate } = require("./util/monotonic-interpolate"); - -exports.init = initPara; function initPara(data, argv) { let para = {}; apply(para, data, ["iosevka"]); if (argv.shape.serifs) apply(para, data, ["serifs-" + argv.shape.serifs]); if (argv.shape.spacing) apply(para, data, ["spacing-" + argv.shape.spacing]); - applyBlendingParam(argv, para, data, "shapeWeight", "weight"); applyBlendingParam(argv, para, data, "shapeWidth", "width"); applyBlendingParam(argv, para, data, "shapeSlopeAngle", "slopeAngle"); applyAlternatesParam(argv, para, data, "slope", "slope"); - if (argv.featureControl.noCvSs) para.enableCvSs = false; if (argv.featureControl.noLigation) para.enableLigation = false; return para; } - function applyBlendingParam(argv, para, data, key, keyArgv) { applySingleBlendingParam(argv, para, data, key, keyArgv); if (argv.shape.serifs) @@ -35,19 +29,15 @@ function applyAlternatesParam(argv, para, data, key, keyArgv) { if (argv.shape.serifs) apply(para, data, [`${kBase}-serifs-${argv.shape.serifs}`]); if (argv.shape.spacing) apply(para, data, [`${kBase}-spacing-${argv.shape.spacing}`]); } - -exports.apply = apply; function apply(sink, parametersData, styles, blendArgs) { if (!styles) return; for (const item of styles) intro(parametersData, item, blendArgs, sink); } - // eslint-disable-next-line complexity function intro(source, style, blendArgs, sink) { let hive = source[style]; if (!hive) return; hive = { ...hive }; - if (hive.inherits) { for (const hn of hive.inherits) intro(source, hn, blendArgs, sink); delete hive.inherits; @@ -75,24 +65,18 @@ function intro(source, style, blendArgs, sink) { } delete hive.removes; } - hive = hiveBlend(hive, getBlendArg(blendArgs, style)); for (const k in hive) sink[k] = hive[k]; } - function getBlendArg(blendArgs, style) { if (!blendArgs) return undefined; return blendArgs[style]; } - function hiveBlend(hive, value) { if (!hive || !hive.blend || value == null) return hive; - const block = hive.blend; delete hive.blend; - const generatedHive = { ...hive }; - let keys = new Set(); for (const grade in block) { if (!isFinite(parseFloat(grade))) continue; @@ -101,7 +85,6 @@ function hiveBlend(hive, value) { keys.add(key); } } - for (const key of keys) { let xs = [], ys = []; @@ -115,3 +98,5 @@ function hiveBlend(hive, value) { } return generatedHive; } +export { initPara as init }; +export { apply }; diff --git a/font-src/support/util/formatter.js b/font-src/support/util/formatter.mjs similarity index 73% rename from font-src/support/util/formatter.js rename to font-src/support/util/formatter.mjs index a3fc04f98..409d9162f 100644 --- a/font-src/support/util/formatter.js +++ b/font-src/support/util/formatter.mjs @@ -1,5 +1,3 @@ -"use strict"; - function struct(leader, ...items) { return "" + leader + "(" + items.join(";") + ")"; } @@ -9,21 +7,18 @@ function tuple(...items) { function list(items) { return "{" + items.join(";") + "}"; } - function n(x) { return String(Math.round(x * 0x10000)); } - function typedPoint(z) { return tuple(z.type, n(z.x), n(z.y)); } function gizmo(g) { return tuple(n(g.xx), n(g.xy), n(g.yx), n(g.yy), n(g.x), n(g.y)); } - -exports.struct = struct; -exports.tuple = tuple; -exports.list = list; -exports.n = n; -exports.typedPoint = typedPoint; -exports.gizmo = gizmo; +export { struct }; +export { tuple }; +export { list }; +export { n }; +export { typedPoint }; +export { gizmo }; diff --git a/font-src/support/util/mask-bit.js b/font-src/support/util/mask-bit.mjs similarity index 54% rename from font-src/support/util/mask-bit.js rename to font-src/support/util/mask-bit.mjs index 6a3b7fa16..8b4e92529 100644 --- a/font-src/support/util/mask-bit.js +++ b/font-src/support/util/mask-bit.mjs @@ -1,14 +1,10 @@ -"use strict"; - -exports.maskBit = function maskBit(x, y) { - return x & (1 << y); -}; - -exports.maskBits = function maskBits(x, y) { - return x & y; -}; - const pcNibbleLookup = [0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4]; -exports.popCountByte = function (x) { +export function maskBit(x, y) { + return x & (1 << y); +} +export function maskBits(x, y) { + return x & y; +} +export const popCountByte = function (x) { return pcNibbleLookup[x & 0x0f] + pcNibbleLookup[(x >>> 4) & 0x0f]; }; diff --git a/font-src/support/util/monotonic-interpolate.js b/font-src/support/util/monotonic-interpolate.mjs similarity index 97% rename from font-src/support/util/monotonic-interpolate.js rename to font-src/support/util/monotonic-interpolate.mjs index 9aa730fad..c6e7add1a 100644 --- a/font-src/support/util/monotonic-interpolate.js +++ b/font-src/support/util/monotonic-interpolate.mjs @@ -1,9 +1,6 @@ -"use strict"; - -exports.monotonicInterpolate = function (xs, ys) { +export const monotonicInterpolate = function (xs, ys) { let i, length = xs.length; - // Deal with length issues if (length != ys.length) { throw "Need an equal count of xs and ys."; @@ -21,7 +18,6 @@ exports.monotonicInterpolate = function (xs, ys) { return result; }; } - // Rearrange xs and ys so that xs is sorted let indexes = []; for (i = 0; i < length; i++) { @@ -40,7 +36,6 @@ exports.monotonicInterpolate = function (xs, ys) { xs.push(+oldXs[indexes[i]]); ys.push(+oldYs[indexes[i]]); } - // Get consecutive differences and slopes let dys = [], dxs = [], @@ -52,7 +47,6 @@ exports.monotonicInterpolate = function (xs, ys) { dys.push(dy); ms.push(dy / dx); } - // Get degree-1 coefficients let c1s = [ms[0]]; for (i = 0; i < dxs.length - 1; i++) { @@ -68,7 +62,6 @@ exports.monotonicInterpolate = function (xs, ys) { } } c1s.push(ms[ms.length - 1]); - // Get degree-2 and degree-3 coefficients let c2s = [], c3s = []; @@ -80,7 +73,6 @@ exports.monotonicInterpolate = function (xs, ys) { c2s.push((m - c1 - common) * invDx); c3s.push(common * invDx * invDx); } - // Return interpolant function return function (x) { // The rightmost point in the dataset should give an exact result @@ -88,7 +80,6 @@ exports.monotonicInterpolate = function (xs, ys) { if (x == xs[i]) { return ys[i]; } - // Search for the interval x is in, returning the corresponding y if x is one of the original xs let low = 0, mid, @@ -105,7 +96,6 @@ exports.monotonicInterpolate = function (xs, ys) { } } i = Math.max(0, high); - // Interpolate let diff = x - xs[i], diffSq = diff * diff; diff --git a/font-src/support/utils.js b/font-src/support/utils.mjs similarity index 77% rename from font-src/support/utils.js rename to font-src/support/utils.mjs index d0cf2d06e..19f61876e 100644 --- a/font-src/support/utils.js +++ b/font-src/support/utils.mjs @@ -1,5 +1,3 @@ -"use strict"; - function mix(a, b, p) { return a + (b - a) * p; } @@ -33,13 +31,12 @@ function bez3(a, b, c, d, t) { t * t * t * d ); } - -exports.mix = mix; -exports.barmixL = barmixL; -exports.barmixM = barmixM; -exports.barmixR = barMixR; -exports.linreg = linreg; -exports.clamp = clamp; -exports.fallback = fallback; -exports.bez2 = bez2; -exports.bez3 = bez3; +export { mix }; +export { barmixL }; +export { barmixM }; +export { barMixR as barmixR }; +export { linreg }; +export { clamp }; +export { fallback }; +export { bez2 }; +export { bez3 }; diff --git a/font-src/support/variant-data.js b/font-src/support/variant-data.mjs similarity index 98% rename from font-src/support/variant-data.js rename to font-src/support/variant-data.mjs index 0a53033af..6a19dde62 100644 --- a/font-src/support/variant-data.js +++ b/font-src/support/variant-data.mjs @@ -1,6 +1,3 @@ -"use strict"; - -exports.apply = applyVariantData; function applyVariantData(data, para, argv) { const parsed = parseVariantsData(data, argv); let tagSet = new Set(); @@ -9,7 +6,6 @@ function applyVariantData(data, para, argv) { if (!tagSet.has(prime.tag)) tagSet.add(prime.tag); else throw new Error(`CV tag conflict: ${prime.tag}`); } - const variantSelector = {}; parsed.defaultComposite.resolve(para, parsed.selectorTree, parsed.composites, variantSelector); if (argv.shape.serifs === "slab") { @@ -27,8 +23,6 @@ function applyVariantData(data, para, argv) { }; para.variantSelector = variantSelector; } - -exports.parse = parseVariantsData; function parseVariantsData(data, argv) { const primes = new Map(); const selectorTree = new SelectorTree(); @@ -37,7 +31,6 @@ function parseVariantsData(data, argv) { p.register(selectorTree); primes.set(k, p); } - const defaultComposite = new Composite("{default}", data.default); const composites = new Map(); for (const k in data.composite) { @@ -53,7 +46,6 @@ function parseVariantsData(data, argv) { } return { selectorTree: selectorTree, primes, composites, defaultComposite }; } - class SelectorTree { constructor() { this.m_mapping = new Map(); @@ -70,7 +62,6 @@ class SelectorTree { for (const m of this.m_mapping.values()) yield* m.values(); } } - class Prime { constructor(key, cfg) { if (!cfg.variants) throw new Error(`Missing variants in ${key}`); @@ -98,7 +89,6 @@ class Prime { for (const v of this.variants.values()) if (v.rank) tree.set(this.tag, v.rank, this, v); } } - toJson() { const gr = { key: this.key, @@ -126,7 +116,6 @@ class Prime { return gr; } } - class PrimeVariant { constructor(key, tag, cfg) { this.key = key; @@ -147,7 +136,6 @@ class PrimeVariant { Object.assign(vs, this.selector); } } - class Composite { constructor(key, cfg) { this.key = key; @@ -158,7 +146,6 @@ class Composite { this.upright = cfg.upright || cfg["upright-oblique"]; this.oblique = cfg.oblique || cfg["upright-oblique"]; this.italic = cfg.italic; - const slabOverrideCfg = cfg["slab-override"] || {}; this.slabOverride = { design: slabOverrideCfg.design, @@ -167,7 +154,6 @@ class Composite { italic: slabOverrideCfg.italic }; } - decompose(para, selTree) { const ans = []; const cfg = Object.assign( @@ -199,3 +185,5 @@ class Composite { } } } +export { applyVariantData as apply }; +export { parseVariantsData as parse }; diff --git a/package-lock.json b/package-lock.json index 89ecb7ace..30845886d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,13 +24,13 @@ "cldr": "^7.2.0", "eslint": "^8.18.0", "eslint-config-prettier": "^8.5.0", - "patel": "^0.37.1", + "patel": "^0.38.0", "prettier": "^2.7.1", - "verda": "^1.6.0", + "verda": "^1.10.0", "which": "^2.0.2" }, "engines": { - "node": ">=12.16.0" + "node": ">=16.0.0" } }, "node_modules/@eslint/eslintrc": { @@ -1778,14 +1778,14 @@ } }, "node_modules/patel": { - "version": "0.37.1", - "resolved": "https://registry.npmjs.org/patel/-/patel-0.37.1.tgz", - "integrity": "sha512-7lIe3whu1gIJePlt8U+xmKCNXZgfBNNYdE4thvJTKfz8xZmmHC3+Oc7pI2qabtVLppXAjg5g3xnhDaLsD7dQ8w==", + "version": "0.38.0", + "resolved": "https://registry.npmjs.org/patel/-/patel-0.38.0.tgz", + "integrity": "sha512-Bzhgo3HTG1phko50ULaBEi7wBZxJLgt0BZDJDjdIhSz+ZlhsY6+yDvXAJcXAtTwcqSR4F5j2Yc2Gqkornk9D5A==", "dev": true, "dependencies": { "escodegen": "^2.0.0", "esmangle": "^1.0.1", - "patrisika": "^0.24.0", + "patrisika": "^0.25.0", "resumer": "*", "yargs": "^16.1.0" }, @@ -1812,9 +1812,9 @@ } }, "node_modules/patrisika": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/patrisika/-/patrisika-0.24.0.tgz", - "integrity": "sha512-vIXRwNNZic/jMtMGCmWG0+b3vg2zKqeNgY4NHKHkevUc+eIY7iudIXMGwnDY45mavfHxmEhATxnpkMJvBwCCqA==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/patrisika/-/patrisika-0.25.0.tgz", + "integrity": "sha512-Kevy01SFkhzON30J1nKVzHPdoJmkmRY2HG+OIFeI/IT4eBveQwbrE3Q2beEx9t02HhMyAlnYFXt0z5wNY6mePA==", "dev": true, "dependencies": { "patrisika-scopes": "^0.12.0" @@ -2190,9 +2190,9 @@ "dev": true }, "node_modules/verda": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/verda/-/verda-1.6.0.tgz", - "integrity": "sha512-r7YP2FG7AbV/BjnvIqpHZRokkZlWzP6SCJNh0Oq9LsMzEBM9Vx3HqUz2gTV49LKY6/e7yCWAA/aDgWgFkKXdbA==", + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verda/-/verda-1.10.0.tgz", + "integrity": "sha512-euo21L72IMCzrQ9GrYGEI1kmQT6bgKcfJaa0zr4a+FpODsOrszDk55SYsvAqKUMzgXJHAGh4LvE9ytu45E79OA==", "dev": true, "dependencies": { "chalk": "^4.1.2", @@ -3819,14 +3819,14 @@ "dev": true }, "patel": { - "version": "0.37.1", - "resolved": "https://registry.npmjs.org/patel/-/patel-0.37.1.tgz", - "integrity": "sha512-7lIe3whu1gIJePlt8U+xmKCNXZgfBNNYdE4thvJTKfz8xZmmHC3+Oc7pI2qabtVLppXAjg5g3xnhDaLsD7dQ8w==", + "version": "0.38.0", + "resolved": "https://registry.npmjs.org/patel/-/patel-0.38.0.tgz", + "integrity": "sha512-Bzhgo3HTG1phko50ULaBEi7wBZxJLgt0BZDJDjdIhSz+ZlhsY6+yDvXAJcXAtTwcqSR4F5j2Yc2Gqkornk9D5A==", "dev": true, "requires": { "escodegen": "^2.0.0", "esmangle": "^1.0.1", - "patrisika": "^0.24.0", + "patrisika": "^0.25.0", "resumer": "*", "yargs": "^16.1.0" } @@ -3844,9 +3844,9 @@ "dev": true }, "patrisika": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/patrisika/-/patrisika-0.24.0.tgz", - "integrity": "sha512-vIXRwNNZic/jMtMGCmWG0+b3vg2zKqeNgY4NHKHkevUc+eIY7iudIXMGwnDY45mavfHxmEhATxnpkMJvBwCCqA==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/patrisika/-/patrisika-0.25.0.tgz", + "integrity": "sha512-Kevy01SFkhzON30J1nKVzHPdoJmkmRY2HG+OIFeI/IT4eBveQwbrE3Q2beEx9t02HhMyAlnYFXt0z5wNY6mePA==", "dev": true, "requires": { "patrisika-scopes": "^0.12.0" @@ -4122,9 +4122,9 @@ "dev": true }, "verda": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/verda/-/verda-1.6.0.tgz", - "integrity": "sha512-r7YP2FG7AbV/BjnvIqpHZRokkZlWzP6SCJNh0Oq9LsMzEBM9Vx3HqUz2gTV49LKY6/e7yCWAA/aDgWgFkKXdbA==", + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verda/-/verda-1.10.0.tgz", + "integrity": "sha512-euo21L72IMCzrQ9GrYGEI1kmQT6bgKcfJaa0zr4a+FpODsOrszDk55SYsvAqKUMzgXJHAGh4LvE9ytu45E79OA==", "dev": true, "requires": { "chalk": "^4.1.2", diff --git a/package.json b/package.json index dd9e317c4..8235efcd9 100644 --- a/package.json +++ b/package.json @@ -3,9 +3,9 @@ "version": "15.6.0", "main": "./font-src/index.js", "scripts": { - "build": "node utility/ensure-verda-exists && verda -f verdafile.js", - "bump-ver": "node utility/update-package-json-version/index", - "clean": "node utility/ensure-verda-exists && verda -f verdafile.js clean" + "build": "verda -f verdafile.mjs", + "bump-ver": "node utility/update-package-json-version/index.mjs", + "clean": "verda -f verdafile.mjs clean" }, "dependencies": { "@iarna/toml": "^2.2.5", @@ -24,12 +24,12 @@ "cldr": "^7.2.0", "eslint": "^8.18.0", "eslint-config-prettier": "^8.5.0", - "patel": "^0.37.1", + "patel": "^0.38.0", "prettier": "^2.7.1", - "verda": "^1.6.0", + "verda": "^1.10.0", "which": "^2.0.2" }, "engines": { - "node": ">=12.16.0" + "node": ">=16.0.0" } } diff --git a/utility/amend-readme/index.js b/utility/amend-readme/index.mjs similarity index 95% rename from utility/amend-readme/index.js rename to utility/amend-readme/index.mjs index 52584cb43..ec13f511e 100644 --- a/utility/amend-readme/index.js +++ b/utility/amend-readme/index.mjs @@ -1,30 +1,8 @@ -"use strict"; - -const fs = require("fs"); -const path = require("path"); -const { parseVariantsData } = require("../export-data/variants-data"); -const { parseLigationData } = require("../export-data/ligation-data"); -const { getCharMapAndSupportedLanguageList } = require("../export-data/supported-languages"); - -/////////////////////////////////////////////////////////////////////////////////////////////////// - -module.exports = async function main(argv) { - let readme = await fs.promises.readFile(argv.mdFilePath, "utf-8"); - const dirs = { - images: path.posix.relative(path.dirname(argv.mdFilePath), "images") - }; - readme = (await processSsOt(dirs)).apply(readme); - readme = (await processCherryPickingStyles(dirs)).apply(readme); - readme = (await processSsStyles()).apply(readme); - readme = (await processCvOt(dirs)).apply(readme); - readme = (await processLigSetCherryPicking()).apply(readme); - readme = (await processLigSetPreDef()).apply(readme); - readme = (await processLigSetOt(dirs, 1, g => g.tag === "calt")).apply(readme); - readme = (await processLigSetOt(dirs, 2, g => g.tag !== "calt")).apply(readme); - readme = (await processLangList(argv)).apply(readme); - readme = (await processPrivateBuildPlans()).apply(readme); - await fs.promises.writeFile(argv.mdFilePath, readme); -}; +import fs from "fs"; +import path from "path"; +import { parseVariantsData } from "../export-data/variants-data.mjs"; +import { parseLigationData } from "../export-data/ligation-data.mjs"; +import { getCharMapAndSupportedLanguageList } from "../export-data/supported-languages.mjs"; async function processSsOt(dirs) { const variantsData = await parseVariantsData(); @@ -63,14 +41,12 @@ async function processCvOt(dirs) { const entriesPerRow = Math.floor(TableColumns / entryWidth); const rowsNeeded = Math.ceil(effVariants.length / entriesPerRow); const itemColSpanHtml = entryWidth > 1 ? ` colspan="${entryWidth}"` : ``; - for (let rid = 0; rid < rowsNeeded; rid++) { const entriesInThisRow = Math.min( entriesPerRow, effVariants.length - rid * entriesPerRow ); const tailBlankColumnsCount = TableColumns - entryWidth * entriesInThisRow; - // Image row md.log(``); if (rid === 0) md.log(`${cv.tag}`); @@ -84,7 +60,6 @@ async function processCvOt(dirs) { } if (tailBlankColumnsCount > 0) md.log(` `); md.log(``); - // CV ID row md.log(``); for (let cid = 0; cid < entriesPerRow; cid++) { @@ -100,7 +75,6 @@ async function processCvOt(dirs) { md.log(``); return md; } - async function processSsStyles() { const variantsData = await parseVariantsData(); const md = new MdCol("Section-Stylistic-Sets"); @@ -115,10 +89,8 @@ async function processSsStyles() { async function processCherryPickingStyles(dirs) { const variantsData = await parseVariantsData(); const md = new MdCol("Section-Cherry-Picking-Styles"); - const headerPath = path.resolve(__dirname, "fragments/description-cheery-picking-styles.md"); md.log(await fs.promises.readFile(headerPath, "utf-8")); - for (const cv of [...variantsData.specials, ...variantsData.primes]) { if (!cv.tag && !cv.isSpecial) continue; const sampleText = cv.descSampleText @@ -153,11 +125,9 @@ async function processCherryPickingStyles(dirs) { } return md; } - function sampleImageCountEmOfCv(cv) { return cv.hotChars.length * (cv.slopeDependent ? 2 : 1); } - function formatCv(md, dirs, info) { md.log(` - ${info.introMD}:`); const imgWidth = 32 * info.sampleImageCountEm; @@ -174,17 +144,14 @@ function formatCv(md, dirs, info) { sTable += ""; md.log(sTable); } - function formatDescription(s) { return s .replace(/`` (\S+?) ``/g, ($0, $1) => `${escapeHtml($1)}`) .replace(/`([^`]+?)`/g, ($0, $1) => `${escapeHtml($1)}`); } - function escapeHtml(s) { return s.replace(/&/g, "&").replace(//g, ">"); } - async function processPrivateBuildPlans() { const md = new MdCol("Section-Private-Build-Plan-Sample"); const tomlPath = path.resolve(__dirname, "../../private-build-plans.sample.toml"); @@ -192,7 +159,6 @@ async function processPrivateBuildPlans() { md.log("```toml\n" + toml + "```"); return md; } - function formatDefaults(selector, defaults) { let dcs = [], mask = 0; @@ -209,7 +175,6 @@ function formatDefaults(selector, defaults) { if (mask === 0xc) return ` (default for Slab)`; return ` (default for ${dcs.map(x => x.desc).join(", ")})`; } - function figureOutDefaults(variantsData, gr) { const defaultConfigs = [ { @@ -237,7 +202,6 @@ function figureOutDefaults(variantsData, gr) { composition: { ...variantsData.defaults.slab.italic } } ]; - for (const variant of gr.variants) { for (const dc of defaultConfigs) { if (variant.key === dc.composition[gr.key]) dc.result = variant.key; @@ -245,7 +209,6 @@ function figureOutDefaults(variantsData, gr) { } return defaultConfigs; } - async function processLigSetCherryPicking() { const ligData = await parseLigationData(); const md = new MdCol("Section-Cherry-Picking-Ligation-Sets"); @@ -254,13 +217,11 @@ async function processLigSetCherryPicking() { "fragments/description-cherry-picking-ligation-sets.md" ); md.log(await fs.promises.readFile(headerPath, "utf-8")); - for (const gr in ligData.cherry) { md.log(` - \`${gr}\`: ${ligData.cherry[gr].desc}.`); } return md; } - async function processLigSetPreDef() { const ligData = await parseLigationData(); const md = new MdCol("Section-Predefined-Ligation-Sets"); @@ -274,7 +235,6 @@ async function processLigSetPreDef() { } return md; } - async function processLigSetOt(dirs, index, fn) { const ligData = await parseLigationData(); const md = new MdCol(`Section-OT-Ligation-Tags-${index}`); @@ -299,7 +259,6 @@ async function processLigSetOt(dirs, index, fn) { md.log(``); return md; } - async function processLangList(argv) { const cl = await getCharMapAndSupportedLanguageList( argv.charMapPath, @@ -311,9 +270,7 @@ async function processLangList(argv) { md.log(cl.languages.join(", ")); return md; } - ///////////////////////////////////////////////////////////////////////////////////////////////////// - class MdCol { constructor(sectionName) { this.data = ""; @@ -337,7 +294,6 @@ class MdCol { }); } } - function ImgX(path, w) { const widthProp = w ? ` width=${w}` : ``; return ( @@ -345,3 +301,20 @@ function ImgX(path, w) { `` ); } +export default (async function main(argv) { + let readme = await fs.promises.readFile(argv.mdFilePath, "utf-8"); + const dirs = { + images: path.posix.relative(path.dirname(argv.mdFilePath), "images") + }; + readme = (await processSsOt(dirs)).apply(readme); + readme = (await processCherryPickingStyles(dirs)).apply(readme); + readme = (await processSsStyles()).apply(readme); + readme = (await processCvOt(dirs)).apply(readme); + readme = (await processLigSetCherryPicking()).apply(readme); + readme = (await processLigSetPreDef()).apply(readme); + readme = (await processLigSetOt(dirs, 1, g => g.tag === "calt")).apply(readme); + readme = (await processLigSetOt(dirs, 2, g => g.tag !== "calt")).apply(readme); + readme = (await processLangList(argv)).apply(readme); + readme = (await processPrivateBuildPlans()).apply(readme); + await fs.promises.writeFile(argv.mdFilePath, readme); +}); diff --git a/utility/copy-char-name-to-markdown.js b/utility/copy-char-name-to-markdown.js deleted file mode 100644 index 852bf06e9..000000000 --- a/utility/copy-char-name-to-markdown.js +++ /dev/null @@ -1,7 +0,0 @@ -const ucdNames = require("@unicode/unicode-14.0.0/Names"); - -for (let i = 2; i < process.argv.length; i++) { - const lch = parseInt(process.argv[i], 16); - const name = ucdNames.get(lch); - console.log(" -", name, `(\`U+${lch.toString(16).toUpperCase().padStart(4, "0")}\`);`); -} diff --git a/utility/copy-char-name-to-markdown.mjs b/utility/copy-char-name-to-markdown.mjs new file mode 100644 index 000000000..7aa32b0f1 --- /dev/null +++ b/utility/copy-char-name-to-markdown.mjs @@ -0,0 +1,6 @@ +import ucdNames from "@unicode/unicode-14.0.0/Names"; +for (let i = 2; i < process.argv.length; i++) { + const lch = parseInt(process.argv[i], 16); + const name = ucdNames.get(lch); + console.log(" -", name, `(\`U+${lch.toString(16).toUpperCase().padStart(4, "0")}\`);`); +} diff --git a/utility/create-sha-file.js b/utility/create-sha-file.js deleted file mode 100644 index 11336e960..000000000 --- a/utility/create-sha-file.js +++ /dev/null @@ -1,31 +0,0 @@ -const fs = require("fs"); -const crypto = require("crypto"); - -module.exports = async function (out, archiveFiles) { - let s = ""; - for (const file of archiveFiles) { - s += `${file.base}\t${await hashFile(file.full)}\n`; - } - await fs.promises.writeFile(out, s); -}; - -function hashFile(path) { - return new Promise((resolve, reject) => { - let sum = crypto.createHash("sha256"); - - let fileStream = fs.createReadStream(path); - fileStream.on("error", err => { - return reject(err); - }); - fileStream.on("data", chunk => { - try { - sum.update(chunk); - } catch (ex) { - return reject(ex); - } - }); - fileStream.on("end", () => { - return resolve(sum.digest("hex")); - }); - }); -} diff --git a/utility/create-sha-file.mjs b/utility/create-sha-file.mjs new file mode 100644 index 000000000..c8b51d65b --- /dev/null +++ b/utility/create-sha-file.mjs @@ -0,0 +1,29 @@ +import fs from "fs"; +import crypto from "crypto"; +function hashFile(path) { + return new Promise((resolve, reject) => { + let sum = crypto.createHash("sha256"); + let fileStream = fs.createReadStream(path); + fileStream.on("error", err => { + return reject(err); + }); + fileStream.on("data", chunk => { + try { + sum.update(chunk); + } + catch (ex) { + return reject(ex); + } + }); + fileStream.on("end", () => { + return resolve(sum.digest("hex")); + }); + }); +} +export default (async function (out, archiveFiles) { + let s = ""; + for (const file of archiveFiles) { + s += `${file.base}\t${await hashFile(file.full)}\n`; + } + await fs.promises.writeFile(out, s); +}); diff --git a/utility/ensure-verda-exists.js b/utility/ensure-verda-exists.js deleted file mode 100644 index 2feea79cd..000000000 --- a/utility/ensure-verda-exists.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; - -const FgRed = "\x1b[31m"; -const FgYellow = "\x1b[33m"; -const Reset = "\x1b[0m"; - -const os = require("os"); -const shellWord = os.platform() === "win32" ? "command prompt" : "shell"; - -// Check packages are present -try { - require("verda/package.json"); - require("semver/package.json"); - require("which/package.json"); - require("@iarna/toml/package.json"); -} catch (e) { - console.error(`${FgRed}It looks like you forgot to run "npm install" before building.${Reset}`); - console.error(`"npm install" sets up dependencies required to build the fonts.`); - console.error(`Run the following command in your ${shellWord} and retry:`); - console.error(` ${FgYellow}npm install${Reset}`); - console.error(); - process.exit(1); -} diff --git a/utility/export-data/coverage-export/block-data.js b/utility/export-data/coverage-export/block-data.js deleted file mode 100644 index f16f5a099..000000000 --- a/utility/export-data/coverage-export/block-data.js +++ /dev/null @@ -1,19 +0,0 @@ -const UnicodeDataIndex = require("@unicode/unicode-14.0.0"); - -const BlockData = [ - [[0xe0a0, 0xe0df], "Private Use Area — Powerline"], - [[0xee00, 0xee3f], "Private Use Area — Progress Bar"], - // Missing ranges in UnicodeDataIndex - [[0x1fa70, 0x1faff], "Symbols and Pictographs Extended-A "], - [[0x1fb00, 0x1fbff], "Symbols for Legacy Computing"] -]; - -for (const id of UnicodeDataIndex.Block) { - if (!id || /Private_Use_Area/.test(id) || /undefined/.test(id)) continue; - const rg = require(`@unicode/unicode-14.0.0/Block/${id}/ranges`); - BlockData.push([[rg[0].begin, rg[0].end - 1], id.replace(/_/g, " ")]); -} - -BlockData.sort((a, b) => a[0][0] - b[0][0]); - -exports.BlockData = BlockData; diff --git a/utility/export-data/coverage-export/block-data.mjs b/utility/export-data/coverage-export/block-data.mjs new file mode 100644 index 000000000..cc4f7d079 --- /dev/null +++ b/utility/export-data/coverage-export/block-data.mjs @@ -0,0 +1,15 @@ +import UnicodeDataIndex from "@unicode/unicode-14.0.0"; +const BlockData = [ + [[0xe0a0, 0xe0df], "Private Use Area — Powerline"], + [[0xee00, 0xee3f], "Private Use Area — Progress Bar"], + // Missing ranges in UnicodeDataIndex + [[0x1fa70, 0x1faff], "Symbols and Pictographs Extended-A "], + [[0x1fb00, 0x1fbff], "Symbols for Legacy Computing"] +]; +for (const id of UnicodeDataIndex.Block) { + if (!id || /Private_Use_Area/.test(id) || /undefined/.test(id)) + continue; + BlockData.push([[rg[0].begin, rg[0].end - 1], id.replace(/_/g, " ")]); +} +BlockData.sort((a, b) => a[0][0] - b[0][0]); +export { BlockData }; diff --git a/utility/export-data/coverage-export/gather-coverage-data.js b/utility/export-data/coverage-export/gather-coverage-data.mjs similarity index 86% rename from utility/export-data/coverage-export/gather-coverage-data.js rename to utility/export-data/coverage-export/gather-coverage-data.mjs index 017059421..041593719 100644 --- a/utility/export-data/coverage-export/gather-coverage-data.js +++ b/utility/export-data/coverage-export/gather-coverage-data.mjs @@ -1,16 +1,29 @@ -const { BlockData } = require("./block-data"); -const ucdNames = require("@unicode/unicode-14.0.0/Names"); -const ugc = require("@unicode/unicode-14.0.0/General_Category"); - -// eslint-disable-next-line complexity -exports.gatherCoverageData = function (covUpright, covItalic, covOblique) { +import { BlockData } from "./block-data.mjs"; +import ucdNames from "@unicode/unicode-14.0.0/Names"; +import ugc from "@unicode/unicode-14.0.0/General_Category"; +function findFirstLastChar(lchBlockStart, lchBlockEnd, cov) { + let lchFirst = 0, + lchLast = 0; + for (const [lchFont] of cov) { + if (lchFont < 0x20 || lchFont < lchBlockStart || lchFont > lchBlockEnd) continue; + if (!lchFirst || lchFont < lchFirst) lchFirst = lchFont; + if (!lchLast || lchFont > lchLast) lchLast = lchFont; + } + if (!lchFirst || !lchLast) return [0, 0]; + if (lchBlockEnd - lchBlockStart <= 0x100 && lchBlockStart > 0xff) { + lchFirst = lchBlockStart; + lchLast = lchBlockEnd; + } + const lchStart = (lchFirst >>> 4) << 4; + const lchEnd = ((lchLast >>> 4) << 4) + 0x10; + return [lchStart, lchEnd]; +} +export const gatherCoverageData = function (covUpright, covItalic, covOblique) { const result = []; for (const [[lchBlockStart, lchBlockEnd], block] of BlockData) { let blockResults = []; - const [lchStart, lchEnd] = findFirstLastChar(lchBlockStart, lchBlockEnd, covUpright); if (!lchStart || !lchEnd) continue; - for (let lch = lchStart; lch < lchEnd; lch++) { const chName = ucdNames.get(lch); const gc = ugc.get(lch); @@ -42,7 +55,6 @@ exports.gatherCoverageData = function (covUpright, covItalic, covOblique) { }); } } - if (blockResults.length) { result.push({ name: block, @@ -52,21 +64,3 @@ exports.gatherCoverageData = function (covUpright, covItalic, covOblique) { } return result; }; - -function findFirstLastChar(lchBlockStart, lchBlockEnd, cov) { - let lchFirst = 0, - lchLast = 0; - for (const [lchFont] of cov) { - if (lchFont < 0x20 || lchFont < lchBlockStart || lchFont > lchBlockEnd) continue; - if (!lchFirst || lchFont < lchFirst) lchFirst = lchFont; - if (!lchLast || lchFont > lchLast) lchLast = lchFont; - } - if (!lchFirst || !lchLast) return [0, 0]; - if (lchBlockEnd - lchBlockStart <= 0x100 && lchBlockStart > 0xff) { - lchFirst = lchBlockStart; - lchLast = lchBlockEnd; - } - const lchStart = (lchFirst >>> 4) << 4; - const lchEnd = ((lchLast >>> 4) << 4) + 0x10; - return [lchStart, lchEnd]; -} diff --git a/utility/export-data/index.js b/utility/export-data/index.mjs similarity index 58% rename from utility/export-data/index.js rename to utility/export-data/index.mjs index 80e67942c..863a97608 100644 --- a/utility/export-data/index.js +++ b/utility/export-data/index.mjs @@ -1,14 +1,11 @@ -"use strict"; +import fs from "fs"; +import { parseVariantsData } from "./variants-data.mjs"; +import { parseLigationData } from "./ligation-data.mjs"; +import { getCharMapAndSupportedLanguageList } from "./supported-languages.mjs"; +import package$0 from "../../package.json" assert { type: "json" }; -const fs = require("fs"); -const { parseVariantsData } = require("./variants-data"); -const { parseLigationData } = require("./ligation-data"); -const { getCharMapAndSupportedLanguageList } = require("./supported-languages"); - -const version = require("../../package.json").version; - -/////////////////////////////////////////////////////////////////////////////////////////////////// -module.exports = async function main(argv) { +const version = package$0.version; +export default (async function main(argv) { const variantsData = await parseVariantsData(); const ligationData = await parseLigationData(); const cl = await getCharMapAndSupportedLanguageList( @@ -35,4 +32,4 @@ module.exports = async function main(argv) { argv.exportPathCov, JSON.stringify({ version, ...cl }, { spaces: 2 }) ); -}; +}); diff --git a/utility/export-data/ligation-data.js b/utility/export-data/ligation-data.mjs similarity index 94% rename from utility/export-data/ligation-data.js rename to utility/export-data/ligation-data.mjs index 6ab6d902f..408101cc2 100644 --- a/utility/export-data/ligation-data.js +++ b/utility/export-data/ligation-data.mjs @@ -1,8 +1,6 @@ -"use strict"; - -const fs = require("fs"); -const path = require("path"); -const toml = require("@iarna/toml"); +import fs from "fs"; +import path from "path"; +import * as toml from "@iarna/toml"; const ligationSamples = [ [ @@ -98,7 +96,6 @@ const ligationSamples = [ "-|" ] ]; - const ligationSamplesNarrow = [ [ "-<<", @@ -187,30 +184,6 @@ const ligationSamplesNarrow = [ "<***>" ] ]; - -exports.parseLigationData = async function () { - const ligToml = await fs.promises.readFile( - path.join(__dirname, "../../params/ligation-set.toml"), - "utf8" - ); - const ligData = toml.parse(ligToml); - - const ligationSets = buildLigationSet(ligData, comp => comp.buildup.join(",")); - const nonMergeLigationSets = buildLigationSet( - ligData, - comp => comp.tag + comp.buildup.join(",") - ); - - return { - samples: ligationSamples, - samplesNarrow: ligationSamplesNarrow, - cherry: ligData.simple, - rawSets: ligData.composite, - sets: [...ligationSets.values()], - nonMergeSets: [...nonMergeLigationSets.values()] - }; -}; - function buildLigationSet(ligData, getKey) { const ligationSets = new Map([ ["*off", { tag: "calt", rank: 0, desc: "Ligation Off", brief: "Off", ligSets: [] }] @@ -243,3 +216,23 @@ function buildLigationSet(ligData, getKey) { } return ligationSets; } +export const parseLigationData = async function () { + const ligToml = await fs.promises.readFile( + path.join(__dirname, "../../params/ligation-set.toml"), + "utf8" + ); + const ligData = toml.parse(ligToml); + const ligationSets = buildLigationSet(ligData, comp => comp.buildup.join(",")); + const nonMergeLigationSets = buildLigationSet( + ligData, + comp => comp.tag + comp.buildup.join(",") + ); + return { + samples: ligationSamples, + samplesNarrow: ligationSamplesNarrow, + cherry: ligData.simple, + rawSets: ligData.composite, + sets: [...ligationSets.values()], + nonMergeSets: [...nonMergeLigationSets.values()] + }; +}; diff --git a/utility/export-data/supported-languages.js b/utility/export-data/supported-languages.mjs similarity index 89% rename from utility/export-data/supported-languages.js rename to utility/export-data/supported-languages.mjs index 93b7c86d1..d2a28e7fe 100644 --- a/utility/export-data/supported-languages.js +++ b/utility/export-data/supported-languages.mjs @@ -1,38 +1,14 @@ -"use strict"; - -const cldr = require("cldr"); -const fs = require("fs"); -const zlib = require("zlib"); -const { decode } = require("@msgpack/msgpack"); - -const { gatherCoverageData } = require("./coverage-export/gather-coverage-data"); +import cldr from "cldr"; +import fs from "fs"; +import zlib from "zlib"; +import { decode } from "@msgpack/msgpack"; +import { gatherCoverageData } from "./coverage-export/gather-coverage-data.mjs"; // List all the languages that Iosevka supports, but cannot inferred from CLDR data. const overrideSupportedLanguages = []; - -exports.getCharMapAndSupportedLanguageList = async function (cmpUpright, cmpItalic, cmpOblique) { - const charMap = await readMpCharMap(cmpUpright); - const charMapItalic = await readMpCharMap(cmpItalic); - const charMapOblique = await readMpCharMap(cmpOblique); - - const rawCoverage = getRawCoverage(charMap); - const rawCoverageItalic = getRawCoverage(charMapItalic); - const rawCoverageOblique = getRawCoverage(charMapOblique); - - return { - stats: { - glyphCount: charMap.length, - codePointCount: rawCoverage.size - }, - unicodeCoverage: gatherCoverageData(rawCoverage, rawCoverageItalic, rawCoverageOblique), - languages: Array.from(getSupportedLanguageSet(rawCoverage)).sort() - }; -}; - async function readMpCharMap(p) { return decode(zlib.gunzipSync(await fs.promises.readFile(p))); } - function getSupportedLanguageSet(rawCoverage) { const supportLocaleSet = getSupportLocaleSet(rawCoverage); addSimilarLocales(supportLocaleSet); @@ -40,7 +16,6 @@ function getSupportedLanguageSet(rawCoverage) { } function getSupportLocaleSet(rawCoverage) { const supportLocaleSet = new Set(); - for (const locale of cldr.localeIds) { const exemplar = cldr.extractCharacters(locale).exemplar; if (!exemplar) continue; @@ -52,7 +27,6 @@ function getSupportLocaleSet(rawCoverage) { ...(exemplar.numbers || []), ...(exemplar.punctuation || []) ].join(""); - let fullSupport = true; let basicSupport = true; for (const ch of basicChars) { @@ -61,7 +35,6 @@ function getSupportLocaleSet(rawCoverage) { for (const ch of fullChars) { if (!rawCoverage.has(ch.codePointAt(0))) fullSupport = false; } - if (basicSupport) { supportLocaleSet.add(locale); } @@ -95,10 +68,29 @@ function getSupportedLangs(supportLocaleSet) { } return supportLangSet; } - function getRawCoverage(charMap) { const rawCoverage = new Map(); for (const [gn, codes, tv, cv] of charMap) for (const u of codes) rawCoverage.set(u, [gn, tv, cv]); return rawCoverage; } +export const getCharMapAndSupportedLanguageList = async function ( + cmpUpright, + cmpItalic, + cmpOblique +) { + const charMap = await readMpCharMap(cmpUpright); + const charMapItalic = await readMpCharMap(cmpItalic); + const charMapOblique = await readMpCharMap(cmpOblique); + const rawCoverage = getRawCoverage(charMap); + const rawCoverageItalic = getRawCoverage(charMapItalic); + const rawCoverageOblique = getRawCoverage(charMapOblique); + return { + stats: { + glyphCount: charMap.length, + codePointCount: rawCoverage.size + }, + unicodeCoverage: gatherCoverageData(rawCoverage, rawCoverageItalic, rawCoverageOblique), + languages: Array.from(getSupportedLanguageSet(rawCoverage)).sort() + }; +}; diff --git a/utility/export-data/variants-data.js b/utility/export-data/variants-data.mjs similarity index 94% rename from utility/export-data/variants-data.js rename to utility/export-data/variants-data.mjs index c3a79afb3..b047810fa 100644 --- a/utility/export-data/variants-data.js +++ b/utility/export-data/variants-data.mjs @@ -1,26 +1,7 @@ -"use strict"; - -const fs = require("fs"); -const path = require("path"); -const toml = require("@iarna/toml"); - -const VariantDataParser = require("../../font-src/support/variant-data"); - -exports.parseVariantsData = async function () { - const variantsToml = await fs.promises.readFile( - path.join(__dirname, "../../params/variants.toml"), - "utf8" - ); - const varDatRaw = toml.parse(variantsToml); - const varDatParsed = VariantDataParser.parse(varDatRaw); - - const primes = getCvData(varDatParsed); - const specials = getSpecialVariantsData(varDatParsed); - const composites = getSsData(varDatParsed); - const defaults = getCompWithLens(varDatParsed, null, x => x.composition); - - return { primes, composites, specials, defaults }; -}; +import fs from "fs"; +import path from "path"; +import * as toml from "@iarna/toml"; +import * as VariantDataParser from "../../font-src/support/variant-data.mjs"; function getCvData(parsed) { const samplerGroups = new Map(); @@ -30,7 +11,6 @@ function getCvData(parsed) { } return Array.from(samplerGroups.values()); } - function getSpecialVariantsData(parsed) { let result = new Map(); for (const [keyPrime, prime] of parsed.primes) { @@ -39,7 +19,6 @@ function getSpecialVariantsData(parsed) { } return Array.from(result.values()); } - const mockPara = { sans: { upright: {}, @@ -52,7 +31,6 @@ const mockPara = { italic: { slab: 2, isItalic: true } } }; - function getSsData(variants) { const result = [ { @@ -70,9 +48,7 @@ function getSsData(variants) { } } ]; - const hcDefault = getCompWithLens(variants, null, x => x.hotChars); - for (const [key, composite] of variants.composites) { if (!composite.tag) continue; result.push({ @@ -88,7 +64,6 @@ function getSsData(variants) { } return result; } - function getCompWithLens(variants, c, lens) { const cDefault = variants.defaultComposite; const cSlab = variants.composites.get("slab"); @@ -129,15 +104,12 @@ function getCompWithLens(variants, c, lens) { } }; } - function getSelectorKey(prime, variant) { return prime.key + "#" + variant.key; } - function isLigatureSampler(prime) { return / /.test(prime.sampler); } - function buildupComposite(variants, para, ...composites) { let compositionMap = new Map(); let hotChars = new Map(); @@ -165,3 +137,16 @@ function uniqueHotChars(cfgDefault, cfgSS) { } return Array.from(s); } +export const parseVariantsData = async function () { + const variantsToml = await fs.promises.readFile( + path.join(__dirname, "../../params/variants.toml"), + "utf8" + ); + const varDatRaw = toml.parse(variantsToml); + const varDatParsed = VariantDataParser.parse(varDatRaw); + const primes = getCvData(varDatParsed); + const specials = getSpecialVariantsData(varDatParsed); + const composites = getSsData(varDatParsed); + const defaults = getCompWithLens(varDatParsed, null, x => x.composition); + return { primes, composites, specials, defaults }; +}; diff --git a/utility/generate-release-note/change-log.js b/utility/generate-release-note/change-log.mjs similarity index 76% rename from utility/generate-release-note/change-log.js rename to utility/generate-release-note/change-log.mjs index 39418ec79..9025fadbb 100644 --- a/utility/generate-release-note/change-log.js +++ b/utility/generate-release-note/change-log.mjs @@ -1,21 +1,10 @@ -"use strict"; - -const path = require("path"); -const fs = require("fs"); -const semver = require("semver"); -const { Output } = require("./shared/index"); +import path from "path"; +import fs from "fs"; +import semver from "semver"; +import { Output } from "./shared/index.mjs"; const ChangeFileDir = path.join(__dirname, "../../changes"); const ModifiedSinceVersion = "2.x"; - -/////////////////////////////////////////////////////////////////////////////////////////////////// - -module.exports = async function main(argv) { - const out = new Output(); - await GenerateChangeList(argv, out); - await fs.promises.writeFile(argv.outputPath, out.buffer); -}; - async function GenerateChangeList(argv, out) { const changeFiles = await fs.promises.readdir(ChangeFileDir); const fragments = new Map(); @@ -27,10 +16,14 @@ async function GenerateChangeList(argv, out) { fragments.set(fileParts.name, await fs.promises.readFile(filePath, "utf8")); } const sortedFragments = Array.from(fragments).sort((a, b) => semver.compare(b[0], a[0])); - out.log(`## Modifications since version ${ModifiedSinceVersion}`); for (const [version, notes] of sortedFragments) { out.log(`\n### ${version}\n`); out.log(notes.trimEnd() + "\n"); } } +export default (async function main(argv) { + const out = new Output(); + await GenerateChangeList(argv, out); + await fs.promises.writeFile(argv.outputPath, out.buffer); +}); diff --git a/utility/generate-release-note/package-list.js b/utility/generate-release-note/package-list.mjs similarity index 93% rename from utility/generate-release-note/package-list.js rename to utility/generate-release-note/package-list.mjs index a41b26481..8b3621e64 100644 --- a/utility/generate-release-note/package-list.js +++ b/utility/generate-release-note/package-list.mjs @@ -1,24 +1,9 @@ -"use strict"; - -const path = require("path"); -const fs = require("fs"); -const { Output } = require("./shared/index"); - -/////////////////////////////////////////////////////////////////////////////////////////////////// - -module.exports = async function main(argv) { - const out = new Output(); - - out.log(`# Package list of Release ${argv.version}`); - await CopyMarkdown(out, "packages-desc.md"); - await GeneratePackageList(argv, out); - - await fs.promises.writeFile(argv.outputPath, out.buffer); -}; +import path from "path"; +import fs from "fs"; +import { Output } from "./shared/index.mjs"; /////////////////////////////////////////////////////////////////////////////////////////////////// // Copy Markdown - async function CopyMarkdown(out, name) { const content = await fs.promises.readFile( path.resolve(__dirname, `release-note-fragments/${name}`), @@ -26,10 +11,8 @@ async function CopyMarkdown(out, name) { ); out.log(content); } - /////////////////////////////////////////////////////////////////////////////////////////////////// // PACKAGE LIST - const Spacings = { // spacingDesc, ligation type: ["Default", true], @@ -37,25 +20,20 @@ const Spacings = { fixed: ["Fixed", false], "quasi-proportional": ["Default", false] }; - const ImagePrefixNoVersion = `https://raw.githubusercontent.com/be5invis/Iosevka`; const DownloadLinkPrefixNoVersion = `https://github.com/be5invis/Iosevka/releases/download`; - async function GeneratePackageList(argv, out) { const imagePrefix = `${ImagePrefixNoVersion}/v${argv.version}/images`; const pkgShapesData = JSON.parse(await fs.promises.readFile(argv.releasePackagesJsonPath)); const DownloadLinkPrefix = `${DownloadLinkPrefixNoVersion}/v${argv.version}`; - out.log(``); for (let [groupID, gr] of Object.entries(pkgShapesData)) { const prime = gr.subGroups[groupID]; - const familyName = buildName("\u00a0", ...prime.family.split(" ")); const sTtcName = buildName("-", "super-ttc", groupID, argv.version); const ttcName = buildName("-", "ttc", groupID, argv.version); const sTtcLink = `${DownloadLinkPrefix}/${sTtcName}.zip`; const ttcLink = `${DownloadLinkPrefix}/${ttcName}.zip`; - const proportionPrefix = gr.quasiProportional ? "Quasi-proportional" : "Monospace"; const desc = `${proportionPrefix}, ${prime.desc}`; const img = ImgX(`${imagePrefix}/${groupID}`); @@ -67,7 +45,6 @@ async function GeneratePackageList(argv, out) { ``, `` ); - out.log( ``, ``, @@ -102,24 +79,19 @@ async function GeneratePackageList(argv, out) { `` ); } - out.log(``, ``, ``); } out.log(`
 
  └ Sub-packages
${img}
\n`); } - function noBreak(s) { return s.replace(/ /g, "\u00a0"); } - function buildName(j, ...parts) { return parts.filter(x => !!x).join(j); } - function flag(f) { return f ? "Yes" : "No"; } - function ImgX(path, w) { const widthProp = w ? ` width=${w}` : ``; return ( @@ -127,3 +99,10 @@ function ImgX(path, w) { `` ); } +export default (async function main(argv) { + const out = new Output(); + out.log(`# Package list of Release ${argv.version}`); + await CopyMarkdown(out, "packages-desc.md"); + await GeneratePackageList(argv, out); + await fs.promises.writeFile(argv.outputPath, out.buffer); +}); diff --git a/utility/generate-release-note/release-note.js b/utility/generate-release-note/release-note.mjs similarity index 84% rename from utility/generate-release-note/release-note.js rename to utility/generate-release-note/release-note.mjs index b304edd46..1b205acf6 100644 --- a/utility/generate-release-note/release-note.js +++ b/utility/generate-release-note/release-note.mjs @@ -1,15 +1,34 @@ -"use strict"; - -const path = require("path"); -const fs = require("fs"); -const SemVer = require("semver"); -const { Output } = require("./shared/index"); +import path from "path"; +import fs from "fs"; +import SemVer from "semver"; +import { Output } from "./shared/index.mjs"; const ChangeFileDir = path.join(__dirname, "../../changes"); - /////////////////////////////////////////////////////////////////////////////////////////////////// - -module.exports = async function main(argv) { +// CHANGE LIST +async function GenerateChangeList(argv, out) { + const changeFiles = await fs.promises.readdir(ChangeFileDir); + const fragments = new Map(); + for (const file of changeFiles) { + const filePath = path.join(ChangeFileDir, file); + const fileParts = path.parse(filePath); + if (fileParts.ext !== ".md") continue; + if (!SemVer.valid(fileParts.name) || SemVer.lt(argv.version, fileParts.name)) continue; + fragments.set(fileParts.name, await fs.promises.readFile(filePath, "utf8")); + } + const sortedFragments = Array.from(fragments).sort((a, b) => SemVer.compare(b[0], a[0])); + const latestMajor = SemVer.major(sortedFragments[0][0]); + const latestMinor = SemVer.minor(sortedFragments[0][0]); + for (const [version, notes] of sortedFragments) { + const currentMajor = SemVer.major(version); + const currentMinor = SemVer.minor(version); + if (latestMajor !== currentMajor || latestMinor !== currentMinor) continue; + out.log(``); + out.log(`## Changes of version ${version}`); + out.log(notes.trimEnd() + "\n"); + } +} +export default (async function main(argv) { const out = new Output(); let baseUrl = `https://github.com/be5invis/Iosevka/blob/v${argv.version}/doc`; await GenerateChangeList(argv, out); @@ -23,35 +42,5 @@ module.exports = async function main(argv) { `` + `` ); - await fs.promises.writeFile(argv.outputPath, out.buffer); -}; - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// CHANGE LIST - -async function GenerateChangeList(argv, out) { - const changeFiles = await fs.promises.readdir(ChangeFileDir); - const fragments = new Map(); - for (const file of changeFiles) { - const filePath = path.join(ChangeFileDir, file); - const fileParts = path.parse(filePath); - if (fileParts.ext !== ".md") continue; - if (!SemVer.valid(fileParts.name) || SemVer.lt(argv.version, fileParts.name)) continue; - fragments.set(fileParts.name, await fs.promises.readFile(filePath, "utf8")); - } - - const sortedFragments = Array.from(fragments).sort((a, b) => SemVer.compare(b[0], a[0])); - - const latestMajor = SemVer.major(sortedFragments[0][0]); - const latestMinor = SemVer.minor(sortedFragments[0][0]); - - for (const [version, notes] of sortedFragments) { - const currentMajor = SemVer.major(version); - const currentMinor = SemVer.minor(version); - if (latestMajor !== currentMajor || latestMinor !== currentMinor) continue; - out.log(``); - out.log(`## Changes of version ${version}`); - out.log(notes.trimEnd() + "\n"); - } -} +}); diff --git a/utility/generate-release-note/shared/index.js b/utility/generate-release-note/shared/index.mjs similarity index 72% rename from utility/generate-release-note/shared/index.js rename to utility/generate-release-note/shared/index.mjs index 3730d08d1..5fa4b8daf 100644 --- a/utility/generate-release-note/shared/index.js +++ b/utility/generate-release-note/shared/index.mjs @@ -1,5 +1,3 @@ -"use strict"; - class Output { constructor() { this.buffer = ""; @@ -8,5 +6,4 @@ class Output { this.buffer += s.join("") + "\n"; } } - -exports.Output = Output; +export { Output }; diff --git a/utility/generate-samples/index.js b/utility/generate-samples/index.mjs similarity index 80% rename from utility/generate-samples/index.js rename to utility/generate-samples/index.mjs index 4235b8511..7f2dae88e 100644 --- a/utility/generate-samples/index.js +++ b/utility/generate-samples/index.mjs @@ -1,29 +1,41 @@ -"use strict"; +import fs from "fs"; +import path from "path"; +import Button from "./templates/button.mjs"; +import GrandTitle from "./templates/grand-title.mjs"; +import Languages from "./templates/languages.mjs"; +import Weights from "./templates/weights.mjs"; +import Matrix from "./templates/matrix.mjs"; +import StylisticSet from "./templates/stylistic-set.mjs"; +import CharVariant from "./templates/character-variant.mjs"; +import LigationSet from "./templates/ligation-set.mjs"; +import { parseVariantsData } from "../export-data/variants-data.mjs"; +import { parseLigationData } from "../export-data/ligation-data.mjs"; -const fs = require("fs"); -const path = require("path"); - -const Button = require("./templates/button"); -const GrandTitle = require("./templates/grand-title"); -const Languages = require("./templates/languages"); -const Weights = require("./templates/weights"); -const Matrix = require("./templates/matrix"); -const StylisticSet = require("./templates/stylistic-set"); -const CharVariant = require("./templates/character-variant"); -const LigationSet = require("./templates/ligation-set"); - -const { parseVariantsData } = require("../export-data/variants-data"); -const { parseLigationData } = require("../export-data/ligation-data"); - -module.exports = async function main(argv) { +class Generator { + constructor(outputDir, fontFiles) { + this.outputDir = outputDir; + this.fontFiles = fontFiles; + this.tasksGenerated = []; + } + async add(name, template, args) { + for (const theme of ["light", "dark"]) { + const fullName = name + "." + theme; + const argsWithTheme = { ...args, theme }; + const generated = template(argsWithTheme); + generated.fontFiles = this.fontFiles; + let jsonPath = path.join(this.outputDir, fullName + ".json"); + await fs.promises.writeFile(jsonPath, JSON.stringify(generated, null, " ")); + this.tasksGenerated.push(fullName); + } + } +} +export default (async function main(argv) { const variantsData = await parseVariantsData(); const ligationData = await parseLigationData(); - const tasks = new Generator( argv.outputDir, argv.fontGroups.map(fg => path.resolve(process.cwd(), "dist", fg, "ttf", "*.ttf")) ); - await tasks.add("grand-title", GrandTitle, {}); await tasks.add("button-release", Button, { text: "Release ", stressText: argv.version }); await tasks.add("button-customize", Button, { text: "Customize" }); @@ -31,7 +43,6 @@ module.exports = async function main(argv) { await tasks.add("matrix", Matrix, {}); await tasks.add("languages", Languages, {}); await tasks.add("weights", Weights, {}); - // Packages for (const pst of argv.packageSnapshotTasks) { await tasks.add(pst.name, StylisticSet, { @@ -44,7 +55,6 @@ module.exports = async function main(argv) { hotChars: [] }); } - // Ligation sets for (const ls of ligationData.nonMergeSets) { await tasks.add(`ligset-${ls.tag}-${ls.rank}`, LigationSet, { @@ -57,7 +67,6 @@ module.exports = async function main(argv) { ligSets: ls.ligSets }); } - // SS for (const ss of variantsData.composites) { await tasks.add(`ss-u-${ss.tag}-${ss.rank}`, StylisticSet, { @@ -79,7 +88,6 @@ module.exports = async function main(argv) { hotChars: ss.hotChars.sans.italic }); } - // CV for (const cv of [...variantsData.specials, ...variantsData.primes]) { if (!cv.tag && !cv.isSpecial) continue; @@ -91,28 +99,5 @@ module.exports = async function main(argv) { }); } } - return tasks.tasksGenerated; -}; - -class Generator { - constructor(outputDir, fontFiles) { - this.outputDir = outputDir; - this.fontFiles = fontFiles; - this.tasksGenerated = []; - } - - async add(name, template, args) { - for (const theme of ["light", "dark"]) { - const fullName = name + "." + theme; - const argsWithTheme = { ...args, theme }; - - const generated = template(argsWithTheme); - generated.fontFiles = this.fontFiles; - - let jsonPath = path.join(this.outputDir, fullName + ".json"); - await fs.promises.writeFile(jsonPath, JSON.stringify(generated, null, " ")); - this.tasksGenerated.push(fullName); - } - } -} +}); diff --git a/utility/generate-samples/templates/button.js b/utility/generate-samples/templates/button.mjs similarity index 85% rename from utility/generate-samples/templates/button.js rename to utility/generate-samples/templates/button.mjs index 1bae0c0cc..2e17646d1 100644 --- a/utility/generate-samples/templates/button.js +++ b/utility/generate-samples/templates/button.mjs @@ -1,6 +1,5 @@ -const themes = require("../themes/index"); - -module.exports = function (args) { +import * as themes from "../themes/index.mjs"; +export default (function (args) { const theme = themes[args.theme]; const EM = 16; return { @@ -23,4 +22,4 @@ module.exports = function (args) { } ] }; -}; +}); diff --git a/utility/generate-samples/templates/character-variant.js b/utility/generate-samples/templates/character-variant.mjs similarity index 89% rename from utility/generate-samples/templates/character-variant.js rename to utility/generate-samples/templates/character-variant.mjs index ecd3317b3..6a06e76e3 100644 --- a/utility/generate-samples/templates/character-variant.js +++ b/utility/generate-samples/templates/character-variant.mjs @@ -1,11 +1,8 @@ -const themes = require("../themes/index"); - -module.exports = function (args) { +import * as themes from "../themes/index.mjs"; +export default (function (args) { const theme = themes[args.theme]; const unitWidth = 128; - let frames = []; - for (const ch of args.hotChars) { const slopeClasses = args.slopeDependent ? ["normal", "italic"] : ["normal"]; for (const slope of slopeClasses) { @@ -27,10 +24,9 @@ module.exports = function (args) { }); } } - return { width: unitWidth * frames.length, height: 160, frames }; -}; +}); diff --git a/utility/generate-samples/templates/grand-title.js b/utility/generate-samples/templates/grand-title.mjs similarity index 80% rename from utility/generate-samples/templates/grand-title.js rename to utility/generate-samples/templates/grand-title.mjs index 815773ab8..db3052992 100644 --- a/utility/generate-samples/templates/grand-title.js +++ b/utility/generate-samples/templates/grand-title.mjs @@ -1,6 +1,5 @@ -const themes = require("../themes/index"); - -module.exports = function (args) { +import * as themes from "../themes/index.mjs"; +export default (function (args) { const theme = themes[args.theme]; const EM = 240; return { @@ -22,4 +21,4 @@ module.exports = function (args) { } ] }; -}; +}); diff --git a/utility/generate-samples/templates/languages.js b/utility/generate-samples/templates/languages.js deleted file mode 100644 index 9da3cc992..000000000 --- a/utility/generate-samples/templates/languages.js +++ /dev/null @@ -1,82 +0,0 @@ -const themes = require("../themes/index"); - -module.exports = function (args) { - const theme = themes[args.theme]; - - const EM = 24; - const elementHeight = 1.5 * EM; - - const canvasWidth = 60 * EM; - const canvasHeight = 40 * EM; - const xSplit = 10 * EM; - - let frames = []; - for (const [j, { lang, sample }] of languages.entries()) { - const top = canvasHeight / 2 + elementHeight * (j - languages.length / 2); - - frames.push({ - top, - bottom: top + elementHeight, - left: EM, - right: xSplit, - "horizontal-align": "left", - "vertical-align": "center", - contents: [ - { - "font-family": "Iosevka", - "font-size": EM, - "font-weight": 600, - color: theme.title - }, - lang - ] - }); - frames.push({ - top, - bottom: top + elementHeight, - left: xSplit, - right: canvasWidth - EM, - "horizontal-align": "left", - "vertical-align": "center", - contents: [ - { - "font-family": "Iosevka", - "font-size": EM, - "font-style": "italic", - color: theme.body - }, - sample - ] - }); - } - - return { width: canvasWidth, height: canvasHeight, frames }; -}; - -// prettier-ignore -const languages = [ - {lang: 'English', sample: 'Shaw, those twelve beige hooks are joined if I patch a young, gooey mouth.'}, - {lang: 'IPA', sample: '[ɢʷɯʔ.nas.doːŋ.kʰlja] [ŋan.ȵʑi̯wo.ɕi̯uĕn.ɣwa]'}, - {lang: 'Bulgarian', sample: 'Я, пазачът Вальо уж бди, а скришом хапва кюфтенца зад щайгите.'}, - {lang: 'Czech', sample: 'Nechť již hříšné saxofony ďáblů rozezvučí síň úděsnými tóny waltzu, tanga a quickstepu.'}, - {lang: 'Finnish', sample: 'Charles Darwin jammaili Åken hevixylofonilla Qatarin yöpub Zeligissä.'}, - {lang: 'French', sample: 'Voix ambiguë d’un cœur qui au zéphyr préfère les jattes de kiwi.'}, - {lang: 'German', sample: 'Victor jagt zwölf Boxkämpfer quer über den großen Sylter Deich.'}, - {lang: 'Greek', sample: 'Ταχίστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός.'}, - {lang: 'Ancient Greek', sample: 'Ἄδμηθ’, ὁρᾷς γὰρ τἀμὰ πράγμαθ’ ὡς ἔχει, λέξαι θέλω σοι πρὶν θανεῖν ἃ βούλομαι.'}, - {lang: 'Hungarian', sample: 'Jó foxim és don Quijote húszwattos lámpánál ülve egy pár bűvös cipőt készít.'}, - {lang: 'Icelandic', sample: 'Kæmi ný öxi hér, ykist þjófum nú bæði víl og ádrepa.'}, - {lang: 'Irish', sample: 'Ċuaiġ bé ṁórṡáċ le dlúṫspád fíorḟinn trí hata mo ḋea-ṗorcáin ḃig.'}, - {lang: 'Latvian', sample: 'Muļķa hipiji mēģina brīvi nogaršot celofāna žņaudzējčūsku.'}, - {lang: 'Lithuanian', sample: 'Įlinkdama fechtuotojo špaga sublykčiojusi pragręžė apvalų arbūzą.'}, - {lang: 'Macedonian', sample: 'Ѕидарски пејзаж: шугав билмез со чудење џвака ќофте и кељ на туѓ цех.'}, - {lang: 'Norwegian', sample: 'Jeg begynte å fortære en sandwich mens jeg kjørte taxi på vei til quiz'}, - {lang: 'Polish', sample: 'Pchnąć w tę łódź jeża lub ośm skrzyń fig.'}, - {lang: 'Portuguese', sample: 'Luís argüia à Júlia que «brações, fé, chá, óxido, pôr, zângão» eram palavras do português.'}, - {lang: 'Romanian', sample: 'Înjurând pițigăiat, zoofobul comandă vexat whisky și tequila.'}, - {lang: 'Russian', sample: 'Широкая электрификация южных губерний даст мощный толчок подъёму сельского хозяйства.'}, - {lang: 'Serbian', sample: 'Ајшо, лепото и чежњо, за љубав срца мога дођи у Хаџиће на кафу.'}, - {lang: 'Spanish', sample: 'Benjamín pidió una bebida de kiwi y fresa; Noé, sin vergüenza, la más exquisita champaña del menú.'}, - {lang: 'Turkish', sample: 'Pijamalı hasta yağız şoföre çabucak güvendi.'}, - {lang: 'Ukrainian', sample: 'Чуєш їх, доцю, га? Кумедна ж ти, прощайся без ґольфів!'} -]; diff --git a/utility/generate-samples/templates/languages.mjs b/utility/generate-samples/templates/languages.mjs new file mode 100644 index 000000000..1d5924604 --- /dev/null +++ b/utility/generate-samples/templates/languages.mjs @@ -0,0 +1,75 @@ +import * as themes from "../themes/index.mjs"; +// prettier-ignore +const languages = [ + { lang: 'English', sample: 'Shaw, those twelve beige hooks are joined if I patch a young, gooey mouth.' }, + { lang: 'IPA', sample: '[ɢʷɯʔ.nas.doːŋ.kʰlja] [ŋan.ȵʑi̯wo.ɕi̯uĕn.ɣwa]' }, + { lang: 'Bulgarian', sample: 'Я, пазачът Вальо уж бди, а скришом хапва кюфтенца зад щайгите.' }, + { lang: 'Czech', sample: 'Nechť již hříšné saxofony ďáblů rozezvučí síň úděsnými tóny waltzu, tanga a quickstepu.' }, + { lang: 'Finnish', sample: 'Charles Darwin jammaili Åken hevixylofonilla Qatarin yöpub Zeligissä.' }, + { lang: 'French', sample: 'Voix ambiguë d’un cœur qui au zéphyr préfère les jattes de kiwi.' }, + { lang: 'German', sample: 'Victor jagt zwölf Boxkämpfer quer über den großen Sylter Deich.' }, + { lang: 'Greek', sample: 'Ταχίστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός.' }, + { lang: 'Ancient Greek', sample: 'Ἄδμηθ’, ὁρᾷς γὰρ τἀμὰ πράγμαθ’ ὡς ἔχει, λέξαι θέλω σοι πρὶν θανεῖν ἃ βούλομαι.' }, + { lang: 'Hungarian', sample: 'Jó foxim és don Quijote húszwattos lámpánál ülve egy pár bűvös cipőt készít.' }, + { lang: 'Icelandic', sample: 'Kæmi ný öxi hér, ykist þjófum nú bæði víl og ádrepa.' }, + { lang: 'Irish', sample: 'Ċuaiġ bé ṁórṡáċ le dlúṫspád fíorḟinn trí hata mo ḋea-ṗorcáin ḃig.' }, + { lang: 'Latvian', sample: 'Muļķa hipiji mēģina brīvi nogaršot celofāna žņaudzējčūsku.' }, + { lang: 'Lithuanian', sample: 'Įlinkdama fechtuotojo špaga sublykčiojusi pragręžė apvalų arbūzą.' }, + { lang: 'Macedonian', sample: 'Ѕидарски пејзаж: шугав билмез со чудење џвака ќофте и кељ на туѓ цех.' }, + { lang: 'Norwegian', sample: 'Jeg begynte å fortære en sandwich mens jeg kjørte taxi på vei til quiz' }, + { lang: 'Polish', sample: 'Pchnąć w tę łódź jeża lub ośm skrzyń fig.' }, + { lang: 'Portuguese', sample: 'Luís argüia à Júlia que «brações, fé, chá, óxido, pôr, zângão» eram palavras do português.' }, + { lang: 'Romanian', sample: 'Înjurând pițigăiat, zoofobul comandă vexat whisky și tequila.' }, + { lang: 'Russian', sample: 'Широкая электрификация южных губерний даст мощный толчок подъёму сельского хозяйства.' }, + { lang: 'Serbian', sample: 'Ајшо, лепото и чежњо, за љубав срца мога дођи у Хаџиће на кафу.' }, + { lang: 'Spanish', sample: 'Benjamín pidió una bebida de kiwi y fresa; Noé, sin vergüenza, la más exquisita champaña del menú.' }, + { lang: 'Turkish', sample: 'Pijamalı hasta yağız şoföre çabucak güvendi.' }, + { lang: 'Ukrainian', sample: 'Чуєш їх, доцю, га? Кумедна ж ти, прощайся без ґольфів!' } +]; +export default (function (args) { + const theme = themes[args.theme]; + const EM = 24; + const elementHeight = 1.5 * EM; + const canvasWidth = 60 * EM; + const canvasHeight = 40 * EM; + const xSplit = 10 * EM; + let frames = []; + for (const [j, { lang, sample }] of languages.entries()) { + const top = canvasHeight / 2 + elementHeight * (j - languages.length / 2); + frames.push({ + top, + bottom: top + elementHeight, + left: EM, + right: xSplit, + "horizontal-align": "left", + "vertical-align": "center", + contents: [ + { + "font-family": "Iosevka", + "font-size": EM, + "font-weight": 600, + color: theme.title + }, + lang + ] + }); + frames.push({ + top, + bottom: top + elementHeight, + left: xSplit, + right: canvasWidth - EM, + "horizontal-align": "left", + "vertical-align": "center", + contents: [ + { + "font-family": "Iosevka", + "font-size": EM, + "font-style": "italic", + color: theme.body + }, + sample + ] + }); + } + return { width: canvasWidth, height: canvasHeight, frames }; +}); diff --git a/utility/generate-samples/templates/ligation-set.js b/utility/generate-samples/templates/ligation-set.mjs similarity index 92% rename from utility/generate-samples/templates/ligation-set.js rename to utility/generate-samples/templates/ligation-set.mjs index 63d0738c1..7f2ab5310 100644 --- a/utility/generate-samples/templates/ligation-set.js +++ b/utility/generate-samples/templates/ligation-set.mjs @@ -1,6 +1,26 @@ -const themes = require("../themes/index"); - -module.exports = function (args) { +import * as themes from "../themes/index.mjs"; +function* makeSample(theme, args) { + const groupSet = new Set(args.ligSets); + for (const row of args.ligationSamples) { + for (const sampleStr of row) { + let rank = 0; + for (const [lgName, lg] of Object.entries(args.ligationCherry)) { + if (!groupSet.has(lg.ligGroup)) continue; + if (!new Set(lg.samples || []).has(sampleStr)) continue; + const rankT = lg.sampleRank || 1; + if (rankT > rank) rank = rankT; + } + yield [{ color: theme[rank > 1 ? "stress" : rank > 0 ? "body" : "dimmed"] }, sampleStr]; + yield " "; + } + yield "\n"; + } +} +function trimNewline(xs) { + while (xs.length && xs[xs.length - 1] === "\n") xs.pop(); + return xs; +} +export default (function (args) { const theme = themes[args.theme]; return { width: 1200, @@ -19,28 +39,4 @@ module.exports = function (args) { } ] }; -}; - -function* makeSample(theme, args) { - const groupSet = new Set(args.ligSets); - - for (const row of args.ligationSamples) { - for (const sampleStr of row) { - let rank = 0; - for (const [lgName, lg] of Object.entries(args.ligationCherry)) { - if (!groupSet.has(lg.ligGroup)) continue; - if (!new Set(lg.samples || []).has(sampleStr)) continue; - const rankT = lg.sampleRank || 1; - if (rankT > rank) rank = rankT; - } - yield [{ color: theme[rank > 1 ? "stress" : rank > 0 ? "body" : "dimmed"] }, sampleStr]; - yield " "; - } - yield "\n"; - } -} - -function trimNewline(xs) { - while (xs.length && xs[xs.length - 1] === "\n") xs.pop(); - return xs; -} +}); diff --git a/utility/generate-samples/templates/matrix.js b/utility/generate-samples/templates/matrix.mjs similarity index 93% rename from utility/generate-samples/templates/matrix.js rename to utility/generate-samples/templates/matrix.mjs index f1f9767d5..15d8be49e 100644 --- a/utility/generate-samples/templates/matrix.js +++ b/utility/generate-samples/templates/matrix.mjs @@ -1,15 +1,11 @@ -const themes = require("../themes/index"); - -module.exports = function (args) { +import * as themes from "../themes/index.mjs"; +export default (function (args) { const theme = themes[args.theme]; - const EM = 48; const elementWidth = 2.75 * EM; const elementHeight = 1.5 * EM; - const canvasWidth = 30 * EM; const canvasHeight = 12 * EM; - const lineConfig = [ [-(1 / 4), "Iosevka", "normal"], [+(1 / 4), "Iosevka Slab", "normal"], @@ -19,13 +15,11 @@ module.exports = function (args) { [+(1 / 4), "Iosevka Slab", "italic"] ]; const weights = [100, 200, 300, 400, 500, 600, 700, 800, 900]; - let frames = []; for (const [iLine, [pOffset, family, slope]] of lineConfig.entries()) { for (const [iWeight, weight] of weights.entries()) { const left = canvasWidth / 2 + elementWidth * (iWeight + pOffset - weights.length / 2); const top = canvasHeight / 2 + elementHeight * (iLine - lineConfig.length / 2); - frames.push({ left, top, @@ -46,6 +40,5 @@ module.exports = function (args) { }); } } - return { width: canvasWidth, height: canvasHeight, frames }; -}; +}); diff --git a/utility/generate-samples/templates/stylistic-set.js b/utility/generate-samples/templates/stylistic-set.mjs similarity index 94% rename from utility/generate-samples/templates/stylistic-set.js rename to utility/generate-samples/templates/stylistic-set.mjs index e7e96bdbc..e8f0f32de 100644 --- a/utility/generate-samples/templates/stylistic-set.js +++ b/utility/generate-samples/templates/stylistic-set.mjs @@ -1,28 +1,4 @@ -const themes = require("../themes/index"); - -module.exports = function (args) { - const theme = themes[args.theme]; - return { - width: 600 * args.hSize, - height: 200 * args.vSize, - frames: [ - { - "horizontal-align": "center", - "vertical-align": "center", - "line-height": 1.25, - contents: [ - { "font-family": args.fontFamily, "font-style": args.fontStyle }, - { "font-size": 24, color: theme.body }, - { "font-feature-settings": { calt: 1 } }, - trimNewline([ - ...makeSample(theme, args.lineBreakMode, args.fontFeatures, args.hotChars) - ]) - ] - } - ] - }; -}; - +import * as themes from "../themes/index.mjs"; const ssStrings = [ ["ABC.DEF.GHI.JKL.MNO.PQRS.TUV.WXYZ", "abc.def.ghi.jkl.mno.pqrs.tuv.wxyz"], ["¢ ſß ΓΛΔ αδιλμξ КУЗЯЖэльфязычникж", "float il1[]={1-2/3.4,5+6=7/8%90};"], @@ -51,8 +27,29 @@ function* makeSample(theme, lbm, features, hotChars) { } } } - function trimNewline(xs) { while (xs.length && xs[xs.length - 1] === "\n") xs.pop(); return xs; } +export default (function (args) { + const theme = themes[args.theme]; + return { + width: 600 * args.hSize, + height: 200 * args.vSize, + frames: [ + { + "horizontal-align": "center", + "vertical-align": "center", + "line-height": 1.25, + contents: [ + { "font-family": args.fontFamily, "font-style": args.fontStyle }, + { "font-size": 24, color: theme.body }, + { "font-feature-settings": { calt: 1 } }, + trimNewline([ + ...makeSample(theme, args.lineBreakMode, args.fontFeatures, args.hotChars) + ]) + ] + } + ] + }; +}); diff --git a/utility/generate-samples/templates/weights.js b/utility/generate-samples/templates/weights.mjs similarity index 90% rename from utility/generate-samples/templates/weights.js rename to utility/generate-samples/templates/weights.mjs index 67360bc38..c33d38e51 100644 --- a/utility/generate-samples/templates/weights.js +++ b/utility/generate-samples/templates/weights.mjs @@ -1,20 +1,14 @@ -const themes = require("../themes/index"); - -module.exports = function (args) { +import * as themes from "../themes/index.mjs"; +export default (function (args) { const theme = themes[args.theme]; - const EM = 48; const elementHeight = 1.5 * EM; - const canvasWidth = 30 * EM; const canvasHeight = 15 * EM; - const weights = [100, 200, 300, 400, 500, 600, 700, 800, 900]; - let frames = []; for (const [iWeight, weight] of weights.entries()) { const top = canvasHeight / 2 + elementHeight * (iWeight - weights.length / 2); - frames.push({ top, bottom: top + elementHeight, @@ -34,6 +28,5 @@ module.exports = function (args) { ] }); } - return { width: canvasWidth, height: canvasHeight, frames }; -}; +}); diff --git a/utility/generate-samples/themes/index.js b/utility/generate-samples/themes/index.js deleted file mode 100644 index 7c359043a..000000000 --- a/utility/generate-samples/themes/index.js +++ /dev/null @@ -1,13 +0,0 @@ -exports.light = { - body: "#20242E", - dimmed: "#20242E40", - stress: "#048FBF", - title: "#8757AD" -}; - -exports.dark = { - body: "#DEE4E3", - dimmed: "#DEE4E340", - stress: "#03AEE9", - title: "#B77FDB" -}; diff --git a/utility/generate-samples/themes/index.mjs b/utility/generate-samples/themes/index.mjs new file mode 100644 index 000000000..515445552 --- /dev/null +++ b/utility/generate-samples/themes/index.mjs @@ -0,0 +1,12 @@ +export const light = { + body: "#20242E", + dimmed: "#20242E40", + stress: "#048FBF", + title: "#8757AD" +}; +export const dark = { + body: "#DEE4E3", + dimmed: "#DEE4E340", + stress: "#03AEE9", + title: "#B77FDB" +}; diff --git a/utility/make-webfont-css.js b/utility/make-webfont-css.mjs similarity index 90% rename from utility/make-webfont-css.js rename to utility/make-webfont-css.mjs index c1b2e7688..1b011282e 100644 --- a/utility/make-webfont-css.js +++ b/utility/make-webfont-css.mjs @@ -1,17 +1,14 @@ -"use strict"; - -const fs = require("fs"); +import fs from "fs"; const WebfontFormatMap = new Map([ ["woff2", "woff2"], ["ttf", "truetype"] ]); -module.exports = function (output, family, hs, formats, unhinted) { +export default (function (output, family, hs, formats, unhinted) { if (!formats) { fs.writeFileSync(output, ""); return; } - let ans = ``; for (const ext of formats) { if (!WebfontFormatMap.get(ext)) throw new TypeError("Invalid webfont file format " + ext); @@ -49,4 +46,4 @@ module.exports = function (output, family, hs, formats, unhinted) { } } fs.writeFileSync(output, ans); -}; +}); diff --git a/utility/ttf-to-woff2.js b/utility/ttf-to-woff2.mjs similarity index 51% rename from utility/ttf-to-woff2.js rename to utility/ttf-to-woff2.mjs index 05957fe4d..a9f04a709 100644 --- a/utility/ttf-to-woff2.js +++ b/utility/ttf-to-woff2.mjs @@ -1,10 +1,8 @@ -"use strict"; +import fs from "fs"; +import * as wawoff from "wawoff2"; -const fs = require("fs"); -const wawoff = require("wawoff2"); - -module.exports = async function (from, to) { +export default (async function (from, to) { const input = await fs.promises.readFile(from); const out = await wawoff.compress(input); await fs.promises.writeFile(to, out); -}; +}); diff --git a/utility/update-package-json-version/index.js b/utility/update-package-json-version/index.mjs similarity index 90% rename from utility/update-package-json-version/index.js rename to utility/update-package-json-version/index.mjs index 0ccad77e2..8a2fb2d94 100644 --- a/utility/update-package-json-version/index.js +++ b/utility/update-package-json-version/index.mjs @@ -1,12 +1,9 @@ -"use strict"; - -const path = require("path"); -const fs = require("fs"); -const semver = require("semver"); +import path from "path"; +import fs from "fs"; +import semver from "semver"; const ChangeFileDir = path.join(__dirname, "../../changes"); const PackageJsonPath = path.join(__dirname, "../../package.json"); - setTimeout( () => main().catch(e => { @@ -15,16 +12,13 @@ setTimeout( }), 0 ); - /////////////////////////////////////////////////////////////////////////////////////////////////// - async function main() { const version = await GetLatestVersion(); const packageJson = JSON.parse(await fs.promises.readFile(PackageJsonPath)); packageJson.version = version; await fs.promises.writeFile(PackageJsonPath, JSON.stringify(packageJson, null, " ") + "\n"); } - async function GetLatestVersion() { const changeFiles = await fs.promises.readdir(ChangeFileDir); const versions = new Set(); diff --git a/verdafile.js b/verdafile.mjs similarity index 95% rename from verdafile.js rename to verdafile.mjs index a0e969f52..289fa61c5 100644 --- a/verdafile.js +++ b/verdafile.mjs @@ -1,22 +1,19 @@ -"use strict"; - -const fs = require("fs"); -const build = require("verda").create(); -const which = require("which"); -const Path = require("path"); -const toml = require("@iarna/toml"); -const semver = require("semver"); -const uuid = require("uuid"); +import * as FS from "fs"; +import * as Path from "path"; +import * as Verda from "verda"; +import which from "which"; +import * as toml from "@iarna/toml"; +import semver from "semver"; +import * as uuid from "uuid"; /////////////////////////////////////////////////////////// +export const build = Verda.create(); const { task, file, oracle, computed, phony } = build.ruleTypes; const { de, fu, sfu, ofu } = build.rules; const { run, node, cd, cp, rm, fail, echo, silently } = build.actions; const { FileList } = build.predefinedFuncs; -module.exports = build; - /////////////////////////////////////////////////////////// const BUILD = ".build"; @@ -52,7 +49,7 @@ build.setSelfTracking(); const Version = computed(`env::version`, async target => { const [pjf] = await target.need(sfu`package.json`); - const pj = JSON.parse(await fs.promises.readFile(pjf.full, "utf-8")); + const pj = JSON.parse(await FS.promises.readFile(pjf.full, "utf-8")); return pj.version; }); @@ -66,7 +63,7 @@ const CheckTtfAutoHintExists = oracle(`oracle:check-ttfautohint-exists`, async t const Dependencies = computed("env::dependencies", async target => { const [pjf] = await target.need(sfu`package.json`); - const pj = JSON.parse(await fs.promises.readFile(pjf.full, "utf-8")); + const pj = JSON.parse(await FS.promises.readFile(pjf.full, "utf-8")); let subGoals = []; for (const pkgName in pj.dependencies) { subGoals.push(InstalledVersion(pkgName, pj.dependencies[pkgName])); @@ -79,7 +76,7 @@ const InstalledVersion = computed.make( (pkg, required) => `env::installed-version::${pkg}::${required}`, async (target, pkg, required) => { const [pj] = await target.need(sfu(`node_modules/${pkg}/package.json`)); - const depPkg = JSON.parse(await fs.promises.readFile(pj.full)); + const depPkg = JSON.parse(await FS.promises.readFile(pj.full)); if (!semver.satisfies(depPkg.version, required)) { fail( `Package version for ${pkg} is outdated:`, @@ -100,7 +97,7 @@ const RawPlans = computed(`metadata:raw-plans`, async target => { const bp = await tryParseToml(BUILD_PLANS); bp.buildOptions = bp.buildOptions || {}; - if (fs.existsSync(PRIVATE_BUILD_PLANS)) { + if (FS.existsSync(PRIVATE_BUILD_PLANS)) { const privateBP = await tryParseToml(PRIVATE_BUILD_PLANS); Object.assign(bp.buildPlans, privateBP.buildPlans || {}); Object.assign(bp.collectPlans, privateBP.collectPlans || {}); @@ -110,7 +107,7 @@ const RawPlans = computed(`metadata:raw-plans`, async target => { }); async function tryParseToml(str) { try { - return JSON.parse(JSON.stringify(toml.parse(fs.readFileSync(str, "utf-8")))); + return JSON.parse(JSON.stringify(toml.parse(FS.readFileSync(str, "utf-8")))); } catch (e) { throw new Error( `Failed to parse configuration file ${str}.\n` + @@ -305,7 +302,7 @@ function makeSuffix(w, wd, s, fallback) { } function whyBuildPlanIsnNotThere(gid) { - if (!fs.existsSync(PRIVATE_BUILD_PLANS)) + if (!FS.existsSync(PRIVATE_BUILD_PLANS)) return "\n -- Possible reason: Config file 'private-build-plans.toml' does not exist."; return ""; } @@ -331,7 +328,7 @@ const DistUnhintedTTF = file.make( const cacheDiffPath = `${charMapDir}/${fn}.cache.mpz`; echo.action(echo.hl.command(`Create TTF`), fn, echo.hl.operator("->"), out.full); - const { cacheUpdated } = await silently.node("font-src/index", { + const { cacheUpdated } = await silently.node("font-src/index.mjs", { o: out.full, oCharMap: charMapPath, cacheFreshAgeKey: ageKey, @@ -343,7 +340,7 @@ const DistUnhintedTTF = file.make( if (cacheUpdated) { const lock = build.locks.alloc(cacheFileName); await lock.acquire(); - await silently.node(`font-src/merge-cache`, { + await silently.node(`font-src/merge-cache.mjs`, { base: cachePath, diff: cacheDiffPath, version: fi.menu.version, @@ -381,7 +378,7 @@ const DistWoff2 = file.make( const [from] = await target.need(Ctor(group, f), de`${out.dir}`); echo.action(echo.hl.command("Create WOFF2"), from.full, echo.hl.operator("->"), out.full); - await silently.node(`utility/ttf-to-woff2.js`, from.full, out.full); + await silently.node(`utility/ttf-to-woff2.mjs`, from.full, out.full); } ); @@ -432,7 +429,7 @@ async function createWebFontCssImpl(target, output, gr, formats, unhinted) { const [bp, ts] = await target.need(BuildPlanOf(gr), GroupFontsOf(gr)); const hs = await target.need(...ts.map(FontInfoOf)); echo.action(echo.hl.command(`Create WebFont CSS`), gr, echo.hl.operator("->"), output); - await silently.node("utility/make-webfont-css.js", output, bp.family, hs, formats, unhinted); + await silently.node("utility/make-webfont-css.mjs", output, bp.family, hs, formats, unhinted); } // Content files @@ -706,7 +703,7 @@ const PagesDataExport = task(`pages:data-export`, async t => { BuildCM("iosevka", "iosevka-italic"), BuildCM("iosevka", "iosevka-oblique") ); - await node(`utility/export-data/index`, { + await node(`utility/export-data/index.mjs`, { charMapPath: cm.full, charMapItalicPath: cmi.full, charMapObliquePath: cmo.full, @@ -764,7 +761,7 @@ const AmendReadmeFor = task.make( BuildCM("iosevka", "iosevka-italic"), BuildCM("iosevka", "iosevka-oblique") ); - return node(`utility/amend-readme/index`, { + return node(`utility/amend-readme/index.mjs`, { mdFilePath: f, charMapPath: cm.full, charMapItalicPath: cmi.full, @@ -791,7 +788,7 @@ const SampleImagesPre = task(`sample-images:pre`, async target => { GroupTtfsImpl(`iosevka-aile`, false), GroupTtfsImpl(`iosevka-etoile`, false) ); - return await node("utility/generate-samples/index.js", { + return await node("utility/generate-samples/index.mjs", { outputDir: IMAGE_TASKS, packageSnapshotTasks: await PackageSnapshotConfig(target), fontGroups: fontGroups, @@ -839,7 +836,7 @@ const ReleaseNotesFile = file.make( await t.need(Version, UtilScripts, de(ARCHIVE_DIR)); const [changeFiles, rpFiles] = await t.need(ChangeFileList(), ReleaseNotePackagesFile); await t.need(changeFiles.map(fu)); - await node("utility/generate-release-note/release-note", { + await node("utility/generate-release-note/release-note.mjs", { version, releasePackagesJsonPath: rpFiles.full, outputPath: out.full @@ -852,7 +849,7 @@ const ReleaseNotesPackageListMD = file.make( await t.need(Version, UtilScripts, de(ARCHIVE_DIR)); const [changeFiles, rpFiles] = await t.need(ChangeFileList(), ReleaseNotePackagesFile); await t.need(changeFiles.map(fu)); - await node("utility/generate-release-note/package-list", { + await node("utility/generate-release-note/package-list.mjs", { version, releasePackagesJsonPath: rpFiles.full, outputPath: out.full @@ -881,7 +878,7 @@ const ReleaseNotePackagesFile = file(`${BUILD}/release-packages.json`, async (t, quasiProportional: primePlan.spacing === "quasi-proportional" }; } - await fs.promises.writeFile(out.full, JSON.stringify(releaseNoteGroups, null, " ")); + await FS.promises.writeFile(out.full, JSON.stringify(releaseNoteGroups, null, " ")); }); const ChangeLog = task(`release:change-log`, async t => { await t.need(ChangeLogMd); @@ -891,7 +888,7 @@ const ChangeLogMd = file(`CHANGELOG.md`, async (t, out) => { await t.need(UtilScripts, de(ARCHIVE_DIR)); const [changeFiles] = await t.need(ChangeFileList()); await t.need(changeFiles.map(fu)); - await node("utility/generate-release-note/change-log", { version, outputPath: out.full }); + await node("utility/generate-release-note/change-log.mjs", { version, outputPath: out.full }); }); const ChangeFileList = oracle.make( () => `release:change-file-list`, @@ -926,7 +923,7 @@ phony(`release`, async target => { const [archiveFiles] = await target.need(goals); // Create hash of packages await target.need(fu`utility/create-sha-file.js`); - await node("utility/create-sha-file.js", "doc/packages-sha.txt", archiveFiles); + await node("utility/create-sha-file.mjs", "doc/packages-sha.txt", archiveFiles); // Images and release notes await target.need(SampleImages, Pages, AmendReadme, ReleaseNotes, ChangeLog); }); @@ -942,23 +939,19 @@ const ScriptsUnder = oracle.make( ); const UtilScriptFiles = computed("util-script-files", async target => { const [js, ejs, md] = await target.need( - ScriptsUnder("js", "utility"), + ScriptsUnder("mjs", "utility"), ScriptsUnder("ejs", "utility"), ScriptsUnder("md", "utility") ); return [...js, ...ejs, ...md]; }); -const SnapshotTemplateFiles = computed("snapshot-templates", async target => { - const [js] = await target.need(ScriptsUnder("js", "image-gen")); - return [...js]; -}); const ScriptFiles = computed.group("script-files", async (target, ext) => { const [ss] = await target.need(ScriptsUnder(ext, `font-src`)); return ss; }); const JavaScriptFromPtl = computed("scripts-js-from-ptl", async target => { const [ptl] = await target.need(ScriptFiles("ptl")); - return ptl.map(x => replaceExt(".js", x)); + return ptl.map(x => replaceExt(".mjs", x)); }); function replaceExt(extNew, file) { return Path.posix.join(Path.dirname(file), Path.basename(file, Path.extname(file)) + extNew); @@ -971,12 +964,12 @@ const CompiledJs = file.make( if (/\/glyphs\//.test(out.full)) await target.need(MARCOS); await target.need(sfu(ptl)); echo.action(echo.hl.command("Compile Script"), ptl); - await silently.run(PATEL_C, "--strict", ptl, "-o", out.full); + await silently.run(PATEL_C, "--esm", ptl, "-o", out.full); } ); const Scripts = task("scripts", async target => { const [jsFromPtlList] = await target.need(JavaScriptFromPtl); - const [jsList] = await target.need(ScriptFiles("js")); + const [jsList] = await target.need(ScriptFiles("mjs")); const jsFromPtlSet = new Set(jsFromPtlList); let subGoals = [];