Module qlibs.fonts.font_render

Module for rendering text

class qlibs.fonts.font_render.DirectFontRender(ctx=None, font=None, font_path=None, pixel_size=48, flip_y=False, default_font='default')

Render text using font

calc_height(text, scale=1, full=False)
calc_size(text, scale=1)
get_glyph(char, font_name=None)
render_multiline(text, x, y, max_line_len, *, scale=32, vertical_advance=None, min_sep=15, **kwargs)
render_string(text, x, y, scale=1, color=(1, 1, 1), mvp=<qlibs.math.matrix.Matrix4 object>, enable_blending=True, font=None, **kwargs)

Render text with given parameters

class qlibs.fonts.font_render.FormattedText(text=None, tokens=None, **kwargs)
parse(text)
class qlibs.fonts.font_render.FormattedTextToken(value)

An enumeration.

LINEBREAK = 1
class qlibs.fonts.font_render.FormattingData
copy() a shallow copy of D
class qlibs.fonts.font_render.GGlyph(ctx, glyph)

Class for storing glyph data: advance, size, bearing, and opengl texture

advance
bearing
size
texture
class qlibs.fonts.font_render.TextAlign(value)

An enumeration.

CENTER = 2
LEFT = 1