Skip to content
This repository has been archived by the owner on Apr 6, 2021. It is now read-only.

Improve fonts generation: remove unused codes #48

Merged
merged 11 commits into from
Sep 3, 2018

Conversation

ylemkimon
Copy link
Member

@ylemkimon ylemkimon commented Jun 28, 2018

This PR is part of #12.

  • Remove CSS generation: CSS is generated by fonts.less
  • Remove EOT and SVG font generation
    • EOT was removed in remove EOT font files #8
    • SVG was never used. In fact, SVG generation never worked since dependencies were not installed
    • Both font types are not needed in browsers that is supported by KaTeX
  • Remove skew data generation: skew data was never used
  • Remove Greek and Windows fonts: they were never used
  • Remove install target: copying font files is handled by buildFonts.sh
  • Remove fonts and pack target in src/Makefile
  • Remove unused dependencies and variables

@ylemkimon ylemkimon changed the title Improve fonts generation Improve fonts generation: remove unused codes Jun 28, 2018
@ylemkimon

This comment has been minimized.

@edemaine
Copy link
Member

I haven't looked at this yet, but what do you mean by "skew generation isn't used"? Don't we need this for italic correction/spreading out (in \mathit)?

@kevinbarabash

This comment has been minimized.

@kevinbarabash

This comment has been minimized.

@kevinbarabash
Copy link
Member

@ylemkimon this is awesome! Thanks for starting to simplify font creation.

@ylemkimon
Copy link
Member Author

@edemaine We have different method of calculating skew in metrics generation.

@ylemkimon ylemkimon added this to In progress in Improve fonts generation Jun 29, 2018
@ylemkimon
Copy link
Member Author

ylemkimon commented Jul 21, 2018

@kevinbarabash Of course, tests fail because KaTeX/KaTeX#1267 was not merged. Why didn't I think of that before 😄 Tested with latest KaTeX: KaTeX/KaTeX#1494.

@kevinbarabash
Copy link
Member

@edemaine We have different method of calculating skew in metrics generation.

@ylemkimon can you link to where this is being done?

@ylemkimon
Copy link
Member Author

@kevinbarabash

skewkern = 0.0
if (font_skewchar[font] and
font_skewchar[font] in tfm_char.kern_table):
skewkern = round(
tfm_char.kern_table[font_skewchar[font]], 5)

@ylemkimon

This comment has been minimized.

@ylemkimon

This comment has been minimized.

@edemaine
Copy link
Member

Another question: Should we support SVG fonts? This seems relevant to KaTeX one day supporting SVG output (KaTeX/KaTeX#375).

Ah, never mind: SVG fonts seem to have poor support in general, e.g., support for them was removed from Chrome. SVG can use any CSS-accessible fonts, at least in the browser.

@ylemkimon
Copy link
Member Author

This PR does not change contents of fonts. (Checked with ttx)

Copy link
Member

@edemaine edemaine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, this is substantial cleanup. The code changes look good to me.

However, I just tried running ./buildFonts.sh on this branch and (several minutes later) the font files seem to have changed (all of them). You seem to have had the opposite experience. I'm not sure how to do diffs for TTF/WOFF[2] files. Any thoughts on how to debug this discrepancy? (Or maybe it's because another PR merged since?)

[update] Or is your point that I should run ttx to dump the fonts and then compare?

@ylemkimon
Copy link
Member Author

@edemaine Without #54, font binaries will change due to timestamps. Yes, it is possible dump the font file to XML using ttx and compare them.

Copy link
Member

@edemaine edemaine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, given that you checked this already, I'm happy to approve.

@ylemkimon ylemkimon merged commit 5e4bfad into KaTeX:master Sep 3, 2018
Improve fonts generation automation moved this from In progress to Done Sep 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants