Merge pull request #188 from anthrotype/obfuscate6
[subset] drop nameIDs 16, 17 and 18 if obfuscate_name
This commit is contained in:
commit
f864977b34
@ -2069,12 +2069,14 @@ def prune_pre_subset(self, options):
|
||||
if options.obfuscate_names:
|
||||
namerecs = []
|
||||
for n in self.names:
|
||||
if n.nameID in [1, 4, 16, 18]:
|
||||
if n.nameID in [1, 4]:
|
||||
n.string = ".\x7f".encode('utf-16be') if n.isUnicode() else ".\x7f"
|
||||
elif n.nameID in [2, 6, 17]:
|
||||
elif n.nameID in [2, 6]:
|
||||
n.string = "\x7f".encode('utf-16be') if n.isUnicode() else "\x7f"
|
||||
elif n.nameID == 3:
|
||||
n.string = ""
|
||||
elif n.nameID in [16, 17, 18]:
|
||||
continue
|
||||
namerecs.append(n)
|
||||
self.names = namerecs
|
||||
return True # Required table
|
||||
|
Loading…
x
Reference in New Issue
Block a user