-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #107 from uswds/add-build-script
Update to 1.006
- Loading branch information
Showing
4,258 changed files
with
134,402 additions
and
130,295 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,3 +20,5 @@ _site | |
site/assets/uswds | ||
site/assets/fonts | ||
site/assets/css | ||
env | ||
report.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
#!/bin/sh | ||
|
||
# ------------------------------------------------------------------- | ||
# UPDATE THIS VARIABLE ---------------------------------------------- | ||
|
||
thisFont="Public-Sans" # must match the name in the font file, e.g. FiraCode-VF.ttf needs the variable "FiraCode" | ||
|
||
# ------------------------------------------------------------------- | ||
# Update the following as needed ------------------------------------ | ||
|
||
source env/bin/activate | ||
set -e | ||
|
||
cd source | ||
|
||
echo "Generating TTF binaries" | ||
mkdir -p ../fonts/webfonts | ||
fontmake -g $thisFont.glyphs -i -o ttf --output-dir ../fonts/webfonts/ | ||
fontmake -g $thisFont-italics.glyphs -i -o ttf --output-dir ../fonts/webfonts/ | ||
|
||
echo "Generating Variable Fonts" | ||
mkdir -p ../fonts/variable | ||
fontmake -g $thisFont.glyphs -o variable --output-path ../fonts/variable/$thisFont-Roman-VF.ttf | ||
fontmake -g $thisFont-italics.glyphs -o variable --output-path ../fonts/variable/$thisFont-Italic-VF.ttf | ||
|
||
rm -rf master_ufo/ instance_ufo/ | ||
|
||
echo "Post processing" | ||
|
||
ttfs=$(ls ../fonts/webfonts/*.ttf) | ||
echo $ttfs | ||
for ttf in $ttfs | ||
do | ||
gftools fix-dsig --autofix $ttf; | ||
gftools fix-nonhinting $ttf $ttf; | ||
done | ||
rm ../fonts/webfonts/*backup*.ttf | ||
|
||
vfs=$(ls ../fonts/variable/*.ttf) | ||
for vf in $vfs | ||
do | ||
gftools fix-dsig --autofix $vf; | ||
gftools fix-nonhinting $vf $vf | ||
done | ||
rm ../fonts/variable/*backup*.ttf | ||
|
||
gftools fix-vf-meta $vfs; | ||
for vf in $vfs | ||
do | ||
mv "$vf.fix" $vf; | ||
done | ||
|
||
cd .. | ||
|
||
# ============================================================================ | ||
# Autohinting ================================================================ | ||
|
||
statics=$(ls fonts/webfonts/*.ttf) | ||
echo hello | ||
for file in $statics; do | ||
echo "fix DSIG in " ${file} | ||
gftools fix-dsig --autofix ${file} | ||
|
||
echo "TTFautohint " ${file} | ||
# autohint with detailed info | ||
hintedFile=${file/".ttf"/"-hinted.ttf"} | ||
ttfautohint -I ${file} ${hintedFile} | ||
cp ${hintedFile} ${file} | ||
rm -rf ${hintedFile} | ||
done | ||
|
||
|
||
# ============================================================================ | ||
# Build woff and woff2 fonts ========================================================== | ||
|
||
# requires https://github.com/bramstein/homebrew-webfonttools | ||
|
||
ttfs=$(ls fonts/webfonts/*.ttf) | ||
for ttf in $ttfs; do | ||
woff2_compress $ttf | ||
sfnt2woff-zopfli $ttf | ||
done |
Oops, something went wrong.