You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A plugin that detects inline fonts, and removes unused glyphs based on the text content in the SVG.
I've made a demo based on Dirk Lemstra's README, but with the WOFF2 font replaced with a TTF, as handling WOFF2 is a pain. This has JetBrains Mono inlined, and only uses the glyphs for OPEN SOURCE MAINTAINER in it.
If we were to opt for the implementation based on what I have, due to the additional dependencies it's probably not worth including the plugin in this repository. Rather, it can be installed separately and imported.
The following demo only has optimizeInlineFonts enabled. It looks fine on desktop, but the optimized file is broken in Firefox on Android. 🤔
dlemstra-jetbrains.svg (246 KiB)
dlemstra-optimized.svg (6 KiB)
Additional context
You can review the usable implementation here, or just expand optimizeInlineFonts.js below to see the plugin itself:
This branches off the discussion in #660.
Describe what the plugin should do
A plugin that detects inline fonts, and removes unused glyphs based on the text content in the SVG.
I've made a demo based on Dirk Lemstra's README, but with the WOFF2 font replaced with a TTF, as handling WOFF2 is a pain. This has JetBrains Mono inlined, and only uses the glyphs for
OPEN SOURCE MAINTAINER
in it.If we were to opt for the implementation based on what I have, due to the additional dependencies it's probably not worth including the plugin in this repository. Rather, it can be installed separately and imported.
The following demo only has
optimizeInlineFonts
enabled. It looks fine on desktop, but the optimized file is broken in Firefox on Android. 🤔dlemstra-jetbrains.svg
(246 KiB)dlemstra-optimized.svg
(6 KiB)Additional context
You can review the usable implementation here, or just expand
optimizeInlineFonts.js
below to see the plugin itself:optimizeInlineFonts.js
I half-assed it since it's just for demonstrative purposes. If we proceed with this, I'll happily improve it. Some known issues:
style
tag for inlined fonts.Implementation
The text was updated successfully, but these errors were encountered: