mcfonts.glyph¶
Glyph module, containing the basic and universal glyph class.
Submodules¶
Package Contents¶
- class Glyph¶
Bases:
abc.ABCThe Glyph class represents any visible character glyph.
Glyphs are immutable. To change them, create another with different fields and overwrite the previous glyph.
- abstractmethod bake() PIL.Image.Image¶
Return a image rendering of this glyph.
This does not include any right padding.
- Return type:¶
PIL.Image.Image
- abstractmethod get_metrics() GlyphMetrics¶
Return the metrics of this glyph.
- is_empty() bool¶
Return if glyph is entirely empty.
- class GlyphMetrics¶
Series of bearings; essential for bounding box calculations.
Bearings are measured from the bottom-left corner of a glyph. Metrics do not have data on the theoretical top-right canvas bounds.
- classmethod from_tuple(tup: tuple[int, int, int, int], /) GlyphMetrics¶
- bottom : int¶
Spaces from canvas to bottom edge of content.
- left : int¶
Spaces from canvas to left edge of content.
- right : int¶
Spaces from canvas to right edge of content.
- top : int¶
Spaces from canvas to top edge of content.