- class pyhanko.pdf_utils.font.basic.SimpleFontEngine(writer, name, avg_width)¶
Simplistic font engine that effectively only works with PDF standard fonts, and does not care about font metrics. Best used with monospaced fonts such as Courier.
- property uses_complex_positioning¶
True, this font engine expects the line matrix to always be equal to the text matrix when exiting and entering
shape(). In other words, the current text position is where
0 0 Tdwould move to.
False, this method does not use any text positioning operators, and therefore uses the PDF standard’s ‘natural’ positioning rules for text showing operators.
The default is
- shape(txt) pyhanko.pdf_utils.font.api.ShapeResult ¶
Render a string to a format suitable for inclusion in a content stream and measure its total cursor advancement vector in em units.
txt – String to shape.
A shaping result.
FontEngineto a PDF object suitable for embedding inside a resource dictionary.
If the PDF object is an indirect reference, the caller must not attempt to dereference it. In other words, implementations can use preallocated references to delay subsetting until the last possible moment (this is even encouraged, see
A PDF dictionary.
- class pyhanko.pdf_utils.font.basic.SimpleFontEngineFactory(name, avg_width)¶