first draft of typo demo

This commit is contained in:
2026-05-18 11:22:46 +02:00
commit 5470d56015
657 changed files with 140834 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
import glob
from fontTools.ttLib import TTFont
from fontbakery.constants import (
MacStyle,
FsSelection,
)
if __name__ == "__main__":
for font_path in glob.glob("../fonts/variable/*Italic*.ttf"):
with open(font_path, "rb") as f:
print("Fix italic bits in {}".format(font_path))
ttFont = TTFont(f)
ttFont["head"].macStyle = MacStyle.ITALIC
ttFont["OS/2"].fsSelection = FsSelection.USETYPOMETRICS | FsSelection.ITALIC
ttFont["post"].italicAngle = -10
ttFont["hhea"].caretSlopeRise = 1000
ttFont["hhea"].caretSlopeRun = 176
ttFont.save(font_path)
for font_path in glob.glob("../fonts/ttf/*Italic*.ttf"):
with open(font_path, "rb") as f:
print("Fix italic bits in {}".format(font_path))
ttFont = TTFont(f)
ttFont["post"].italicAngle = -10
ttFont["hhea"].caretSlopeRise = 1000
ttFont["hhea"].caretSlopeRun = 176
ttFont.save(font_path)