Skip to main content

Module font_layout

Module font_layout 

Source
Expand description

Glyph layout and vertical metrics of a font at one pixel size.

Structs§

FontVerticalMetrics
Vertical metrics of a font at one pixel size.
GlyphPixelBounds
Integer pixel box that a rasterized glyph covers, relative to the glyph origin.

Functions§

align_glyph_to_pixel_grid
Rounds the glyph position to whole pixels when static_text_motion is true. Otherwise the glyph is returned unchanged.
glyph_pixel_bounds
Returns the pixel box that glyph covers once outlined, or None when it has no outline (for example a space).
layout_line_glyphs
Lays out text as one line of glyphs, applying kerning. font_size is in pixels and origin is the position of the first glyph on the baseline.
line_advance_width
Returns the advance width of text as one line at font_size pixels, including kerning.
vertical_metrics
Returns the vertical metrics of font at font_size pixels.