Conversation
|
I ran this again, and couldn't reproduce the font files byte for byte. Looking at the output from
To help us decide, I actually created a branch that contains TTX files. It's not using them yet, and it does have the TTF, too. But it does show the effect of your pull request here in a human readable fasion: gagern@feefc7c That diff shows that pretty much all of your font file modifications are spurious. The only relevant ones are These are changes that should actually be reviewed, but all the other modifications should in my opinion not be part of this pull request here. Can you drop them please? I'm also a bit surprised tha Katex_Main-BoldItalic is not affected by this PR here. Is there a reason why the newly added glyphs are available only in three of our four styles? |
|
I've had a stab at approach 6 in #635. So far it looks as though we can't fully automate the process, though: users still have to enter some settings in one of their config files. Which allows them to choose different tools, or tools installed in locations outside their |
|
I think 6 is definitely better than what we were doing before which was 1. 3 sounds nice, but it's also more work, but it might be worth doing that work if we think we're going to change the fonts more often which seems entirely likely considering issues around missing spaces, accent characters, Euro symbol, etc. |
|
@gagern are you concerned that too many updates to the font files will balloon the repo size because the binary diffs are big? |
|
Yes. The WOFF fonts in particular are compressed, so a slight change in one part of the font file will likely lead to large changes throughout the file, and therefore bad delta compression of repository data. At 2.2 M the fonts directory is the largest portion of our repository. We should not lightly add 2.2 M a couple of times if we can avoid it. In the long run, it might make sense to only deploy the TTF files, and generate all the others locally or when rolling a release. Since the TTFs are afaik less compressed, they should delta-compress much better. If I find the time I could investigate whether we can get the machinery for WOFF, WOFF2 and EOT compiled to JavaScript using Emscripten, but that won't happen in the next couple of weeks. |
|
Any way the font metrics data could be updated to include horizontal metrics? Relevant to #587. |
|
@edemaine we just have to run |
|
Ah, cool. So that is already part of this PR. I'm not sure what the optimal timing is, but it sounds like #587 could already use this info. If we want to continue to hold on this PR, I guess we could make and commit new metrics for the old fonts, before switching to new fonts. |
|
I do think it'd be good to get horizontal metrics in, so that we can start playing with box sizes (though I'm not really sure when I can start on that). Would it make sense to use a separate repo for fonts, so that we don't worry as much about increasing the size of this one? Or switch to fewer font formats as suggested by @gagern? |
|
If we had the fonts in the a separate repo, we could set things up to do a shallow checkout of that repo... then it wouldn't matter if the size that repo ballooned. |
|
FWIW, I just read this Atlassian article about how to deal with large binary files in a Git repo. I learned about lots of options, though I'm not sure I have a specific proposal. Submodules could be a way to do multiple repos, but also increase use complexity... |
Another option might be to mount |
|
Are you suggesting using a docker to build eot, woff, woff2 files? I think that's fine as a way for people to update the fonts when the fonts change, but I don't think it should be required for users not playing with the fonts. I.e. doesn't fix the "font changes influencing repo size" issue. But maybe that wasn't your point. Back to the repo size issue, I feel like the shallow checkout of another repo dedicated to fonts seems reasonable. Will this affect npm, bower, CDN? |
|
I'm putting this on hold until we can move our fonts to a separate repo. |
|
Blocked on #816. |
|
Now that #891 has landed, this is unblocked. |
|
These changes will need to be made to https://github.com/KaTeX/katex-fonts. |
|
Now that the fonts are in a separate repo, all we need are the changes in symbols.js and mappings.pl. I'm going to open a new PR b/c I think rebasing this will be more trouble than it's worth. I'll also add commands for the ligatures, e.g. |


The updated fonts include the last few commits to https://github.com/Khan/MathJax-dev/ as well as changes in Khan/MathJax-dev#3.
Left/right single quotes work with the typewriter font.
The fonts also support latin ligatures, e.g. æ, œ, Æ, and Œ.