MCPcopy
hub / github.com/arrowtype/recursive / nameTableTweak

Function nameTableTweak

mastering/build_static.py:610–624  ·  view source on GitHub ↗

Removes nameID 16 and 17 for the Macintosh entry. This makes MS Word much happier to exchange documents cross version and platform. *font* is a fontTools font object

(font)

Source from the content-addressed store, hash-verified

608
609
610def nameTableTweak(font):
611 """
612 Removes nameID 16 and 17 for the Macintosh entry. This makes MS Word
613 much happier to exchange documents cross version and platform.
614
615 *font* is a fontTools font object
616 """
617
618 nameIDs = [(16, 1, 0, 0), (17, 1, 0, 0)]
619 nameTable = font["name"]
620
621 for n in nameIDs:
622 nameRecord = nameTable.getName(n[0], n[1], n[2], n[3])
623 if nameRecord is not None:
624 nameTable.names.remove(nameRecord)
625
626
627def makeDSIG(font):

Callers 1

makeSFNTFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected