Merge pull request #273 from igormp/develop

Use resolve_all on PdfFont widths and bbox
pull/298/head
Tata Ganesh 2019-10-12 21:24:29 +05:30 committed by GitHub
commit f218996fe9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -20,7 +20,7 @@ from .pdftypes import dict_value
from .pdftypes import int_value
from .pdftypes import list_value
from .pdftypes import num_value
from .pdftypes import resolve1
from .pdftypes import resolve1, resolve_all
from .pdftypes import stream_value
from .psparser import KWD
from .psparser import LIT
@ -477,7 +477,7 @@ class PDFFont(object):
def __init__(self, descriptor, widths, default_width=None):
self.descriptor = descriptor
self.widths = widths
self.widths = resolve_all(widths)
self.fontname = resolve1(descriptor.get('FontName', 'unknown'))
if isinstance(self.fontname, PSLiteral):
self.fontname = literal_name(self.fontname)
@ -487,7 +487,7 @@ class PDFFont(object):
self.italic_angle = num_value(descriptor.get('ItalicAngle', 0))
self.default_width = default_width or num_value(descriptor.get('MissingWidth', 0))
self.leading = num_value(descriptor.get('Leading', 0))
self.bbox = list_value(descriptor.get('FontBBox', (0, 0, 0, 0)))
self.bbox = list_value(resolve_all(descriptor.get('FontBBox', (0, 0, 0, 0))))
self.hscale = self.vscale = .001
return