Skip to content

Commit

Permalink
port VF metadata fixes from move to build script
Browse files Browse the repository at this point in the history
  • Loading branch information
thundernixon committed Apr 5, 2019
1 parent 11f505f commit b29e3f3
Show file tree
Hide file tree
Showing 31 changed files with 97 additions and 401 deletions.
40 changes: 34 additions & 6 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,47 @@
#!/bin/bash

set -e
source venv/bin/activate

# ============================================================================
# VARIABLE FONT ==============================================================

# variable font
rm -rf distr/variable_ttf
fontmake -g FiraCode.glyphs -o variable --output-dir distr/variable_ttf

# statics
# -------------------------------------------------------------
# fix variable font metadata as needed ------------------------

firaCodeVF=distr/variable_ttf/FiraCode-VF.ttf

# fix variable font metadata – very important
gftools fix-vf-meta $firaCodeVF

# other fixes for metadata and hinting
gftools fix-nonhinting $firaCodeVF $firaCodeVF
gftools fix-gasp --autofix $firaCodeVF
gftools fix-dsig --autofix $firaCodeVF

# cleanup of temp files
tempFiles=$(ls distr/variable_ttf/*.fix && ls distr/variable_ttf/*-gasp*)
for temp in $tempFiles
do
rm -rf $temp
done

# TODO (late 2019?): use TTFautohint-VF for variable font (current support is minimal)

# ============================================================================
# STATIC FONTS ===============================================================

rm -rf distr/ttf
fontmake -g FiraCode.glyphs -o ttf --output-dir distr/ttf -i

rm -rf distr/otf
fontmake -g FiraCode.glyphs -o otf --output-dir distr/otf -i

# ============================================================================
# Autohinting ================================================================
# -------------------------------------------------------------
# Autohinting -------------------------------------------------

statics=$(ls distr/ttf/*.ttf)
for file in $statics; do
Expand All @@ -32,7 +60,7 @@ done
# ============================================================================
# Build woff2 fonts ==========================================================

# requires https://github.com/google/woff2
# requires woff2_compress (get from https://github.com/bramstein/homebrew-webfonttools)

rm -rf distr/woff2

Expand All @@ -50,7 +78,7 @@ done
# ============================================================================
# Build woff fonts ===========================================================

# requires sfnt2woff-zopfli (https://github.com/bramstein/homebrew-webfonttools)
# requires sfnt2woff-zopfli (get from https://github.com/bramstein/homebrew-webfonttools)

rm -rf distr/woff

Expand Down
Binary file modified distr/otf/FiraCode-Bold.otf
Binary file not shown.
Binary file modified distr/otf/FiraCode-Light.otf
Binary file not shown.
Binary file modified distr/otf/FiraCode-Medium.otf
Binary file not shown.
Binary file modified distr/otf/FiraCode-Regular.otf
Binary file not shown.
Binary file modified distr/otf/FiraCode-Retina.otf
Binary file not shown.
Binary file modified distr/ttf/FiraCode-Bold.ttf
Binary file not shown.
Binary file modified distr/ttf/FiraCode-Light.ttf
Binary file not shown.
Binary file modified distr/ttf/FiraCode-Medium.ttf
Binary file not shown.
Binary file modified distr/ttf/FiraCode-Regular.ttf
Binary file not shown.
Binary file modified distr/ttf/FiraCode-Retina.ttf
Binary file not shown.
Binary file modified distr/variable_ttf/FiraCode-VF.ttf
Binary file not shown.
Binary file modified distr/woff/FiraCode-Bold.woff
Binary file not shown.
Binary file modified distr/woff/FiraCode-Light.woff
Binary file not shown.
Binary file modified distr/woff/FiraCode-Medium.woff
Binary file not shown.
Binary file modified distr/woff/FiraCode-Regular.woff
Binary file not shown.
Binary file modified distr/woff/FiraCode-Retina.woff
Binary file not shown.
Binary file modified distr/woff/FiraCode-VF.woff
Binary file not shown.
Binary file modified distr/woff2/FiraCode-Bold.woff2
Binary file not shown.
Binary file modified distr/woff2/FiraCode-Light.woff2
Binary file not shown.
Binary file modified distr/woff2/FiraCode-Medium.woff2
Binary file not shown.
Binary file modified distr/woff2/FiraCode-Regular.woff2
Binary file not shown.
Binary file modified distr/woff2/FiraCode-Retina.woff2
Binary file not shown.
Binary file modified distr/woff2/FiraCode-VF.woff2
Binary file not shown.
10 changes: 5 additions & 5 deletions googlefonts-qa/checks/FiraCode-Light.checks.md

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions googlefonts-qa/checks/static/FiraCode-Bold.checks.md

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions googlefonts-qa/checks/static/FiraCode-Light.checks.md

Large diffs are not rendered by default.

145 changes: 22 additions & 123 deletions googlefonts-qa/checks/static/FiraCode-Medium.checks.md

Large diffs are not rendered by default.

125 changes: 11 additions & 114 deletions googlefonts-qa/checks/static/FiraCode-Regular.checks.md

Large diffs are not rendered by default.

125 changes: 11 additions & 114 deletions googlefonts-qa/checks/static/FiraCode-Retina.checks.md

Large diffs are not rendered by default.

25 changes: 0 additions & 25 deletions googlefonts-qa/scripts/move-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,31 +32,6 @@ ttx -t head $firaCodeVF
fontVersion=v$(xml sel -t --match "//*/fontRevision" -v "@value" ${firaCodeVF/".ttf"/".ttx"})
rm ${firaCodeVF/".ttf"/".ttx"}

# -------------------------------------------------------------------
# fix variable font metadata as needed ------------------------------

# TODO: Add gftools scripts as needed

# TODO: test VFs with TTFautohint-VF vs no hinting

gftools fix-nonhinting $firaCodeVF $firaCodeVF

# TODO: decide if `--autofix` is really the best option, or if we should assert more control
gftools fix-gasp --autofix $firaCodeVF

gftools fix-dsig --autofix $firaCodeVF

# fix variable font metadata
gftools fix-vf-meta $firaCodeVF

# cleanup
tempFiles=$(ls distr/variable_ttf/*.fix && ls distr/variable_ttf/*-gasp*)
for temp in $tempFiles
do
rm -rf $temp
done


# -------------------------------------------------------------------
# navigate to google/fonts repo, then fira code branch --------------

Expand Down

0 comments on commit b29e3f3

Please sign in to comment.