mirror of
https://github.com/weiweihuanghuang/Work-Sans.git
synced 2024-11-22 12:14:09 +03:00
Update build
This commit is contained in:
parent
54626b4a1a
commit
a9138612fa
@ -1,46 +0,0 @@
|
||||
### Based on a script by Stephen Nixon
|
||||
|
||||
import os
|
||||
import sys
|
||||
import fontTools
|
||||
from fontTools.ttLib import TTFont
|
||||
from fontTools.varLib.featureVars import addFeatureVariations
|
||||
from fontTools.ttx import makeOutputFileName
|
||||
|
||||
inputTTF = sys.argv[1]
|
||||
# style = sys.argv[2]
|
||||
|
||||
# f = TTFont(fontPath)
|
||||
f = TTFont(inputTTF)
|
||||
|
||||
condSubst = [
|
||||
# A list of (Region, Substitution) tuples.
|
||||
([{"wght": (0.158, 0.564)}], {"uniF8FF": "uniF8FF.001"}),
|
||||
# ([{"wght": (0.868, 1)}], {"uni20B5": "uni20B5.201_230"}),
|
||||
# ([{"wght": (0.868, 1)}], {"cent": "cent.201_230"}),
|
||||
# ([{"wght": (0.868, 1)}], {"colonmonetary": "colonmonetary.201_230"}),
|
||||
# ([{"wght": (0.868, 1)}], {"dollar": "dollar.201_230"}),
|
||||
# ([{"wght": (0.868, 1)}], {"uni20B2": "uni20B2.201_230"}),
|
||||
# ([{"wght": (0.868, 1)}], {"dollar.tf": "dollar.tf.201_230"}),
|
||||
# ([{"wght": (0.868, 1)}], {"cent.tf": "cent.tf.201_230"}),
|
||||
# ([{"wght": (0.71, 1)}], {"uni20A6": "uni20A6.169_230"}),
|
||||
# ([{"wght": (0.71, 1)}], {"peseta": "peseta.169_230"}),
|
||||
# ([{"wght": (0.71, 1)}], {"uni20A9": "uni20A9.169_230"}),
|
||||
# ([{"wght": (0.564, 1)}], {"uni20B1": "uni20B1.136_230"}),
|
||||
# ([{"wght": (0.424, 1)}], {"uni2761": "uni2761.79_230"}),
|
||||
# ([{"wght": (0.424, 1)}], {"paragraph": "paragraph.79_230"}),
|
||||
]
|
||||
|
||||
# if style == "Upright":
|
||||
# condSubst += [
|
||||
# ([{"wght": (0.564, 1)}], {"Adieresis.titl": "Adieresis.titl.136_230"}),
|
||||
# ([{"wght": (0.564, 1)}], {"Odieresis.titl": "Odieresis.titl.136_230"}),
|
||||
# ]
|
||||
|
||||
addFeatureVariations(f, condSubst)
|
||||
|
||||
# newFontPath = fontPath.split(".")[0] + "-italic.ttf"
|
||||
# f.save(fontPath)
|
||||
extension = os.path.splitext(inputTTF)[1]
|
||||
outputTTF = makeOutputFileName(inputTTF, '', extension)
|
||||
f.save(outputTTF)
|
@ -22,26 +22,24 @@ rm -rf master_ufo
|
||||
rm -rf instance_ufo
|
||||
rm -rf variable_ttf
|
||||
|
||||
# Add featureVariation for bracket trick glyphs
|
||||
# python tools/swapBracketTrick.py ${VFname}.ttf "$1"
|
||||
# mv ${VFname}-swap.ttf ${VFname}.ttf
|
||||
Add featureVariation for bracket trick glyphs
|
||||
python tools/swapBracketTrick.py ${VFname}.ttf "$1"
|
||||
mv ${VFname}-swap.ttf ${VFname}.ttf
|
||||
|
||||
# Fix non-hinting, DSIG and GASP table
|
||||
gftools fix-nonhinting ${VFname}.ttf ${VFname}.ttf
|
||||
gftools fix-dsig --autofix ${VFname}.ttf
|
||||
gftools fix-gasp ${VFname}.ttf
|
||||
echo "nonhinting, dsig, gasp fixed"
|
||||
|
||||
# Clean up backup file
|
||||
rm -rf ${VFname}-backup-fonttools-prep-gasp.ttf
|
||||
|
||||
# Fix VF Metadata
|
||||
python tools/gftools-fix-vf-meta.py ${VFname}.ttf
|
||||
echo "vf-meta fixed"
|
||||
|
||||
# Clean up and rename VF
|
||||
rm ${VFname}.ttf
|
||||
mv ${VFname}.ttf.fix ${VFname}.ttf
|
||||
# # Fix VF Metadata
|
||||
# python tools/gftools-fix-vf-meta.py ${VFname}.ttf
|
||||
# echo "vf-meta fixed"
|
||||
# # Clean up and rename VF
|
||||
# rm ${VFname}.ttf
|
||||
# mv ${VFname}.ttf.fix ${VFname}.ttf
|
||||
|
||||
# Correct nameID 6 (remove space)
|
||||
python tools/NAMEpatch.py ${VFname}.ttf
|
||||
@ -49,6 +47,9 @@ rm ${VFname}.ttf
|
||||
mv ${VFname}#1.ttf ${VFname}.ttf
|
||||
echo "nameID 6 fixed"
|
||||
|
||||
# Fix DSIG
|
||||
gftools fix-dsig --autofix ${VFname}.ttf
|
||||
|
||||
if [ "$1" = "Italic" ]; then
|
||||
# Rename *-ItalicItalic to -Italic
|
||||
for i in *.ttf; do
|
||||
|
@ -19,7 +19,8 @@ axis (covers 95% of GF cases).
|
||||
"""
|
||||
from argparse import ArgumentParser
|
||||
from fontTools.ttLib import TTFont, newTable
|
||||
from fontTools.ttLib.tables import otTables
|
||||
from fontTools.ttLib.tables import otTablesos
|
||||
import os
|
||||
|
||||
|
||||
OS_2_WEIGHT_CLASS = {
|
||||
|
@ -1,46 +0,0 @@
|
||||
### Based on a script by Stephen Nixon
|
||||
|
||||
import os
|
||||
import sys
|
||||
import fontTools
|
||||
from fontTools.ttLib import TTFont
|
||||
from fontTools.varLib.featureVars import addFeatureVariations
|
||||
from fontTools.ttx import makeOutputFileName
|
||||
|
||||
inputTTF = sys.argv[1]
|
||||
style = sys.argv[2]
|
||||
|
||||
# f = TTFont(fontPath)
|
||||
f = TTFont(inputTTF)
|
||||
|
||||
condSubst = [
|
||||
# A list of (Region, Substitution) tuples.
|
||||
([{"wght": (0.158, 0.564)}], {"apple": "apple.001"}),
|
||||
([{"wght": (0.868, 1)}], {"cedi": "cedi.201_230"}),
|
||||
([{"wght": (0.868, 1)}], {"cent": "cent.201_230"}),
|
||||
([{"wght": (0.868, 1)}], {"colonsign": "colonsign.201_230"}),
|
||||
([{"wght": (0.868, 1)}], {"dollar": "dollar.201_230"}),
|
||||
([{"wght": (0.868, 1)}], {"guarani": "guarani.201_230"}),
|
||||
([{"wght": (0.868, 1)}], {"dollar.tf": "dollar.tf.201_230"}),
|
||||
([{"wght": (0.868, 1)}], {"cent.tf": "cent.tf.201_230"}),
|
||||
([{"wght": (0.71, 1)}], {"naira": "naira.169_230"}),
|
||||
([{"wght": (0.71, 1)}], {"peseta": "peseta.169_230"}),
|
||||
([{"wght": (0.71, 1)}], {"won": "won.169_230"}),
|
||||
([{"wght": (0.564, 1)}], {"peso": "peso.136_230"}),
|
||||
([{"wght": (0.424, 1)}], {"curvedStemParagraphSignOrnament": "curvedStemParagraphSignOrnament.79_230"}),
|
||||
([{"wght": (0.424, 1)}], {"paragraph": "paragraph.79_230"}),
|
||||
]
|
||||
|
||||
if style == "Upright":
|
||||
condSubst += [
|
||||
([{"wght": (0.564, 1)}], {"Adieresis.titl": "Adieresis.titl.136_230"}),
|
||||
([{"wght": (0.564, 1)}], {"Odieresis.titl": "Odieresis.titl.136_230"}),
|
||||
]
|
||||
|
||||
addFeatureVariations(f, condSubst)
|
||||
|
||||
# newFontPath = fontPath.split(".")[0] + "-italic.ttf"
|
||||
# f.save(fontPath)
|
||||
extension = os.path.splitext(inputTTF)[1]
|
||||
outputTTF = makeOutputFileName(inputTTF, '', extension)
|
||||
f.save(outputTTF)
|
@ -6,34 +6,33 @@ import fontTools
|
||||
from fontTools.ttLib import TTFont
|
||||
from fontTools.varLib.featureVars import addFeatureVariations
|
||||
|
||||
inputTTF = sys.argv[-1]
|
||||
print(inputTTF)
|
||||
|
||||
inputTTF = sys.argv[1]
|
||||
style = sys.argv[2]
|
||||
|
||||
f = TTFont(inputTTF)
|
||||
condSubst = [
|
||||
# A list of (Region, Substitution) tuples.
|
||||
([{"wght": (0.158, 0.564)}], {"uniF8FF": "uniF8FF.001"}),
|
||||
# ([{"wght": (0.868, 1)}], {"uni20B5": "uni20B5.201_230"}),
|
||||
# ([{"wght": (0.868, 1)}], {"cent": "cent.201_230"}),
|
||||
# ([{"wght": (0.868, 1)}], {"colonmonetary": "colonmonetary.201_230"}),
|
||||
# ([{"wght": (0.868, 1)}], {"dollar": "dollar.201_230"}),
|
||||
# ([{"wght": (0.868, 1)}], {"uni20B2": "uni20B2.201_230"}),
|
||||
# ([{"wght": (0.868, 1)}], {"dollar.tf": "dollar.tf.201_230"}),
|
||||
# ([{"wght": (0.868, 1)}], {"cent.tf": "cent.tf.201_230"}),
|
||||
# ([{"wght": (0.71, 1)}], {"uni20A6": "uni20A6.169_230"}),
|
||||
# ([{"wght": (0.71, 1)}], {"peseta": "peseta.169_230"}),
|
||||
# ([{"wght": (0.71, 1)}], {"uni20A9": "uni20A9.169_230"}),
|
||||
# ([{"wght": (0.564, 1)}], {"uni20B1": "uni20B1.136_230"}),
|
||||
# ([{"wght": (0.424, 1)}], {"uni2761": "uni2761.79_230"}),
|
||||
# ([{"wght": (0.424, 1)}], {"paragraph": "paragraph.79_230"}),
|
||||
([{"wght": (0.868, 1)}], {"uni20B5": "uni20B5.201_230"}),
|
||||
([{"wght": (0.868, 1)}], {"cent": "cent.201_230"}),
|
||||
([{"wght": (0.868, 1)}], {"colonmonetary": "colonmonetary.201_230"}),
|
||||
([{"wght": (0.868, 1)}], {"dollar": "dollar.201_230"}),
|
||||
([{"wght": (0.868, 1)}], {"uni20B2": "uni20B2.201_230"}),
|
||||
([{"wght": (0.868, 1)}], {"dollar.tf": "dollar.tf.201_230"}),
|
||||
([{"wght": (0.868, 1)}], {"cent.tf": "cent.tf.201_230"}),
|
||||
([{"wght": (0.71, 1)}], {"uni20A6": "uni20A6.169_230"}),
|
||||
([{"wght": (0.71, 1)}], {"peseta": "peseta.169_230"}),
|
||||
([{"wght": (0.71, 1)}], {"uni20A9": "uni20A9.169_230"}),
|
||||
([{"wght": (0.564, 1)}], {"uni20B1": "uni20B1.136_230"}),
|
||||
([{"wght": (0.424, 1)}], {"uni2761": "uni2761.79_230"}),
|
||||
([{"wght": (0.424, 1)}], {"paragraph": "paragraph.79_230"}),
|
||||
]
|
||||
|
||||
# if style == "Upright":
|
||||
# condSubst += [
|
||||
# ([{"wght": (0.564, 1)}], {"Adieresis.titl": "Adieresis.titl.136_230"}),
|
||||
# ([{"wght": (0.564, 1)}], {"Odieresis.titl": "Odieresis.titl.136_230"}),
|
||||
# ]
|
||||
if style == "Upright":
|
||||
condSubst += [
|
||||
([{"wght": (0.564, 1)}], {"Adieresis.titl": "Adieresis.titl.136_230"}),
|
||||
([{"wght": (0.564, 1)}], {"Odieresis.titl": "Odieresis.titl.136_230"}),
|
||||
]
|
||||
|
||||
addFeatureVariations(f, condSubst)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user