Removed binaries from git, fixed variable + Retina, added version to CI

pull/1310/head
Nikita Prokopov 2021-08-09 02:26:47 +02:00
rodzic f1f9767998
commit 6bf3854628
31 zmienionych plików z 78 dodań i 119 usunięć

Wyświetl plik

@ -7,14 +7,11 @@ jobs:
runs-on: ubuntu-latest
name: Build
steps:
- name: Checkout the latest commit
uses: actions/checkout@v2
- name: Install dependencies
run: bash -ex ./script/bootstrap_action
- name: Build fonts
run: bash -e ./script/build
- name: Upload built fonts
uses: actions/upload-artifact@v2
- uses: actions/checkout@v2
- run: echo "FIRA_CODE_VERSION=$(python3 ./script/version.py)" >> $GITHUB_ENV
- run: ./script/bootstrap_linux.sh
- run: ./script/build.sh
- uses: actions/upload-artifact@v2
with:
name: Fira_Code
name: Fira_Code_v${{ env.FIRA_CODE_VERSION }}
path: distr

8
.gitignore vendored
Wyświetl plik

@ -4,9 +4,15 @@ FiraCode_mess.glyphs
target
clojure/*.edn
FiraCode\ (Autosaved).glyphs
FiraCode_VF.glyphs
.cpcache
master_ufo
instance_ufo
venv
.DS_Store
*.numbers
*.numbers
distr/ttf
distr/otf
distr/woff
distr/woff2
distr/variable_ttf

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Wyświetl plik

@ -1,4 +1,6 @@
#! /bin/bash -ex
#!/bin/bash
set -o errexit -o nounset -o pipefail
cd "`dirname $0`/.."
sudo apt update
sudo apt install -y python3.8 python3-setuptools python3.8-dev pkg-config zlib1g ttfautohint woff2 sfnt2woff-zopfli

Wyświetl plik

@ -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
pip install virtualenv --user

Wyświetl plik

@ -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 100755
Wyświetl plik

@ -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

Wyświetl plik

@ -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
mkdir -p distr/ttf
rm -rf distr/ttf/*
args=( "$@" )
default_weights=( "Light" "Regular" "Retina" "Medium" "SemiBold" "Bold" )

Wyświetl plik

@ -1,16 +1,17 @@
#!/bin/bash -euo pipefail
#!/bin/bash
set -o errexit -o nounset -o pipefail
cd "`dirname $0`/.."
[ -d venv ] && source venv/bin/activate
mkdir -p distr/variable_ttf
rm -rf distr/variable_ttf/*
DIR=distr/variable_ttf
FILE=FiraCode-VF.ttf
rm -rf $DIR/$FILE
fontmake -g FiraCode.glyphs -o variable --output-dir $DIR
awk '/name = Retina;/ { print; print "exports = 0;"; next }1' FiraCode.glyphs > FiraCode_VF.glyphs
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
gftools fix-vf-meta $FILE
@ -29,3 +30,5 @@ gftools fix-dsig --autofix $FILE
rm -rf *-gasp.ttf
# TODO (late 2019?): use TTFautohint-VF for variable font (current support is minimal)
popd

Wyświetl plik

@ -1,10 +1,11 @@
#!/bin/bash -euo pipefail
# requires sfnt2woff-zopfli (get from https://github.com/bramstein/homebrew-webfonttools)
#!/bin/bash
set -o errexit -o nounset -o pipefail
cd "`dirname $0`/.."
[ -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)
for ttf in $ttfs; do

Wyświetl plik

@ -1,10 +1,11 @@
#!/bin/bash -euo pipefail
# requires woff2_compress (get from https://github.com/bramstein/homebrew-webfonttools)
#!/bin/bash
set -o errexit -o nounset -o pipefail
cd "`dirname $0`/.."
[ -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)
for ttf in $ttfs; do

8
script/clean.sh 100755
Wyświetl plik

@ -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 100755
Wyświetl plik

@ -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("Cant parse revision: " + desc)
if __name__ == '__main__':
print(revision())
sys.exit(0)