glyphhanger - Has anyone succeeded using with KaTeX? #3361
Unanswered
universemaster
asked this question in
General
Replies: 1 comment
-
I guess the main thing to check is whether glyphhander is doing the correct subsetting. You can open the subsetted ttf files in https://opentype.js.org/glyph-inspector.html and check which glyphs are still present. If you see any that aren't on your site, then there's an issue (presumably with glyphhanger, not KaTeX?). You could also try it on a much smaller example, which only uses a few characters, to see whether you get a drastic size reduction in that case. This seems like an interesting approach to add to the documentation. Perhaps we need a new section on Optimization to collect all your ideas and approaches once they settle. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
Maybe someone else has had more success than me.
Despite having 16,000 katex "equations" on a page and 39 images, the fonts are still 17% of the transfer over the network (from chrome lighthouse).
So, I tried using glyphhanger and almost succeeded.
Once subset to only the glyphs I used on the page (apparently), I could reduce the 20 woff2 file sizes from 260KB to 190KB (a modest, but real, improvement). And in retrospect, writing it here, a suspiciously small reduction.
Aside: (Also, chrome lighthouse reports 8 files and 116.0KB transfer for the unoptimised set - whereas glyphhanger gives me 20 files with a total 190KB.)
However, after my initial excitement of some success I realised that characters like ℂ, and ℤ didn't appear correctly.
I'd sunk hours into using glyphhanger, so at this point I reverted to the full set and gave up.
Has anyone had more success?
I wonder if the disappointing file size reduction was because you have to use the ttf as the base, rather than starting with the woff2?
I didn't use the unicode-ranges output by glyphanger, because they themselves were very long. For example, here is KaTeX_SansSerif-Regular.css:
A final point while we are talking about fonts, when KaTeX stops supporting IE11, would it be a good idea to remove woff and ttf from katex.css because woff2 support is so good.
Beta Was this translation helpful? Give feedback.
All reactions