mirror of
https://github.com/tonsky/FiraCode.git
synced 2024-10-05 17:17:34 +03:00
Removed binaries from git, fixed variable + Retina, added version to CI
This commit is contained in:
parent
f1f9767998
commit
6bf3854628
15
.github/workflows/build.yml
vendored
15
.github/workflows/build.yml
vendored
@ -7,14 +7,11 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: Build
|
name: Build
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout the latest commit
|
- uses: actions/checkout@v2
|
||||||
uses: actions/checkout@v2
|
- run: echo "FIRA_CODE_VERSION=$(python3 ./script/version.py)" >> $GITHUB_ENV
|
||||||
- name: Install dependencies
|
- run: ./script/bootstrap_linux.sh
|
||||||
run: bash -ex ./script/bootstrap_action
|
- run: ./script/build.sh
|
||||||
- name: Build fonts
|
- uses: actions/upload-artifact@v2
|
||||||
run: bash -e ./script/build
|
|
||||||
- name: Upload built fonts
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
with:
|
with:
|
||||||
name: Fira_Code
|
name: Fira_Code_v${{ env.FIRA_CODE_VERSION }}
|
||||||
path: distr
|
path: distr
|
6
.gitignore
vendored
6
.gitignore
vendored
@ -4,9 +4,15 @@ FiraCode_mess.glyphs
|
|||||||
target
|
target
|
||||||
clojure/*.edn
|
clojure/*.edn
|
||||||
FiraCode\ (Autosaved).glyphs
|
FiraCode\ (Autosaved).glyphs
|
||||||
|
FiraCode_VF.glyphs
|
||||||
.cpcache
|
.cpcache
|
||||||
master_ufo
|
master_ufo
|
||||||
instance_ufo
|
instance_ufo
|
||||||
venv
|
venv
|
||||||
.DS_Store
|
.DS_Store
|
||||||
*.numbers
|
*.numbers
|
||||||
|
distr/ttf
|
||||||
|
distr/otf
|
||||||
|
distr/woff
|
||||||
|
distr/woff2
|
||||||
|
distr/variable_ttf
|
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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4
script/bootstrap_action → script/bootstrap_linux.sh
Normal file → Executable file
4
script/bootstrap_action → script/bootstrap_linux.sh
Normal file → Executable file
@ -1,4 +1,6 @@
|
|||||||
#! /bin/bash -ex
|
#!/bin/bash
|
||||||
|
set -o errexit -o nounset -o pipefail
|
||||||
|
cd "`dirname $0`/.."
|
||||||
|
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install -y python3.8 python3-setuptools python3.8-dev pkg-config zlib1g ttfautohint woff2 sfnt2woff-zopfli
|
sudo apt install -y python3.8 python3-setuptools python3.8-dev pkg-config zlib1g ttfautohint woff2 sfnt2woff-zopfli
|
@ -1,4 +1,6 @@
|
|||||||
#! /bin/bash -ex
|
#!/bin/bash
|
||||||
|
set -o errexit -o nounset -o pipefail
|
||||||
|
cd "`dirname $0`/.."
|
||||||
|
|
||||||
sudo easy_install-3.8 pip
|
sudo easy_install-3.8 pip
|
||||||
pip install virtualenv --user
|
pip install virtualenv --user
|
90
script/build
90
script/build
@ -1,90 +0,0 @@
|
|||||||
#!/bin/bash -e
|
|
||||||
|
|
||||||
[ -d venv ] && source venv/bin/activate
|
|
||||||
|
|
||||||
# ============================================================================
|
|
||||||
# VARIABLE FONT ==============================================================
|
|
||||||
|
|
||||||
# variable font
|
|
||||||
firaCodeVF=distr/variable_ttf/FiraCode-VF.ttf
|
|
||||||
|
|
||||||
rm -rf $firaCodeVF
|
|
||||||
fontmake -g FiraCode.glyphs -o variable --output-dir distr/variable_ttf
|
|
||||||
|
|
||||||
# fix variable font metadata – very important
|
|
||||||
gftools fix-vf-meta $firaCodeVF
|
|
||||||
mv $firaCodeVF.fix $firaCodeVF
|
|
||||||
|
|
||||||
# other fixes for metadata and hinting
|
|
||||||
gftools fix-nonhinting $firaCodeVF $firaCodeVF
|
|
||||||
gftools fix-gasp --autofix $firaCodeVF
|
|
||||||
mv $firaCodeVF.fix $firaCodeVF
|
|
||||||
|
|
||||||
gftools fix-dsig --autofix $firaCodeVF
|
|
||||||
|
|
||||||
# cleanup of temp files
|
|
||||||
rm -rf distr/variable_ttf/*-gasp*
|
|
||||||
|
|
||||||
# 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
|
|
8
script/build.sh
Executable file
8
script/build.sh
Executable file
@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -o errexit -o nounset -o pipefail
|
||||||
|
cd "`dirname $0`"
|
||||||
|
|
||||||
|
./build_ttf.sh
|
||||||
|
./build_variable.sh
|
||||||
|
./build_woff2.sh
|
||||||
|
./build_woff.sh
|
@ -1,6 +1,9 @@
|
|||||||
#!/bin/bash -euo pipefail
|
#!/bin/bash
|
||||||
|
set -o errexit -o nounset -o pipefail
|
||||||
|
cd "`dirname $0`/.."
|
||||||
[ -d venv ] && source venv/bin/activate
|
[ -d venv ] && source venv/bin/activate
|
||||||
|
mkdir -p distr/ttf
|
||||||
|
rm -rf distr/ttf/*
|
||||||
|
|
||||||
args=( "$@" )
|
args=( "$@" )
|
||||||
default_weights=( "Light" "Regular" "Retina" "Medium" "SemiBold" "Bold" )
|
default_weights=( "Light" "Regular" "Retina" "Medium" "SemiBold" "Bold" )
|
@ -1,16 +1,17 @@
|
|||||||
#!/bin/bash -euo pipefail
|
#!/bin/bash
|
||||||
|
set -o errexit -o nounset -o pipefail
|
||||||
cd "`dirname $0`/.."
|
cd "`dirname $0`/.."
|
||||||
|
|
||||||
[ -d venv ] && source venv/bin/activate
|
[ -d venv ] && source venv/bin/activate
|
||||||
|
mkdir -p distr/variable_ttf
|
||||||
|
rm -rf distr/variable_ttf/*
|
||||||
|
|
||||||
DIR=distr/variable_ttf
|
|
||||||
FILE=FiraCode-VF.ttf
|
FILE=FiraCode-VF.ttf
|
||||||
|
|
||||||
rm -rf $DIR/$FILE
|
awk '/name = Retina;/ { print; print "exports = 0;"; next }1' FiraCode.glyphs > FiraCode_VF.glyphs
|
||||||
fontmake -g FiraCode.glyphs -o variable --output-dir $DIR
|
fontmake -g FiraCode_VF.glyphs -o variable --output-dir distr/variable_ttf
|
||||||
|
rm FiraCode_VF.glyphs
|
||||||
|
|
||||||
cd distr/variable_ttf
|
pushd distr/variable_ttf
|
||||||
|
|
||||||
# fix variable font metadata – very important
|
# fix variable font metadata – very important
|
||||||
gftools fix-vf-meta $FILE
|
gftools fix-vf-meta $FILE
|
||||||
@ -29,3 +30,5 @@ gftools fix-dsig --autofix $FILE
|
|||||||
rm -rf *-gasp.ttf
|
rm -rf *-gasp.ttf
|
||||||
|
|
||||||
# TODO (late 2019?): use TTFautohint-VF for variable font (current support is minimal)
|
# TODO (late 2019?): use TTFautohint-VF for variable font (current support is minimal)
|
||||||
|
|
||||||
|
popd
|
@ -1,10 +1,11 @@
|
|||||||
#!/bin/bash -euo pipefail
|
#!/bin/bash
|
||||||
# requires sfnt2woff-zopfli (get from https://github.com/bramstein/homebrew-webfonttools)
|
set -o errexit -o nounset -o pipefail
|
||||||
|
|
||||||
cd "`dirname $0`/.."
|
cd "`dirname $0`/.."
|
||||||
[ -d venv ] && source venv/bin/activate
|
[ -d venv ] && source venv/bin/activate
|
||||||
|
mkdir -p distr/woff
|
||||||
|
rm -rf distr/woff/*
|
||||||
|
|
||||||
rm -rf distr/*/*.woff
|
# requires sfnt2woff-zopfli (get from https://github.com/bramstein/homebrew-webfonttools)
|
||||||
|
|
||||||
ttfs=$(ls distr/*/*.ttf)
|
ttfs=$(ls distr/*/*.ttf)
|
||||||
for ttf in $ttfs; do
|
for ttf in $ttfs; do
|
@ -1,10 +1,11 @@
|
|||||||
#!/bin/bash -euo pipefail
|
#!/bin/bash
|
||||||
# requires woff2_compress (get from https://github.com/bramstein/homebrew-webfonttools)
|
set -o errexit -o nounset -o pipefail
|
||||||
|
|
||||||
cd "`dirname $0`/.."
|
cd "`dirname $0`/.."
|
||||||
[ -d venv ] && source venv/bin/activate
|
[ -d venv ] && source venv/bin/activate
|
||||||
|
mkdir -p distr/woff2
|
||||||
|
rm -rf distr/woff2/*
|
||||||
|
|
||||||
rm -rf distr/*/*.woff2
|
# requires woff2_compress (get from https://github.com/bramstein/homebrew-webfonttools)
|
||||||
|
|
||||||
ttfs=$(ls distr/*/*.ttf)
|
ttfs=$(ls distr/*/*.ttf)
|
||||||
for ttf in $ttfs; do
|
for ttf in $ttfs; do
|
8
script/clean.sh
Executable file
8
script/clean.sh
Executable file
@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -o errexit -o nounset -o pipefail
|
||||||
|
cd "`dirname $0`/.."
|
||||||
|
|
||||||
|
rm -rf distr/ttf
|
||||||
|
rm -rf distr/variable_ttf
|
||||||
|
rm -rf distr/woff2
|
||||||
|
rm -rf distr/woff
|
18
script/version.py
Executable file
18
script/version.py
Executable file
@ -0,0 +1,18 @@
|
|||||||
|
#! /usr/bin/env python3
|
||||||
|
|
||||||
|
import os, re, subprocess, sys
|
||||||
|
|
||||||
|
def revision():
|
||||||
|
os.chdir(os.path.abspath(os.path.dirname(__file__) + '/..'))
|
||||||
|
desc = subprocess.check_output(["git", "describe", "--tags"], cwd = os.path.dirname(__file__)).decode("utf-8")
|
||||||
|
match = re.match("([0-9.]+)-([0-9]+)-[a-z0-9]+", desc)
|
||||||
|
if match:
|
||||||
|
return match.group(1) + "." + match.group(2)
|
||||||
|
match = re.match("([0-9]+.[0-9]+).0", desc)
|
||||||
|
if match:
|
||||||
|
return match.group(1) + ".0"
|
||||||
|
raise Exception("Can’t parse revision: " + desc)
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
print(revision())
|
||||||
|
sys.exit(0)
|
Loading…
Reference in New Issue
Block a user