Merge pull request #273 from igormp/develop
Use resolve_all on PdfFont widths and bboxpull/298/head
commit
f218996fe9
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue