Skip to content

Modernize project + subset without pyftsubset#32

Draft
valadaptive wants to merge 14 commits intozachleat:masterfrom
valadaptive:glypht
Draft

Modernize project + subset without pyftsubset#32
valadaptive wants to merge 14 commits intozachleat:masterfrom
valadaptive:glypht

Conversation

@valadaptive
Copy link
Copy Markdown

I've made a webapp for subsetting and converting fonts, and part of that included compiling HarfBuzz' hb-subset API (and woff+woff2 conversion) to WebAssembly and exposing it via JS. As a proof-of-concept, I decided to try porting glyphhanger over to it, and it works!

Part of that work involved porting the codebase to use ES Modules, and I've also replaced a lot of dependencies with lighter alternatives (get-stdin -> Node builtins, chalk -> picocolors, glob -> tinyglobby). I'd also like to replace serve-static with sirv, but it doesn't yet function the same.

There are some other changes:

  • As part of getting the glyphhanger client script to work properly across Node versions, and because the new version of characterset is ESM-only, I've decided to just bundle the client script using esbuild into generated/glyphhanger-script.umd.js.
  • The output font files in the tests seem to be a couple dozen bytes larger, possibly because hb-subset supports more tables instead of dropping them?
  • I've removed the woff-zopfli format entirely; all WOFF1 encoding now always uses zopfli. I've also changed the default settings to no longer emit WOFF1, since all modern browsers support WOFF2.

The documentation could probably stand to be updated, and I'm waiting for that sirv PR to get merged so I can switch this project over to it. But I'm interested in feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant