[merge] Implement --verbose and --timing
This commit is contained in:
parent
c855f3ab69
commit
b640f7435c
@ -273,13 +273,13 @@ class Merger:
|
|||||||
for tag in allTags:
|
for tag in allTags:
|
||||||
|
|
||||||
if tag in self.options.drop_tables:
|
if tag in self.options.drop_tables:
|
||||||
print "Dropping '%s'." % tag
|
self.log("Dropping '%s'." % tag)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
clazz = ttLib.getTableClass(tag)
|
clazz = ttLib.getTableClass(tag)
|
||||||
|
|
||||||
if not hasattr(clazz, 'merge'):
|
if not hasattr(clazz, 'merge'):
|
||||||
print "Don't know how to merge '%s', dropped." % tag
|
self.log("Don't know how to merge '%s', dropped." % tag)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# TODO For now assume all fonts have the same tables.
|
# TODO For now assume all fonts have the same tables.
|
||||||
@ -287,9 +287,10 @@ class Merger:
|
|||||||
table = clazz(tag)
|
table = clazz(tag)
|
||||||
if table.merge (tables, fonts):
|
if table.merge (tables, fonts):
|
||||||
mega[tag] = table
|
mega[tag] = table
|
||||||
print "Merged '%s'." % tag
|
self.log("Merged '%s'." % tag)
|
||||||
else:
|
else:
|
||||||
print "Dropped '%s'. No need to merge explicitly." % tag
|
self.log("Dropped '%s'. No need to merge explicitly." % tag)
|
||||||
|
self.log.lapse("merge '%s'" % tag)
|
||||||
|
|
||||||
return mega
|
return mega
|
||||||
|
|
||||||
@ -381,6 +382,10 @@ def main(args):
|
|||||||
font = merger.merge(args)
|
font = merger.merge(args)
|
||||||
outfile = 'merged.ttf'
|
outfile = 'merged.ttf'
|
||||||
font.save(outfile)
|
font.save(outfile)
|
||||||
|
log.lapse("compile and save font")
|
||||||
|
|
||||||
|
log.last_time = log.start_time
|
||||||
|
log.lapse("make one with everything(TOTAL TIME)")
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main(sys.argv[1:])
|
main(sys.argv[1:])
|
||||||
|
@ -2007,8 +2007,8 @@ def main(args):
|
|||||||
for g in args))
|
for g in args))
|
||||||
|
|
||||||
font = load_font(fontfile, options, dontLoadGlyphNames=dontLoadGlyphNames)
|
font = load_font(fontfile, options, dontLoadGlyphNames=dontLoadGlyphNames)
|
||||||
subsetter = Subsetter(options=options, log=log)
|
|
||||||
log.lapse("load font")
|
log.lapse("load font")
|
||||||
|
subsetter = Subsetter(options=options, log=log)
|
||||||
|
|
||||||
names = font.getGlyphNames()
|
names = font.getGlyphNames()
|
||||||
log.lapse("loading glyph names")
|
log.lapse("loading glyph names")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user