java.lang.Object
io.github.jwharm.cairobindings.Proxy
org.freedesktop.cairo.Glyph
The Glyph structure holds information about a single glyph when drawing or
measuring text. A font is (in simple terms) a collection of shapes used to
draw text. A glyph is one of these shapes. There can be multiple glyphs for a
single character (alternates to be used in different contexts, for example),
or a glyph can be a ligature of multiple characters. Cairo doesn't
expose any way of converting input text into glyphs, so in order to use the
Cairo interfaces that take arrays of glyphs, you must directly access the
appropriate underlying font system.
Note that the offsets given by x
and y
are not cumulative.
When drawing or measuring text, each glyph is individually positioned with
respect to the overall origin.
- Since:
- 1.0
-
Constructor Summary
ConstructorDescriptionGlyph
(MemorySegment address) Constructor used internally to instantiate a java Glyph object for a nativecairo_glyph_t
instance -
Method Summary
Modifier and TypeMethodDescriptionlong
index()
Glyph index in the font.double
x()
The offset in the X direction between the origin used for drawing or measuring the string and the origin of this glyph.double
y()
The offset in the Y direction between the origin used for drawing or measuring the string and the origin of this glyph.
-
Constructor Details
-
Glyph
Constructor used internally to instantiate a java Glyph object for a nativecairo_glyph_t
instance- Parameters:
address
- the memory address of the nativecairo_glyph_t
instance
-
-
Method Details
-
index
public long index()Glyph index in the font. The exact interpretation of the glyph index depends on the font technology being used.- Returns:
- glyph index in the font
-
x
public double x()The offset in the X direction between the origin used for drawing or measuring the string and the origin of this glyph.- Returns:
- the offset in the X direction
-
y
public double y()The offset in the Y direction between the origin used for drawing or measuring the string and the origin of this glyph.- Returns:
- the offset in the Y direction
-