Package ch.bailu.gtk.pango
Class GlyphItem
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.type.Record
ch.bailu.gtk.pango.GlyphItem
- All Implemented Interfaces:
PointerInterface
A `PangoGlyphItem` is a pair of a `PangoItem` and the glyphs
resulting from shaping the items text.
As an example of the usage of `PangoGlyphItem`, the results
of shaping text with `PangoLayout` is a list of `PangoLayoutLine`,
each of which contains a list of `PangoGlyphItem`.
resulting from shaping the items text.
As an example of the usage of `PangoGlyphItem`, the results
of shaping text with `PangoLayout` is a list of `PangoLayoutLine`,
each of which contains a list of `PangoGlyphItem`.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
horizontal displacement to apply after th
glyph item.static final String
corresponding `PangoGlyphString`static final String
corresponding `PangoItem`static final String
horizontal displacement to apply before the
glyph item.static final String
shift of the baseline, relative to the baseline
of the containing line. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionapplyAttrs
(Str text, AttrList list) Splits a shaped item (`PangoGlyphItem`) into multiple items based
on an attribute list.applyAttrs
(String text, AttrList list) Splits a shaped item (`PangoGlyphItem`) into multiple items based
on an attribute list.copy()
Make a deep copy of an existing `PangoGlyphItem` structure.void
free()
Frees a `PangoGlyphItem` and resources to which it points.static ClassHandler
int
horizontal displacement to apply after th
glyph item.corresponding `PangoGlyphString`corresponding `PangoItem`int
horizontal displacement to apply before the
glyph item.int
shift of the baseline, relative to the baseline
of the containing line.static int
void
getLogicalWidths
(Str text, Int logical_widths) Given a `PangoGlyphItem` and the corresponding text, determine the
width corresponding to each character.void
getLogicalWidths
(String text, Int logical_widths) Given a `PangoGlyphItem` and the corresponding text, determine the
width corresponding to each character.static long
static TypeSystem.TypeSize
static long
static TypeSystem.TypeSize
void
setFieldEndXOffset
(int end_x_offset) horizontal displacement to apply after th
glyph item.void
setFieldGlyphs
(GlyphString glyphs) corresponding `PangoGlyphString`void
setFieldItem
(Item item) corresponding `PangoItem`void
setFieldStartXOffset
(int start_x_offset) horizontal displacement to apply before the
glyph item.void
setFieldYOffset
(int y_offset) shift of the baseline, relative to the baseline
of the containing line.Modifies @orig to cover only the text after @split_index, and
returns a new item that covers the text before @split_index that
used to be in @orig.Modifies @orig to cover only the text after @split_index, and
returns a new item that covers the text before @split_index that
used to be in @orig.Methods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Methods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Field Details
-
ITEM
corresponding `PangoItem`- See Also:
-
GLYPHS
corresponding `PangoGlyphString`- See Also:
-
Y_OFFSET
shift of the baseline, relative to the baseline
of the containing line. Positive values shift upwards- See Also:
-
START_X_OFFSET
horizontal displacement to apply before the
glyph item. Positive values shift right- See Also:
-
END_X_OFFSET
horizontal displacement to apply after th
glyph item. Positive values shift right- See Also:
-
-
Constructor Details
-
GlyphItem
-
GlyphItem
public GlyphItem()
-
-
Method Details
-
getClassHandler
-
setFieldItem
corresponding `PangoItem` -
getFieldItem
corresponding `PangoItem` -
setFieldGlyphs
corresponding `PangoGlyphString` -
getFieldGlyphs
corresponding `PangoGlyphString` -
setFieldYOffset
public void setFieldYOffset(int y_offset) shift of the baseline, relative to the baseline
of the containing line. Positive values shift upwards -
getFieldYOffset
public int getFieldYOffset()shift of the baseline, relative to the baseline
of the containing line. Positive values shift upwards -
setFieldStartXOffset
public void setFieldStartXOffset(int start_x_offset) horizontal displacement to apply before the
glyph item. Positive values shift right -
getFieldStartXOffset
public int getFieldStartXOffset()horizontal displacement to apply before the
glyph item. Positive values shift right -
setFieldEndXOffset
public void setFieldEndXOffset(int end_x_offset) horizontal displacement to apply after th
glyph item. Positive values shift right -
getFieldEndXOffset
public int getFieldEndXOffset()horizontal displacement to apply after th
glyph item. Positive values shift right -
applyAttrs
Splits a shaped item (`PangoGlyphItem`) into multiple items based
on an attribute list.
The idea is that if you have attributes that don't affect shaping,
such as color or underline, to avoid affecting shaping, you filter
them out ([method@Pango.AttrList.filter]), apply the shaping process
and then reapply them to the result using this function.
All attributes that start or end inside a cluster are applied
to that cluster; for instance, if half of a cluster is underlined
and the other-half strikethrough, then the cluster will end
up with both underline and strikethrough attributes. In these
cases, it may happen that @item->extra_attrs for some of the
result items can have multiple attributes of the same type.
This function takes ownership of @glyph_item; it will be reused
as one of the elements in the list.- Parameters:
text
- text that @list applies tolist
- a `PangoAttrList`- Returns:
- a list of glyph items resulting from splitting @glyph_item. Free the elements using [method@Pango.GlyphItem.free], the list using g_slist_free().
-
applyAttrs
Splits a shaped item (`PangoGlyphItem`) into multiple items based
on an attribute list.
The idea is that if you have attributes that don't affect shaping,
such as color or underline, to avoid affecting shaping, you filter
them out ([method@Pango.AttrList.filter]), apply the shaping process
and then reapply them to the result using this function.
All attributes that start or end inside a cluster are applied
to that cluster; for instance, if half of a cluster is underlined
and the other-half strikethrough, then the cluster will end
up with both underline and strikethrough attributes. In these
cases, it may happen that @item->extra_attrs for some of the
result items can have multiple attributes of the same type.
This function takes ownership of @glyph_item; it will be reused
as one of the elements in the list.- Parameters:
text
- text that @list applies tolist
- a `PangoAttrList`- Returns:
- a list of glyph items resulting from splitting @glyph_item. Free the elements using [method@Pango.GlyphItem.free], the list using g_slist_free().
-
copy
Make a deep copy of an existing `PangoGlyphItem` structure.- Returns:
- the newly allocated `PangoGlyphItem`
-
free
public void free()Frees a `PangoGlyphItem` and resources to which it points. -
getLogicalWidths
Given a `PangoGlyphItem` and the corresponding text, determine the
width corresponding to each character.
When multiple characters compose a single cluster, the width of the
entire cluster is divided equally among the characters.
See also [method@Pango.GlyphString.get_logical_widths].- Parameters:
text
- text that @glyph_item corresponds to (glyph_item->item->offset is an offset from the start of @text)logical_widths
- an array whose length is the number of characters in glyph_item (equal to glyph_item->item->num_chars) to be filled in with the resulting character widths.
-
getLogicalWidths
Given a `PangoGlyphItem` and the corresponding text, determine the
width corresponding to each character.
When multiple characters compose a single cluster, the width of the
entire cluster is divided equally among the characters.
See also [method@Pango.GlyphString.get_logical_widths].- Parameters:
text
- text that @glyph_item corresponds to (glyph_item->item->offset is an offset from the start of @text)logical_widths
- an array whose length is the number of characters in glyph_item (equal to glyph_item->item->num_chars) to be filled in with the resulting character widths.
-
split
Modifies @orig to cover only the text after @split_index, and
returns a new item that covers the text before @split_index that
used to be in @orig.
You can think of @split_index as the length of the returned item.
@split_index may not be 0, and it may not be greater than or equal
to the length of @orig (that is, there must be at least one byte
assigned to each item, you can't create a zero-length item).
This function is similar in function to pango_item_split() (and uses
it internally.)- Parameters:
text
- text to which positions in @orig applysplit_index
- byte index of position to split item, relative to the start of the item- Returns:
- the newly allocated item representing text before @split_index, which should be freed with pango_glyph_item_free().
-
split
Modifies @orig to cover only the text after @split_index, and
returns a new item that covers the text before @split_index that
used to be in @orig.
You can think of @split_index as the length of the returned item.
@split_index may not be 0, and it may not be greater than or equal
to the length of @orig (that is, there must be at least one byte
assigned to each item, you can't create a zero-length item).
This function is similar in function to pango_item_split() (and uses
it internally.)- Parameters:
text
- text to which positions in @orig applysplit_index
- byte index of position to split item, relative to the start of the item- Returns:
- the newly allocated item representing text before @split_index, which should be freed with pango_glyph_item_free().
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-