Class TextNode

All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public class TextNode extends RenderNode
A render node drawing a set of glyphs.
  • Constructor Details

    • TextNode

      public TextNode(MemorySegment address)
      Create a TextNode instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • TextNode

      public TextNode(Font font, GlyphString glyphs, RGBA color, Point offset)

      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
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the TextNode class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • asParent

      protected TextNode asParent()
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class RenderNode
      Returns:
      the instance as if it were its parent type
    • getColor

      public RGBA getColor()

      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.

      Returns:
      the text color
    • getFont

      public Font getFont()
      Returns the font used by the text node.
      Returns:
      the font
    • getGlyphs

      public GlyphInfo[] getGlyphs()
      Retrieves the glyph information in the node.
      Returns:
      the glyph information
    • getNumGlyphs

      public int getNumGlyphs()
      Retrieves the number of glyphs in the text node.
      Returns:
      the number of glyphs
    • getOffset

      public Point getOffset()
      Retrieves the offset applied to the text.
      Returns:
      a point with the horizontal and vertical offsets
    • hasColorGlyphs

      public boolean hasColorGlyphs()
      Checks whether the text this TextNode has color glyphs.
      Returns:
      true if the text node has color glyphs
      Since:
      4.2