| 573 | |
| 574 | # PDFType3Font |
| 575 | class PDFType3Font(PDFSimpleFont): |
| 576 | |
| 577 | def __init__(self, rsrcmgr, spec): |
| 578 | firstchar = int_value(spec.get('FirstChar', 0)) |
| 579 | lastchar = int_value(spec.get('LastChar', 0)) |
| 580 | widths = list_value(spec.get('Widths', [0]*256)) |
| 581 | widths = dict( (i+firstchar,w) for (i,w) in enumerate(widths)) |
| 582 | if 'FontDescriptor' in spec: |
| 583 | descriptor = dict_value(spec['FontDescriptor']) |
| 584 | else: |
| 585 | descriptor = {'Ascent':0, 'Descent':0, |
| 586 | 'FontBBox':spec['FontBBox']} |
| 587 | PDFSimpleFont.__init__(self, descriptor, widths, spec) |
| 588 | self.matrix = tuple(list_value(spec.get('FontMatrix'))) |
| 589 | (_,self.descent,_,self.ascent) = self.bbox |
| 590 | (self.hscale,self.vscale) = apply_matrix_norm(self.matrix, (1,1)) |
| 591 | return |
| 592 | |
| 593 | def __repr__(self): |
| 594 | return '<PDFType3Font>' |
| 595 | |
| 596 | |
| 597 | # PDFCIDFont |
no outgoing calls
no test coverage detected
searching dependent graphs…