Skip to content

Commit

Permalink
feat(www): Update Futura PT with custom "j" (#20946)
Browse files Browse the repository at this point in the history
* feat(www): Update Futura PT with custom "j

Thanks to @lindaleebumblebee and Paratype, we have a custom version of Futura PT that greatly improves the readability of the lowercase "j". We still need to work out some details, like subsetting, and getting Demi and Bold Italic, so I'm putting this up as a draft for now. Will update ASAP.

* Custom Futura PT, Latin subset

* Resolve file size differences

TL;DR:

I tried to figure out the reason for the size difference in between our original webfonts provided by [fontspring.com](https://www.fontspring.com/) and the custom (also subset) ones provided by ParaType — the latter being significantly larger.

With the help of [fontTool 4](https://github.com/fonttools/fonttools) and its `ttx`, I found out that Fontspring seems to replace the original hinting with hinting by https://www.freetype.org/ttfautohint/ per default — the current fonts had meta information added by it saying so.
So I ran `ttfautohint` on the original, subset TTF provided by ParaType, and saw sizes even smaller than the current ones — in between 5-10 KB less.

Then I used fontTool's `ttx` and `pyftsubset` to

- fix the font family `namespace` metadata for Mac
- manually drop some meta data
- drop a bit more unneccessary meta information via `pyftsubset *.ttf --glyphs='*' --layout-features='*' --name-IDs='*'`, shoving off another ~1-2 KB

Then I discovered that the current version of our fonts have a different line height/LineGap (?) than the custom ones. `gftools fix-vertical-metrics *.ttf --autofix` to the rescue — another thing that Fontspring seems to do out-of-the-box.

Back to `pyftsubset` to generate WOFF and WOFF2 versions with `pyftsubset *.subset.ttf '*' --glyphs='*' --layout-features='*' --name-IDs='*' --flavor=woff --with-zopfli` and `pyftsubset *ftn86*.subset.ttf '*' --glyphs='*' --verbose --layout-features='*' --name-IDs='*' --flavor=woff2` …

Finally, I created (MTX compressed) EOT versions via `sfntly`'s `sfnttool` and `sfnttool -e -x *.ttf *.eot`.

* Retire Futura PT Bold EOT

* Revert `url` changes

* Ditch EOT

Co-authored-by: GatsbyJS Bot <mathews.kyle+gatsbybot@gmail.com>
  • Loading branch information
fk and GatsbyJS Bot authored Feb 11, 2020
1 parent f99d968 commit 1c495ee
Show file tree
Hide file tree
Showing 21 changed files with 1 addition and 3 deletions.
Binary file not shown.
Binary file modified www/src/assets/fonts/Webfonts/futurapt_bold_macroman/ftn85-webfont.ttf
100755 → 100644
Binary file not shown.
Binary file modified www/src/assets/fonts/Webfonts/futurapt_bold_macroman/ftn85-webfont.woff
100755 → 100644
Binary file not shown.
Binary file modified www/src/assets/fonts/Webfonts/futurapt_bold_macroman/ftn85-webfont.woff2
100755 → 100644
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
@font-face {
font-family: "Futura PT";
font-display: swap;
src: url("ftn85-webfont.eot");
src: url("ftn85-webfont.eot?#iefix") format("embedded-opentype"),
url("ftn85-webfont.woff2") format("woff2"),
src: url("ftn85-webfont.woff2") format("woff2"),
url("ftn85-webfont.woff") format("woff"),
url("ftn85-webfont.ttf") format("truetype");
font-weight: 800;
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 1c495ee

Please sign in to comment.