Package org.gnome.pango
Class GlyphGeometry
java.lang.Object
io.github.jwharm.javagi.base.ProxyInstance
org.gnome.pango.GlyphGeometry
- All Implemented Interfaces:
Proxy
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 Summary
ConstructorDescriptionAllocate a new GlyphGeometry.GlyphGeometry
(Arena arena) Allocate a new GlyphGeometry.GlyphGeometry
(MemorySegment address) Create a GlyphGeometry proxy instance for the provided memory address.GlyphGeometry
(GlyphUnit width, GlyphUnit xOffset, GlyphUnit yOffset) Allocate a new GlyphGeometry with the fields set to the provided values.GlyphGeometry
(GlyphUnit width, GlyphUnit xOffset, GlyphUnit yOffset, Arena arena) Allocate a new GlyphGeometry with the fields set to the provided values. -
Method Summary
Modifier and TypeMethodDescriptionstatic MemoryLayout
The memory layout of the native struct.Read the value of the fieldwidth
.Read the value of the fieldx_offset
.Read the value of the fieldy_offset
.void
writeWidth
(GlyphUnit width) Write a value in the fieldwidth
.void
writeXOffset
(GlyphUnit xOffset) Write a value in the fieldx_offset
.void
writeYOffset
(GlyphUnit yOffset) Write a value in the fieldy_offset
.Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
GlyphGeometry
Create a GlyphGeometry proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
GlyphGeometry
Allocate a new GlyphGeometry.- Parameters:
arena
- to control the memory allocation scope
-
GlyphGeometry
public GlyphGeometry()Allocate a new GlyphGeometry. The memory is allocated withArena.ofAuto()
. -
GlyphGeometry
Allocate a new GlyphGeometry with the fields set to the provided values.- Parameters:
width
- value for the fieldwidth
xOffset
- value for the fieldxOffset
yOffset
- value for the fieldyOffset
arena
- to control the memory allocation scope
-
GlyphGeometry
Allocate a new GlyphGeometry with the fields set to the provided values. The memory is allocated withArena.ofAuto()
.- Parameters:
width
- value for the fieldwidth
xOffset
- value for the fieldxOffset
yOffset
- value for the fieldyOffset
-
-
Method Details
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
readWidth
Read the value of the fieldwidth
.- Returns:
- The value of the field
width
-
writeWidth
Write a value in the fieldwidth
.- Parameters:
width
- The new value for the fieldwidth
-
readXOffset
Read the value of the fieldx_offset
.- Returns:
- The value of the field
x_offset
-
writeXOffset
Write a value in the fieldx_offset
.- Parameters:
xOffset
- The new value for the fieldx_offset
-
readYOffset
Read the value of the fieldy_offset
.- Returns:
- The value of the field
y_offset
-
writeYOffset
Write a value in the fieldy_offset
.- Parameters:
yOffset
- The new value for the fieldy_offset
-