TextNode
-
class TextNode(*args, **kwargs)
Superclasses: RenderNode
A render node drawing a set of glyphs.
Constructors
-
class TextNode
-
classmethod new(font: Font, glyphs: GlyphString, color: RGBA, offset: Point) → TextNode | None
Creates a render node that renders the given glyphs.
Note that color may not be used if the font contains
color glyphs.
- Parameters:
font – the PangoFont containing the glyphs
glyphs – the PangoGlyphString to render
color – the foreground color to render with
offset – offset of the baseline
Methods
-
class TextNode
-
get_color() → RGBA
Retrieves the color used by the text node.
The value returned by this function will not be correct
if the render node was created for a non-sRGB color.
-
get_font() → Font
Returns the font used by the text node.
-
get_glyphs() → list[GlyphInfo]
Retrieves the glyph information in the node.
-
get_num_glyphs() → int
Retrieves the number of glyphs in the text node.
-
get_offset() → Point
Retrieves the offset applied to the text.
-
has_color_glyphs() → bool
Checks whether the text node has color glyphs.