explicitly require 'head' table in TTFont.save()
it's implicitly required anyway, e.g. by ttx's ttCompile, maxp's recalc, OS/2 compile, etc.
This commit is contained in:
parent
9de3d1a5ae
commit
b39f3b613c
@ -203,8 +203,11 @@ class TTFont(object):
|
|||||||
# assume "file" is a writable file object
|
# assume "file" is a writable file object
|
||||||
closeStream = False
|
closeStream = False
|
||||||
|
|
||||||
if self.recalcTimestamp and 'head' in self:
|
if 'head' not in self:
|
||||||
self['head'] # make sure 'head' is loaded so the recalculation is actually done
|
raise TTLibError("missing required table: head")
|
||||||
|
elif self.recalcTimestamp and not self.isLoaded('head'):
|
||||||
|
# make sure 'head' is loaded so the recalculation is actually done
|
||||||
|
self['head']
|
||||||
|
|
||||||
tags = list(self.keys())
|
tags = list(self.keys())
|
||||||
if "GlyphOrder" in tags:
|
if "GlyphOrder" in tags:
|
||||||
|
@ -274,7 +274,10 @@ def ttCompile(input, output, options):
|
|||||||
if not options.recalcTimestamp:
|
if not options.recalcTimestamp:
|
||||||
# use TTX file modification time for head "modified" timestamp
|
# use TTX file modification time for head "modified" timestamp
|
||||||
mtime = os.path.getmtime(input)
|
mtime = os.path.getmtime(input)
|
||||||
ttf['head'].modified = timestampSinceEpoch(mtime)
|
try:
|
||||||
|
ttf['head'].modified = timestampSinceEpoch(mtime)
|
||||||
|
except KeyError:
|
||||||
|
raise TTLibError("missing required table: head")
|
||||||
|
|
||||||
ttf.save(output)
|
ttf.save(output)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user