Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
Antyos committed Nov 2, 2021
2 parents 0d63765 + 2c0cea5 commit 764d298
Show file tree
Hide file tree
Showing 1,519 changed files with 15,203 additions and 8,910 deletions.
26 changes: 15 additions & 11 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
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
import vttLib.transfer
from vttmisc import tsi1, tsic

VERSION_YEAR_MONTH = 2108
VERSION_DAY = 21
VERSION_YEAR_MONTH = 2110
VERSION_DAY = 31
OUTPUT_DIR = Path("build")
OUTPUT_OTF_DIR = OUTPUT_DIR / "otf"
OUTPUT_TTF_DIR = OUTPUT_DIR / "ttf"
Expand Down Expand Up @@ -237,17 +237,13 @@ 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:
font_vtt = fontTools.ttLib.TTFont(ITALIC_VTT_DATA_FILE)
else:
font_vtt = fontTools.ttLib.TTFont(VTT_DATA_FILE)


for table in ["TSI0", "TSI1", "TSI2", "TSI3", "TSI5", "TSIC", "maxp"]:
varFont[table] = fontTools.ttLib.newTable(table)
Expand All @@ -267,12 +263,10 @@ def compile_variable_and_save(
# last minute manual corrections to set things correctly
# set two flags to enable proper rendering (one for overlaps in Mac, the other for windows hinting)
# Helping mac office generage the postscript name correctly for variable fonts when an italic is present

set_overlap_flag(varFont)
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 @@ -577,6 +571,16 @@ 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"))]
with open(INPUT_DIR/"stat.yaml") as f:
config = yaml.load(f, 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
8 changes: 4 additions & 4 deletions sources/CascadiaCode-Bold.ufo/fontinfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>capHeight</key>
<integer>1420</integer>
<key>copyright</key>
<string>© 2020 Microsoft Corporation. All Rights Reserved.</string>
<string>© 2021 Microsoft Corporation. All Rights Reserved.</string>
<key>descender</key>
<integer>-480</integer>
<key>familyName</key>
Expand All @@ -32,7 +32,7 @@
<key>x</key>
<integer>886</integer>
<key>y</key>
<integer>-20</integer>
<integer>-1040</integer>
</dict>
<dict>
<key>angle</key>
Expand Down Expand Up @@ -158,7 +158,7 @@
<key>angle</key>
<integer>0</integer>
<key>x</key>
<integer>958</integer>
<integer>-327</integer>
<key>y</key>
<integer>2226</integer>
</dict>
Expand All @@ -184,7 +184,7 @@
</dict>
<dict>
<key>angle</key>
<integer>0</integer>
<integer>180</integer>
<key>name</key>
<string> [locked]</string>
<key>x</key>
Expand Down
Loading

0 comments on commit 764d298

Please sign in to comment.