Class GlyphGeometry

java.lang.Object
org.javagi.base.ProxyInstance
org.gnome.pango.GlyphGeometry
All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public class GlyphGeometry extends ProxyInstance

The PangoGlyphGeometry structure contains width and positioning information for a single glyph.

Note that width is not guaranteed to be the same as the glyph extents. Kerning and other positioning applied during shaping will affect both the width and the xOffset for the glyphs in the glyph string that results from shaping.

The information in this struct is intended for rendering the glyphs, as follows:

  1. Assume the current point is (x, y)
  2. Render the current glyph at (x + x_offset, y + y_offset),
  3. Advance the current point to (x + width, y)
  4. Render the next glyph
  • Constructor Details

    • GlyphGeometry

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

      public GlyphGeometry(Arena arena)
      Allocate a new GlyphGeometry.
      Parameters:
      arena - to control the memory allocation scope
    • GlyphGeometry

      public GlyphGeometry()
      Allocate a new GlyphGeometry. The memory is allocated with Arena.ofAuto().
    • GlyphGeometry

      public GlyphGeometry(GlyphUnit width, GlyphUnit xOffset, GlyphUnit yOffset, Arena arena)
      Allocate a new GlyphGeometry with the fields set to the provided values.
      Parameters:
      width - value for the field width
      xOffset - value for the field xOffset
      yOffset - value for the field yOffset
      arena - to control the memory allocation scope
    • GlyphGeometry

      public GlyphGeometry(GlyphUnit width, GlyphUnit xOffset, GlyphUnit yOffset)
      Allocate a new GlyphGeometry with the fields set to the provided values. The memory is allocated with Arena.ofAuto().
      Parameters:
      width - value for the field width
      xOffset - value for the field xOffset
      yOffset - value for the field yOffset
  • Method Details

    • getMemoryLayout

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

      public GlyphUnit readWidth()
      Read the value of the field width.
      Returns:
      The value of the field width
    • writeWidth

      public void writeWidth(GlyphUnit width)
      Write a value in the field width.
      Parameters:
      width - The new value for the field width
    • readXOffset

      public GlyphUnit readXOffset()
      Read the value of the field x_offset.
      Returns:
      The value of the field x_offset
    • writeXOffset

      public void writeXOffset(GlyphUnit xOffset)
      Write a value in the field x_offset.
      Parameters:
      xOffset - The new value for the field x_offset
    • readYOffset

      public GlyphUnit readYOffset()
      Read the value of the field y_offset.
      Returns:
      The value of the field y_offset
    • writeYOffset

      public void writeYOffset(GlyphUnit yOffset)
      Write a value in the field y_offset.
      Parameters:
      yOffset - The new value for the field y_offset