-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
648ac86
commit 167c357
Showing
14 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env python3 | ||
# I was in the middle of moving when this release was made and some vital build files were on another computer. | ||
# Therefore, let's patch the binaries and call it a release. Users will never know as long as I don't fuck up. | ||
# (Famous last words.) | ||
|
||
import fontTools.ttLib | ||
import sys | ||
|
||
assert len(sys.argv) == 2, "No filename given" | ||
|
||
ttf=fontTools.ttLib.TTFont(file=sys.argv[1]) | ||
|
||
# SFNT revision | ||
ttf["head"].fontRevision = 0.2 | ||
|
||
# `name` font version | ||
padZeroes = lambda bs: b'\x00'.join([b.encode('ascii') for b in bs]) | ||
names=ttf["name"].names | ||
for n in names: | ||
if n.nameID != 5: continue | ||
n.string = n.string.replace(b'001', b'0.2').replace(padZeroes('001'), padZeroes('0.2')) \ | ||
.replace(b'0.1', b'0.2').replace(padZeroes('0.1'), padZeroes('0.2')) | ||
ttf["name"].names=names | ||
|
||
# `liga` ⇒ `dlig` (Closes #8) | ||
if "GSUB" in ttf: | ||
for fr in ttf["GSUB"].table.FeatureList.FeatureRecord: | ||
fr.FeatureTag = 'dlig' if fr.FeatureTag == 'liga' else fr.FeatureTag | ||
|
||
ttf.save(sys.argv[1]) | ||
print("Patched {}".format(sys.argv[1]), file=sys.stderr) |
Oops, something went wrong.