Welcome to Python-flavored Magnum! Please note that, while already being rather stable, this functionality is still considered experimental and some APIs might get changed without preserving full backwards compatibility.

magnum.text.Renderer2D class

2D text renderer

Methods

def render(self, text: str) -> None
Render text
def reserve(self, glyph_count: int, vertex_buffer_usage: gl.BufferUsage = gl.BufferUsage.STATIC_DRAW, index_buffer_usage: gl.BufferUsage = gl.BufferUsage.STATIC_DRAW) -> None
Reserve capacity for renderered glyphs

Special methods

def __init__(self, font: AbstractFont, cache: GlyphCacheGL, size: float, alignment: Alignment = Alignment.LINE_LEFT) -> None
Constructor

Properties

capacity: int get
Capacity for rendered glyphs
mesh: gl.Mesh get
Mesh
rectangle: Range2D get
Rectangle spanning the rendered text