Submodule hustle.

This commit is contained in:
2020-05-07 09:30:45 +02:00
parent e0bf46a0bf
commit cc3f6d2f50
164 changed files with 130963 additions and 3 deletions

20
init/FiraCode/script/bootstrap Executable file
View File

@ -0,0 +1,20 @@
#! /bin/bash -ex
sudo easy_install pip
pip3 install virtualenv --user
python3 -m virtualenv venv
source venv/bin/activate
# https://github.com/googlefonts/gftools/issues/121
brew install pkg-config
pip3 install -U Pillow==5.4.1 idna==2.8 requests==2.21.0 urllib3==1.24.1
export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig"
pip3 install pycairo
pip3 install git+https://github.com/googlefonts/gftools
pip3 install fontmake
brew install ttfautohint
brew install woff2
brew tap bramstein/webfonttools
brew install sfnt2woff-zopfli
pip3 install fontbakery

94
init/FiraCode/script/build Executable file
View File

@ -0,0 +1,94 @@
#!/bin/bash -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
# -------------------------------------------------------------
# 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 -------------------------------------------------
statics=$(ls distr/ttf/*.ttf)
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} --stem-width-mode nnn --composites --windows-compatibility
cp ${hintedFile} ${file}
rm -rf ${hintedFile}
done
# ============================================================================
# Build woff2 fonts ==========================================================
# requires woff2_compress (get from https://github.com/bramstein/homebrew-webfonttools)
rm -rf distr/woff2
ttfs=$(ls distr/*/*.ttf)
for ttf in $ttfs; do
woff2_compress $ttf
done
mkdir -p distr/woff2
woff2s=$(ls distr/*/*.woff2)
for woff2 in $woff2s; do
mv $woff2 distr/woff2/$(basename $woff2)
done
# ============================================================================
# Build woff fonts ===========================================================
# requires sfnt2woff-zopfli (get from https://github.com/bramstein/homebrew-webfonttools)
rm -rf distr/woff
ttfs=$(ls distr/*/*.ttf)
for ttf in $ttfs; do
sfnt2woff-zopfli $ttf
done
mkdir -p distr/woff
woffs=$(ls distr/*/*.woff)
for woff in $woffs; do
mv $woff distr/woff/$(basename $woff)
done

6
init/FiraCode/script/build_otf Executable file
View File

@ -0,0 +1,6 @@
#!/bin/bash -e
source venv/bin/activate
rm -rf distr/otf
fontmake -g FiraCode.glyphs -o otf --output-dir distr/otf -i

24
init/FiraCode/script/build_ttf Executable file
View File

@ -0,0 +1,24 @@
#!/bin/bash -e
source venv/bin/activate
args=( "$@" )
default_weights=( "Light" "Regular" "Retina" "Medium" "SemiBold" "Bold" )
weights=( "${args[@]:-"${default_weights[@]}"}" )
for weight in "${weights[@]}"; do
file=distr/ttf/FiraCode-${weight}.ttf
echo "Making " ${file}
rm -rf ${file}
fontmake -g FiraCode.glyphs -o ttf --output-dir distr/ttf -i "Fira Code ${weight}"
echo "Fixing DSIG in " ${file}
gftools fix-dsig --autofix ${file}
echo "TTFautohint " ${file}
hintedFile=${file/".ttf"/"-hinted.ttf"}
ttfautohint -I ${file} ${hintedFile} --stem-width-mode nnn --composites
# --windows-compatibility
mv ${hintedFile} ${file}
done

View File

@ -0,0 +1,26 @@
#!/bin/bash -e
rm -rf distr/variable_ttf
fontmake -g FiraCode.glyphs -o variable --output-dir distr/variable_ttf
# -------------------------------------------------------------
# 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)

15
init/FiraCode/script/build_woff Executable file
View File

@ -0,0 +1,15 @@
#!/bin/bash -e
# requires sfnt2woff-zopfli (get from https://github.com/bramstein/homebrew-webfonttools)
rm -rf distr/woff
ttfs=$(ls distr/*/*.ttf)
for ttf in $ttfs; do
sfnt2woff-zopfli $ttf
done
mkdir -p distr/woff
woffs=$(ls distr/*/*.woff)
for woff in $woffs; do
mv $woff distr/woff/$(basename $woff)
done

View File

@ -0,0 +1,15 @@
#!/bin/bash -e
# requires woff2_compress (get from https://github.com/bramstein/homebrew-webfonttools)
rm -rf distr/woff2
ttfs=$(ls distr/*/*.ttf)
for ttf in $ttfs; do
woff2_compress $ttf
done
mkdir -p distr/woff2
woff2s=$(ls distr/*/*.woff2)
for woff2 in $woff2s; do
mv $woff2 distr/woff2/$(basename $woff2)
done

5
init/FiraCode/script/check Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash -e
source venv/bin/activate
fontbakery check-universal -C $1

View File

@ -0,0 +1,3 @@
#!/bin/zsh -euo pipefail
clojure -m fira-code.checks

3
init/FiraCode/script/install Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash -ex
cp distr/otf/*.otf ~/Library/Fonts

26
init/FiraCode/script/release Executable file
View File

@ -0,0 +1,26 @@
#!/bin/bash -x
# Remove Retina from webfonts
rm distr/FiraCode-Retina.eot 2> /dev/null
rm distr/FiraCode-Retina.woff 2> /dev/null
rm distr/FiraCode-Retina.woff2 2> /dev/null
# Move to folders
mv distr/*.eot distr/eot/ 2> /dev/null
mv distr/*.woff distr/woff/ 2> /dev/null
mv distr/*.woff2 distr/woff2/ 2> /dev/null
mv distr/*.ttf distr/ttf/ 2> /dev/null
mv distr/*.otf distr/otf/ 2> /dev/null
# Install OTF version
cp distr/otf/*.otf ~/Library/Fonts/
# Pack zip archive
cd distr
find . -not -name ".*" | xargs zip ../FiraCode.zip
cd ..
# Update npm
npm publish
# Update https://github.com/Homebrew/homebrew-cask-fonts

View File

@ -0,0 +1,3 @@
#!/bin/zsh -euo pipefail
clojure -m fira-code.main