Skip to content

Instantly share code, notes, and snippets.

@nanxstats
Last active April 1, 2024 08:36
Show Gist options
  • Save nanxstats/1f767cb964dda645a90f84cbade05dcb to your computer and use it in GitHub Desktop.
Save nanxstats/1f767cb964dda645a90f84cbade05dcb to your computer and use it in GitHub Desktop.
Convert MLModern from Type 1 format to OTF and WOFF2
brew install fontforge
brew install woff2
curl -L http://mirrors.ctan.org/fonts/mlmodern.zip > mlmodern.zip
unzip mlmodern.zip
cd mlmodern/type1/
fontforge -lang=ff -c 'Open($1); Generate($1:r + ".otf")' mlmr12.pfb
fontforge -lang=ff -c 'Open($1); Generate($1:r + ".otf")' mlmri12.pfb
fontforge -lang=ff -c 'Open($1); Generate($1:r + ".otf")' mlmbx12.pfb
woff2_compress mlmr12.otf
woff2_compress mlmri12.otf
woff2_compress mlmbx12.otf
mv mlmr12.woff2 mlmodern-regular.woff2
mv mlmri12.woff2 mlmodern-italic.woff2
mv mlmbx12.woff2 mlmodern-bold.woff2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment