[merge] Move CFF.desubroutinize to proper place
This commit is contained in:
parent
1355769766
commit
4de9ffcdd5
@ -374,25 +374,32 @@ ttLib.getTableClass('gasp').mergeMap = lambda self, lst: first(lst) # FIXME? App
|
|||||||
|
|
||||||
@_add_method(ttLib.getTableClass('CFF '))
|
@_add_method(ttLib.getTableClass('CFF '))
|
||||||
def merge(self, m, tables):
|
def merge(self, m, tables):
|
||||||
|
|
||||||
if any(hasattr(table, "FDSelect") for table in tables):
|
if any(hasattr(table, "FDSelect") for table in tables):
|
||||||
raise NotImplementedError(
|
raise NotImplementedError(
|
||||||
"Merging CID-keyed CFF tables is not supported yet"
|
"Merging CID-keyed CFF tables is not supported yet"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
for table in tables:
|
||||||
|
table.cff.desubroutinize()
|
||||||
|
|
||||||
newcff = tables[0]
|
newcff = tables[0]
|
||||||
newfont = newcff.cff[0]
|
newfont = newcff.cff[0]
|
||||||
private = newfont.Private
|
private = newfont.Private
|
||||||
storedNamesStrings = []
|
storedNamesStrings = []
|
||||||
glyphOrderStrings = []
|
glyphOrderStrings = []
|
||||||
glyphOrder = set(newfont.getGlyphOrder())
|
glyphOrder = set(newfont.getGlyphOrder())
|
||||||
|
|
||||||
for name in newfont.strings.strings:
|
for name in newfont.strings.strings:
|
||||||
if name not in glyphOrder:
|
if name not in glyphOrder:
|
||||||
storedNamesStrings.append(name)
|
storedNamesStrings.append(name)
|
||||||
else:
|
else:
|
||||||
glyphOrderStrings.append(name)
|
glyphOrderStrings.append(name)
|
||||||
|
|
||||||
chrset = list(newfont.charset)
|
chrset = list(newfont.charset)
|
||||||
newcs = newfont.CharStrings
|
newcs = newfont.CharStrings
|
||||||
log.debug("FONT 0 CharStrings: %d.", len(newcs))
|
log.debug("FONT 0 CharStrings: %d.", len(newcs))
|
||||||
|
|
||||||
for i, table in enumerate(tables[1:], start=1):
|
for i, table in enumerate(tables[1:], start=1):
|
||||||
font = table.cff[0]
|
font = table.cff[0]
|
||||||
font.Private = private
|
font.Private = private
|
||||||
@ -1064,7 +1071,6 @@ class Merger(object):
|
|||||||
cffTables = [None] * len(fonts)
|
cffTables = [None] * len(fonts)
|
||||||
if sfntVersion == "OTTO":
|
if sfntVersion == "OTTO":
|
||||||
for i, font in enumerate(fonts):
|
for i, font in enumerate(fonts):
|
||||||
font['CFF '].cff.desubroutinize()
|
|
||||||
cffTables[i] = font['CFF ']
|
cffTables[i] = font['CFF ']
|
||||||
|
|
||||||
# Reload fonts and set new glyph names on them.
|
# Reload fonts and set new glyph names on them.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user