mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
PDF Output: Handle input documents with fonts that do not have either postscript or full name information. Fixes #1518678 [ebook-convert failing on file with embedded font](https://bugs.launchpad.net/calibre/+bug/1518678)
This commit is contained in:
parent
385fcfbba6
commit
7489f1a793
@ -61,7 +61,10 @@ class FontMetrics(object):
|
|||||||
def postscript_name(self):
|
def postscript_name(self):
|
||||||
if 'postscript_name' in self.names:
|
if 'postscript_name' in self.names:
|
||||||
return self.names['postscript_name'].replace(' ', '-')
|
return self.names['postscript_name'].replace(' ', '-')
|
||||||
return self.names['full_name'].replace(' ', '-')
|
try:
|
||||||
|
return self.names['full_name'].replace(' ', '-')
|
||||||
|
except KeyError:
|
||||||
|
return self.names['family_name'].replace(' ', '-')
|
||||||
|
|
||||||
def underline_thickness(self, pixel_size=12.0):
|
def underline_thickness(self, pixel_size=12.0):
|
||||||
'Thickness for lines (in pixels) at the specified size'
|
'Thickness for lines (in pixels) at the specified size'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user