mirror of
https://github.com/tonsky/FiraCode.git
synced 2024-08-17 17:00:42 +03:00
All features that were not already in their own files were pulled out of FiraCode.glyphs into individual files. There is no way I will write a parser for the glyphs file to do that at runtime. The build script will then read the code in these feature files and appends it to the `calt` property inside the glyphs file. Features to be baked in can be given to build.sh as a comma separated list with the `-f / --features` flag. To more easily generate multiple font versions with different features baked in, there are flags `-n / --family-name` for build.sh that will allow users to set a custom family name for the font. The special value "features" will append the feature list to the font name. The family name is exported and used by the other build scripts as a directory to separate different font versions. The filenames were not changed, the directory name is enough separation. The flag `-g / --generate-glyphs-only` will cause the script to exit after the custom glyphs file has been created without actually building the font. The custom .glyphs file will be saved as `${family_name}.glyphs`. Via another flag, `-w / --weights`, a comma separated list of font weights to be generated can be given to build.sh. The README received a hint to the new capabilities. Fixed a mixup of cv25 and cv32. The .gitignore was adjusted to better deal with the new directories and files.
28 lines
623 B
Bash
Executable File
28 lines
623 B
Bash
Executable File
#!/bin/bash
|
|
set -o errexit -o nounset -o pipefail
|
|
cd "$(dirname "$0")/.."
|
|
[ -d venv ] && source venv/bin/activate
|
|
|
|
family_name=${FIRACODE_FAMILY_NAME:-"Fira Code"}
|
|
|
|
ttf_dir="distr/ttf/${family_name}"
|
|
woff_dir="distr/woff/${family_name}"
|
|
|
|
echo "=============="
|
|
echo
|
|
echo " [i] Creating .woff files!"
|
|
echo
|
|
|
|
mkdir -p "${woff_dir}"
|
|
rm -rf "${woff_dir:?}/"*
|
|
|
|
# requires sfnt2woff-zopfli (get from https://github.com/bramstein/homebrew-webfonttools)
|
|
|
|
for ttf in "${ttf_dir}/"*.ttf; do
|
|
echo "sfnt2woff-zopfli ${ttf}"
|
|
sfnt2woff-zopfli "${ttf}"
|
|
done
|
|
|
|
mv "${ttf_dir}/"*.woff "${woff_dir}"
|
|
rm -f "${woff_dir}/FiraCode-Retina.woff"
|