-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This solves issue google/fonts#7. There is a newer release of Playfair but the GF version and upstream version have different proportions. @davelab6 suggested a quick hotfix since this issue is urgent.;
- Loading branch information
Showing
8 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,16 @@ | ||
# Fix glyph uni042b. The components need swapping | ||
python fix_uni042b.py | ||
|
||
# Update font version number | ||
FONTS=$(ls *.ttf) | ||
fontbakery update-version $FONTS 1.002 1.003 | ||
|
||
|
||
|
||
rm $FONTS | ||
FONTS_VERSION_BUMPED=$(ls *.fix) | ||
# replace .fix with .ttf | ||
for font in $FONTS_VERSION_BUMPED | ||
do | ||
mv $font "${font%.*}" | ||
done |
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,36 @@ | ||
""" | ||
Fixes issue: https://github.com/google/fonts/issues/7 | ||
""" | ||
|
||
import os | ||
from fontTools.ttLib import TTFont | ||
|
||
|
||
BAD_GLYPH = 'uni042B' | ||
|
||
NEW_COORDS = { | ||
'PlayfairDisplay-Black.ttf': {'uni042C': 0, 'I': 1393}, | ||
'PlayfairDisplay-Bold.ttf': {'uni042C': 0, 'I': 1311}, | ||
'PlayfairDisplay-Regular.ttf': {'uni042C': 0, 'I': 1188}, | ||
|
||
} | ||
|
||
def main(): | ||
fonts_paths = [p for p in os.listdir('.') | ||
if p.endswith('.ttf') and not | ||
'Italic' in p] | ||
for font_path in fonts_paths: | ||
font = TTFont(font_path) | ||
|
||
for i, component in enumerate(font['glyf'][BAD_GLYPH].components): | ||
c_name = component.glyphName | ||
if c_name in NEW_COORDS[font_path]: | ||
font['glyf'][BAD_GLYPH].components[i].x = NEW_COORDS[font_path][c_name] | ||
|
||
os.remove(font_path) | ||
print('Rewriting ttf %s' % font_path) | ||
font.save(font_path) | ||
print 'Done!' | ||
|
||
if __name__ == '__main__': | ||
main() |