:right-sidebar: True TextNode =================================================================== .. currentmodule:: gi.repository.Gsk .. class:: TextNode(*args, **kwargs) :no-contents-entry: Superclasses: :class:`~gi.repository.Gsk.RenderNode` A render node drawing a set of glyphs. Constructors ------------ .. rst-class:: interim-class .. class:: TextNode :no-index: .. classmethod:: new(font: ~gi.repository.Pango.Font, glyphs: ~gi.repository.Pango.GlyphString, color: ~gi.repository.Gdk.RGBA, offset: ~gi.repository.Graphene.Point) -> ~gi.repository.Gsk.TextNode | None Creates a render node that renders the given glyphs. Note that ``color`` may not be used if the font contains color glyphs. :param font: the ``PangoFont`` containing the glyphs :param glyphs: the ``PangoGlyphString`` to render :param color: the foreground color to render with :param offset: offset of the baseline Methods ------- .. rst-class:: interim-class .. class:: TextNode :no-index: .. method:: get_color() -> ~gi.repository.Gdk.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. .. method:: get_font() -> ~gi.repository.Pango.Font Returns the font used by the text ``node``\. .. method:: get_glyphs() -> list[~gi.repository.Pango.GlyphInfo] Retrieves the glyph information in the ``node``\. .. method:: get_num_glyphs() -> int Retrieves the number of glyphs in the text node. .. method:: get_offset() -> ~gi.repository.Graphene.Point Retrieves the offset applied to the text. .. method:: has_color_glyphs() -> bool Checks whether the text ``node`` has color glyphs. .. versionadded:: 4.2