From da1ac0b547c9b262a9b81a5bff4865c269942fe0 Mon Sep 17 00:00:00 2001 From: Connum Date: Mon, 22 Apr 2024 02:19:44 +0200 Subject: [PATCH 01/15] WIP: support standalone CFF1 files via plugin --- docs/glyph-inspector.html | 9 ++- src/font.js | 4 +- src/glyphset.js | 2 +- src/opentype.js | 58 +++++++++++++++--- src/plugins.mjs | 23 ++++++++ src/plugins/opentypejs.plugin.cff1file.mjs | 69 ++++++++++++++++++++++ src/tables/cff.js | 4 +- 7 files changed, 153 insertions(+), 16 deletions(-) create mode 100644 src/plugins.mjs create mode 100644 src/plugins/opentypejs.plugin.cff1file.mjs diff --git a/docs/glyph-inspector.html b/docs/glyph-inspector.html index 401a3aec..db0c9dd7 100644 --- a/docs/glyph-inspector.html +++ b/docs/glyph-inspector.html @@ -162,7 +162,8 @@

Free Software

} html += ''; if (glyph.numberOfContours > 0) { - var contours = glyph.getContours(window.font.variation.getTransform(glyph, window.fontOptions.variation).points); + const points = window.font.variation &&window.font.variation.getTransform(glyph, window.fontOptions.variation).points || glyph.points; + var contours = glyph.getContours(points); html += 'contours:
' + contours.map(contourToString).join('\n') + '
'; } else if (glyph.isComposite) { html += '
This composite glyph is a combination of :