Skip to content

Commit

Permalink
July-August 2021 Fixes (#538)
Browse files Browse the repository at this point in the history
## Summary of the Pull Request

This includes two fixes:
- [x] Closes #500 
Changes the build process to use gftools.stat instead of statmake. The issue was caused by an 'unused' italic axis in the fonts, which has been removed, but statmake gets unhappy without it there. So the process has been adjusted to a more amenable build library. 

- [x] Closes #552
Adds the Hebrew language tag to the Regular to ensure that Hebrew positioning works correctly. 

Also:
Adjusts calt feature to ensure LIG substitutions properly function under rare conditions where the `ignore` activate incorrectly. I thought this had already been PR'd but seems not. 

For example:
`===]`
First = becomes "equal_equal.liga", and ignore would activate on second =, blocking LIG from being substituted. If the liga form appears, LIG should appear.

Turned back on the =>> =<<, etc. ligatures as there is a glyph for them now.
  • Loading branch information
aaronbell committed Aug 26, 2021
1 parent 99b4974 commit 1c6def4
Show file tree
Hide file tree
Showing 16 changed files with 556 additions and 452 deletions.
19 changes: 11 additions & 8 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
import fontTools.ttLib
import fontTools.ttLib.tables._g_l_y_f as _g_l_y_f
import psautohint.__main__
import statmake.classes
import statmake.lib
from gftools.stat import gen_stat_tables_from_config
import yaml
import ufo2ft
import ufoLib2
import vttLib
Expand Down Expand Up @@ -235,11 +235,6 @@ def compile_variable_and_save(
print(f"[{familyName} {styleName}] Compiling")
varFont = ufo2ft.compileVariableTTF(designspace, inplace=True)

print(f"[{familyName} {styleName}] Adding STAT table")
styleSpace = statmake.classes.Stylespace.from_file(INPUT_DIR / "STAT.plist")
statmake.lib.apply_stylespace_to_variable_font(styleSpace, varFont, {})


print(f"[{familyName} {styleName}] Merging VTT")

if "Italic" in styleName:
Expand Down Expand Up @@ -270,7 +265,6 @@ def compile_variable_and_save(
varFont["head"].flags = 0x000b

if "Regular" in styleName:
varFont["name"].setName(familyName.replace(" Regular",""), 4, 3, 1, 1033)
varFont["name"].setName(familyName.replace(" ","")+"Roman", 25, 3, 1, 1033)

print(f"[{familyName} {styleName}] Saving")
Expand Down Expand Up @@ -575,6 +569,15 @@ def ttfautohint(path: str) -> None:
process.get()
del processes, pool

# Step 1.5: Adding STAT tables in one go
print ("[Cascadia Variable fonts] Fixing STAT tables")
fontSTAT = [fontTools.ttLib.TTFont(f) for f in list(OUTPUT_TTF_DIR.glob("*.ttf"))]
config = yaml.load(open(INPUT_DIR/"stat.yaml"), Loader=yaml.SafeLoader)
gen_stat_tables_from_config(config, fontSTAT)

for font in fontSTAT:
font.save(font.reader.file.name)

# Stage 2: Autohint and maybe compress all the static things.
if args.static_fonts is True:
otfs = list(OUTPUT_STATIC_OTF_DIR.glob("*.otf"))
Expand Down
2 changes: 1 addition & 1 deletion requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

fontmake
psautohint
statmake
gftools
vttLib
skia-pathops
fontTools[ufo,lxml,woff]
Expand Down
156 changes: 138 additions & 18 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#
# This file is autogenerated by pip-compile
# This file is autogenerated by pip-compile with python 3.9
# To update, run:
#
# pip-compile --output-file=requirements.txt requirements.in
# pip-compile requirements.in
#
absl-py==0.13.0
# via gftools
appdirs==1.4.4
# via fs
attrs==21.2.0
Expand All @@ -12,35 +14,74 @@ attrs==21.2.0
# fontmake
# statmake
# ufolib2
babelfont==2.0.2
# via gftools
booleanoperations==0.9.0
# via
# fontmake
# fontparts
# ufo2ft
brotli==1.0.9
# via fonttools
cattrs==1.6.0
# via
# fonttools
# gftools
browserstack-local==1.2.2
# via gftools
cattrs==1.7.1
# via statmake
certifi==2021.5.30
# via requests
cffi==1.14.6
# via
# pygit2
# pynacl
cffsubr==0.2.8
# via ufo2ft
charset-normalizer==2.0.2
# via requests
click==8.0.1
# via flask
compreffor==0.5.1
# via ufo2ft
cu2qu==1.6.7
# via
# fontmake
# ufo2ft
defcon[pens]==0.8.1
# via
# babelfont
# fontparts
deprecated==1.2.12
# via pygithub
et-xmlfile==1.1.0
# via openpyxl
flask==2.0.1
# via gftools
fontmake==2.4.0
# via -r requirements.in
fontmath==0.6.0
# via fontmake
fonttools[lxml,ufo,unicode,woff]==4.24.4
# via
# -r requirements.in
# gftools
fontmath==0.8.1
# via
# fontmake
# fontparts
fontparts==0.9.10
# via babelfont
fontpens==0.2.4
# via defcon
fonttools[lxml,ufo,unicode,woff]==4.25.0
# via
# -r requirements.in
# babelfont
# booleanoperations
# cffsubr
# compreffor
# cu2qu
# defcon
# fontmake
# fontmath
# fontparts
# gftools
# glyphslib
# psautohint
# statmake
Expand All @@ -50,37 +91,116 @@ fonttools[lxml,ufo,unicode,woff]==4.24.4
# vttmisc
fs==2.4.13
# via fonttools
gftools==0.7.4
# via -r requirements.in
glyphslib==5.3.2
# via fontmake
# via
# babelfont
# fontmake
# gftools
idna==3.2
# via requests
itsdangerous==2.0.1
# via flask
jinja2==3.0.1
# via flask
lxml==4.6.3
# via fonttools
markupsafe==2.0.1
# via jinja2
numpy==1.21.0
# via pandas
openpyxl==3.0.7
# via gftools
opentype-sanitizer==8.1.4.post2
# via gftools
pandas==1.3.0
# via gftools
pillow==8.3.1
# via
# gftools
# pybrowserstack-screenshots
protobuf==3.17.3
# via gftools
psautohint==2.3.0
# via -r requirements.in
pyclipper==1.2.1
psutil==5.8.0
# via browserstack-local
pybrowserstack-screenshots==0.1
# via gftools
pyclipper==1.3.0
# via booleanoperations
pycparser==2.20
# via cffi
pygit2==1.6.1
# via gftools
pygithub==1.55
# via gftools
pyjwt==2.1.0
# via pygithub
pynacl==1.4.0
# via pygithub
pyparsing==2.4.7
# via vttlib
python-dateutil==2.8.2
# via
# pandas
# strictyaml
pytz==2021.1
# via fs
# via
# fs
# pandas
pyyaml==5.4.1
# via gftools
requests==2.26.0
# via
# gftools
# pybrowserstack-screenshots
# pygithub
simplejson==3.17.3
# via pybrowserstack-screenshots
six==1.16.0
# via fs
# via
# absl-py
# fs
# protobuf
# pynacl
# python-dateutil
skia-pathops==0.6.0.post2
# via -r requirements.in
# via
# -r requirements.in
# gftools
statmake==0.3.0
# via -r requirements.in
ufo2ft[compreffor]==2.21.0
# via gftools
strictyaml==1.4.4
# via gftools
tabulate==0.8.9
# via gftools
ttfautohint-py==0.4.3
# via gftools
ufo2ft[compreffor]==2.22.0
# via fontmake
ufolib2==0.11.1
# via
# fontmake
# glyphslib
# vttlib
unicodedata2==13.0.0.post2
# via fonttools
unidecode==1.2.0
# via gftools
urllib3==1.26.6
# via requests
vttlib==0.11.0
# via -r requirements.in
# via
# -r requirements.in
# gftools
vttmisc==0.0.5
# via -r requirements.in
werkzeug==2.0.1
# via flask
wrapt==1.12.1
# via deprecated
xlrd==2.0.1
# via gftools
zopfli==0.1.8
# via fonttools

Expand Down
19 changes: 0 additions & 19 deletions sources/CascadiaCode-Bold.ufo/lib.plist
Original file line number Diff line number Diff line change
Expand Up @@ -69,25 +69,6 @@
<key>Tag</key>
<string>wght</string>
</dict>
<dict>
<key>Name</key>
<string>Italic</string>
<key>Tag</key>
<string>ital</string>
</dict>
</array>
<key>com.schriftgestaltung.customParameter.GSFont.DisplayStrings</key>
<array>
<string>/vav-hb</string>
<string>/paseq-hb</string>
<string>/geresh-hb</string>
<string>/three-persian</string>
<string>/two-ar</string>
<string>/gafInvertedstroke-ar/gafInvertedstroke-ar.fina/gafInvertedstroke-ar.medi/gafInvertedstroke-ar.init</string>
<string>/kasratan-ar</string>
<string>/alef-hb/alefpatah-hb/alefqamats-hb/alefdagesh-hb/bet-hb/betdagesh-hb/gimel-hb/gimeldagesh-hb/dalet-hb/daletdagesh-hb/he-hb/hedagesh-hb/vav-hb/vavdagesh-hb/vavholam-hb/zayin-hb/zayindagesh-hb/het-hb/tet-hb/tetdagesh-hb/yod-hb/yoddagesh-hb/finalkaf-hb/finalkafdagesh-hb/kaf-hb/kafdagesh-hb/lamed-hb/lameddagesh-hb/finalmem-hb/mem-hb/memdagesh-hb/finalnun-hb/nun-hb/nundagesh-hb/samekh-hb/samekhdagesh-hb/ayin-hb/finalpe-hb/finalpedagesh-hb/pe-hb/pedagesh-hb/finaltsadi-hb/tsadi-hb/tsadidagesh-hb/qof-hb/qofdagesh-hb/resh-hb/reshdagesh-hb/shin-hb/shinshindot-hb/shinsindot-hb/shindageshshindot-hb/shindageshsindot-hb/shindagesh-hb/tav-hb/tavdagesh-hb
</string>
</array>
<key>com.schriftgestaltung.customParameter.GSFont.disablesAutomaticAlignment</key>
<false/>
Expand Down
15 changes: 0 additions & 15 deletions sources/CascadiaCode-BoldItalic.ufo/lib.plist
Original file line number Diff line number Diff line change
Expand Up @@ -81,21 +81,6 @@
<key>Tag</key>
<string>wght</string>
</dict>
<dict>
<key>Name</key>
<string>Italic</string>
<key>Tag</key>
<string>ital</string>
</dict>
</array>
<key>com.schriftgestaltung.customParameter.GSFont.DisplayStrings</key>
<array>
<string>/b.alt</string>
<string>/De-cy/Ka-cy/El-cy/De-cy.loclBGR/be-cy/ve-cy/ge-cy/gheupturn-cy/ze-cy/el-cy/en-cy/ef-cy/che-cy/tse-cy/sha-cy/shcha-cy/softsign-cy/hardsign-cy/yeru-cy/lje-cy/nje-cy/e-cy/ereversed-cy/iu-cy/ia-cy/dje-cy/ghestroke-cy/endescender-cy/chedescender-cy/shha-cy/shha-cy.alt/ka-cy.loclBGR.alt/iu-cy.loclBGR.alt/zhe-cy.loclBGR/ze-cy.loclBGR/ka-cy.loclBGR/ve-cy.salt/ze-cy.salt/che-cy.salt/chedescender-cy.salt</string>
<string>u/tse-cy</string>
<string>all/space of/space the/space limes
all/space of/space the/space limes
all/space of/space the/space limes</string>
</array>
<key>com.schriftgestaltung.customParameter.GSFont.disablesAutomaticAlignment</key>
<false/>
Expand Down
19 changes: 0 additions & 19 deletions sources/CascadiaCode-ExtraLight.ufo/lib.plist
Original file line number Diff line number Diff line change
Expand Up @@ -71,25 +71,6 @@
<key>Tag</key>
<string>wght</string>
</dict>
<dict>
<key>Name</key>
<string>Italic</string>
<key>Tag</key>
<string>ital</string>
</dict>
</array>
<key>com.schriftgestaltung.customParameter.GSFont.DisplayStrings</key>
<array>
<string>/vav-hb</string>
<string>/paseq-hb</string>
<string>/geresh-hb</string>
<string>/three-persian</string>
<string>/two-ar</string>
<string>/gafInvertedstroke-ar/gafInvertedstroke-ar.fina/gafInvertedstroke-ar.medi/gafInvertedstroke-ar.init</string>
<string>/kasratan-ar</string>
<string>/alef-hb/alefpatah-hb/alefqamats-hb/alefdagesh-hb/bet-hb/betdagesh-hb/gimel-hb/gimeldagesh-hb/dalet-hb/daletdagesh-hb/he-hb/hedagesh-hb/vav-hb/vavdagesh-hb/vavholam-hb/zayin-hb/zayindagesh-hb/het-hb/tet-hb/tetdagesh-hb/yod-hb/yoddagesh-hb/finalkaf-hb/finalkafdagesh-hb/kaf-hb/kafdagesh-hb/lamed-hb/lameddagesh-hb/finalmem-hb/mem-hb/memdagesh-hb/finalnun-hb/nun-hb/nundagesh-hb/samekh-hb/samekhdagesh-hb/ayin-hb/finalpe-hb/finalpedagesh-hb/pe-hb/pedagesh-hb/finaltsadi-hb/tsadi-hb/tsadidagesh-hb/qof-hb/qofdagesh-hb/resh-hb/reshdagesh-hb/shin-hb/shinshindot-hb/shinsindot-hb/shindageshshindot-hb/shindageshsindot-hb/shindagesh-hb/tav-hb/tavdagesh-hb
</string>
</array>
<key>com.schriftgestaltung.customParameter.GSFont.disablesAutomaticAlignment</key>
<false/>
Expand Down
15 changes: 0 additions & 15 deletions sources/CascadiaCode-ExtraLightItalic.ufo/lib.plist
Original file line number Diff line number Diff line change
Expand Up @@ -81,21 +81,6 @@
<key>Tag</key>
<string>wght</string>
</dict>
<dict>
<key>Name</key>
<string>Italic</string>
<key>Tag</key>
<string>ital</string>
</dict>
</array>
<key>com.schriftgestaltung.customParameter.GSFont.DisplayStrings</key>
<array>
<string>/b.alt</string>
<string>/De-cy/Ka-cy/El-cy/De-cy.loclBGR/be-cy/ve-cy/ge-cy/gheupturn-cy/ze-cy/el-cy/en-cy/ef-cy/che-cy/tse-cy/sha-cy/shcha-cy/softsign-cy/hardsign-cy/yeru-cy/lje-cy/nje-cy/e-cy/ereversed-cy/iu-cy/ia-cy/dje-cy/ghestroke-cy/endescender-cy/chedescender-cy/shha-cy/shha-cy.alt/ka-cy.loclBGR.alt/iu-cy.loclBGR.alt/zhe-cy.loclBGR/ze-cy.loclBGR/ka-cy.loclBGR/ve-cy.salt/ze-cy.salt/che-cy.salt/chedescender-cy.salt</string>
<string>u/tse-cy</string>
<string>all/space of/space the/space limes
all/space of/space the/space limes
all/space of/space the/space limes</string>
</array>
<key>com.schriftgestaltung.customParameter.GSFont.disablesAutomaticAlignment</key>
<false/>
Expand Down
15 changes: 0 additions & 15 deletions sources/CascadiaCode-Italic.ufo/lib.plist
Original file line number Diff line number Diff line change
Expand Up @@ -81,21 +81,6 @@
<key>Tag</key>
<string>wght</string>
</dict>
<dict>
<key>Name</key>
<string>Italic</string>
<key>Tag</key>
<string>ital</string>
</dict>
</array>
<key>com.schriftgestaltung.customParameter.GSFont.DisplayStrings</key>
<array>
<string>/b.alt</string>
<string>/De-cy/Ka-cy/El-cy/De-cy.loclBGR/be-cy/ve-cy/ge-cy/gheupturn-cy/ze-cy/el-cy/en-cy/ef-cy/che-cy/tse-cy/sha-cy/shcha-cy/softsign-cy/hardsign-cy/yeru-cy/lje-cy/nje-cy/e-cy/ereversed-cy/iu-cy/ia-cy/dje-cy/ghestroke-cy/endescender-cy/chedescender-cy/shha-cy/shha-cy.alt/ka-cy.loclBGR.alt/iu-cy.loclBGR.alt/zhe-cy.loclBGR/ze-cy.loclBGR/ka-cy.loclBGR/ve-cy.salt/ze-cy.salt/che-cy.salt/chedescender-cy.salt</string>
<string>u/tse-cy</string>
<string>all/space of/space the/space limes
all/space of/space the/space limes
all/space of/space the/space limes</string>
</array>
<key>com.schriftgestaltung.customParameter.GSFont.disablesAutomaticAlignment</key>
<false/>
Expand Down
Loading

0 comments on commit 1c6def4

Please sign in to comment.