mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
PDF Output: Do not fail if one of th efonts from the source document has no name metadata
This commit is contained in:
parent
934cb684c1
commit
f18fdce33b
@ -181,8 +181,12 @@ class Font(object):
|
|||||||
self.metrics.sfnt(self.font_stream)
|
self.metrics.sfnt(self.font_stream)
|
||||||
|
|
||||||
def write_to_unicode(self, objects):
|
def write_to_unicode(self, objects):
|
||||||
cmap = CMap(self.metrics.postscript_name, self.metrics.glyph_map,
|
try:
|
||||||
compress=self.compress)
|
name = self.metrics.postscript_name
|
||||||
|
except KeyError:
|
||||||
|
from calibre.utils.short_uuid import uuid4
|
||||||
|
name = uuid4()
|
||||||
|
cmap = CMap(name, self.metrics.glyph_map, compress=self.compress)
|
||||||
self.font_dict['ToUnicode'] = objects.add(cmap)
|
self.font_dict['ToUnicode'] = objects.add(cmap)
|
||||||
|
|
||||||
def write_widths(self, objects):
|
def write_widths(self, objects):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user