Class: Gsk::TextNode

Inherits:
RenderNode show all
Defined in:
(unknown)

Overview

A render node drawing a set of glyphs.

Instance Method Summary collapse

Methods inherited from RenderNode

deserialize, #draw, #get_bounds, #node_type, #ref, #serialize, #unref, #write_to_file

Constructor Details

#initialize(font, glyphs, color, offset) ⇒ Gsk::TextNode

Creates a render node that renders the given glyphs.

Note that color may not be used if the font contains color glyphs.

Parameters:

  • font (Pango::Font)

    the PangoFont containing the glyphs

  • glyphs (Pango::GlyphString)

    the PangoGlyphString to render

  • color (Gdk::RGBA)

    the foreground color to render with

  • offset (Graphene::Point)

    offset of the baseline

Instance Method Details

#colorGdk::RGBA

Retrieves the color used by the text node.

Returns:

  • (Gdk::RGBA)

    the text color

#fontPango::Font

Returns the font used by the text node.

Returns:

  • (Pango::Font)

    the font

#get_glyphs(n_glyphs) ⇒ Array<Pango::GlyphInfo>

Retrieves the glyph information in the node.

Parameters:

  • n_glyphs (Integer)

    the number of glyphs returned

Returns:

  • (Array<Pango::GlyphInfo>)

    the glyph information

#has_color_glyphsBoolean

Checks whether the text node has color glyphs.

Returns:

  • (Boolean)

    true if the text node has color glyphs

#num_glyphsInteger

Retrieves the number of glyphs in the text node.

Returns:

  • (Integer)

    the number of glyphs

#offsetGraphene::Point

Retrieves the offset applied to the text.

Returns:

  • (Graphene::Point)

    a point with the horizontal and vertical offsets