Skip to content

Commit 856734f

Browse files
committed
Copy various font features to output font
As we discover more font features that may need to be copied into the output, they can be added as well.
1 parent e2c77de commit 856734f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/extractpoints.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,11 +513,18 @@ def silent_fontopen(fname):
513513
os.close(origstderr)
514514
return fontobj
515515

516+
features_to_copy = """
517+
ascent descent em encoding upos uwidth weight
518+
""".split() # TODO: Find out if any other font features need to be copied
519+
516520
def create_dotted_font(fname):
517521
input_font = silent_fontopen(fname)
518522
global args
519523
args.em = input_font.em
520524
new_font = fontforge.font()
525+
for feature in features_to_copy:
526+
value = getattr(input_font, feature)
527+
setattr(new_font, feature, value)
521528
for glyphname in input_font:
522529
if glyphname in ('.notdef', '.null'): continue
523530
glyph = input_font[glyphname]

0 commit comments

Comments
 (0)