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

Improve fonts generation: clean up font build scripts #56

Merged
merged 15 commits into from Dec 6, 2019

Conversation

ylemkimon
Copy link
Member

@ylemkimon ylemkimon commented Sep 5, 2018

  • Removed Size4 font dependency
    • No longer need to build Size4 first and before other fonts, allows to build each fonts separately
  • Cleaned up font build script
  • Removed Math-Regular font (see Improve fonts generation: remove Math-Regular font #49)
  • Simplify directory structure, move src/fonts/OTF/TeX to src/fonts

This is final PR before moving to JS build system or possibly back to the main repo.

@ylemkimon ylemkimon added this to In progress in Improve fonts generation via automation Sep 5, 2018
@ylemkimon ylemkimon changed the title Improve fonts generation: Clean up font build scripts Improve fonts generation: clean up font build scripts Sep 5, 2018
@ylemkimon
Copy link
Member Author

The KaTeX test results for recents PRs including this are available at KaTeX/KaTeX#1699.

There are no visible changes, but only four subpixel changes.

@ylemkimon ylemkimon requested review from kevinbarabash and edemaine and removed request for kevinbarabash March 24, 2019 09:36
Copy link
Member

@kevinbarabash kevinbarabash left a comment

Choose a reason for hiding this comment

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

@ylemkimon sorry for the delay in reviewing this. I merged in master and re-ran sh buildFonts.sh and committed the new files. It looks like KaTeX/KaTeX#1888 is the replacement for KaTeX/KaTeX#1699. I'm going to update that PR as well to double check that nothing's changed with the fonts besides the removal of Math_Regular.

exit 1
fi
tar cf "$FILE" ../package.json Makefile default.cfg fonts/OTF/TeX
tar cfP "$FILE" ../package.json Makefile default.cfg fonts
Copy link
Member

Choose a reason for hiding this comment

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

I had to add a P here b/c tar was complaining about the leading ../ in package.json. The P option is intended to allow absolute paths so this resolution seems a bit wonky to me, but that's what was suggested in https://askubuntu.com/questions/568858/tar-removing-leading-from-member-names. I'm open to other suggestions.

@@ -74,11 +73,11 @@ fi

CMDS="set -ex
export SOURCE_DATE_EPOCH=${LAST_COMMIT_DATE}
tar xf MathJax-dev.tar.gz
tar xfP MathJax-dev.tar.gz
Copy link
Member

Choose a reason for hiding this comment

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

I added P here as well.

# echo "eusm10"
# $(PYTHON) $(MFTRACE_MODIFIED) --magnification 1000 --simplify eusm10
# echo "eusb10"
# $(PYTHON) $(MFTRACE_MODIFIED) --magnification 1000 --simplify eusb10
Copy link
Member

Choose a reason for hiding this comment

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

Given that most of the other lines in this file use tab this change makes sense.

if [[ ! -f fonts/OTF/TeX/Makefile ]]; then
echo "src does not look like MathJax-dev" >&2
if [[ ! -f fonts/Makefile ]]; then
echo "src does not look like katex-fonts" >&2
Copy link
Member

Choose a reason for hiding this comment

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

Good call.


.PHONY: fonts
fonts: ff
mkdir -p ttf woff woff2
rm -f ttf/* woff/* woff2/*

# Handle the KaTeX_Size4 font first as it used by other fonts.
@echo "KaTeX_Size4.ff"
$(FONTFORGE) -lang=ff -script ff/KaTeX_Size4.ff
Copy link
Member

Choose a reason for hiding this comment

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

Why is this no longer necessary?

Copy link
Member Author

Choose a reason for hiding this comment

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

@kevinbarabash Some glyphs were dependent on the Size4 font. I've removed their dependency and they can now be compiled independently.

@ylemkimon
Copy link
Member Author

@kevinbarabash Sorry for the late response. I somehow missed the notification. Thank you for the review!

@kevinbarabash
Copy link
Member

I wonder if there's some way we can use GitHub actions to generate the fonts and update PRs.

Copy link
Member

@kevinbarabash kevinbarabash left a comment

Choose a reason for hiding this comment

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

It's been a while since I looked at this, but it looks like I updated KaTeX/KaTeX#1888 and the tests passed so this should be good to go after regenerating the font files.

@ylemkimon ylemkimon merged commit 7deb3fd into KaTeX:master Dec 6, 2019
Improve fonts generation automation moved this from In progress to Done Dec 6, 2019
@ylemkimon ylemkimon deleted the cleanup branch December 6, 2019 22:56
@ylemkimon
Copy link
Member Author

@kevinbarabash Thanks again for the review. I've updated KaTeX/KaTeX#2155.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants