MCPcopy Index your code
hub / github.com/clips/pattern / PDFType3Font

Class PDFType3Font

pattern/web/pdf/pdffont.py:575–594  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

573
574# PDFType3Font
575class 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

Callers 1

get_fontMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…