Libraries:Gtk:Pango:GlyphItem
Types
T
Constants
Nil : T
Functions
GetType() : Gtk.GObject.Type.T
_Alloc() : Gtk.Pango.GlyphItem.T
Methods
:"="(_ @ T, _ @ T)
:ApplyAttrs(self @ T, text @ Std.String.T, list @ Gtk.Pango.AttrList.T) : Std.Object.T
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 (Gtk.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.
glyph_item | a shaped item |
text | text that list applies to |
list | a Gtk.Pango.AttrList.T |
Returns | a list of glyph items resulting from splitting glyph_item. Free the elements using Free, the list using g_slist_free(). [transfer full] |
:Copy(self @ T) : Gtk.Pango.GlyphItem.T
Make a deep copy of an existing T structure.
orig | a T, may be NULL |
Returns | the newly allocated T, which should be freed with Free, or NULL if orig was NULL. |
:Free(self @ T) : Std.Object.T
:GetLogicalWidths(self @ T, text @ Std.String.T, logical_widths @ Std.Object.T) : Std.Object.T
Given a T and the corresponding text, determine the screen 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 Gtk.Pango.GlyphString.GetLogicalWidths.
glyph_item | a T |
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. |
:Glyphs(self @ T) : Gtk.Pango.GlyphString.T
:Item(self @ T) : Gtk.Pango.Item.T
:LetterSpace(self @ T, text @ Std.String.T, log_attrs @ Gtk.Pango.LogAttr.T, letter_spacing @ Std.Integer.SmallT) : Std.Object.T
Adds spacing between the graphemes of glyph_item to give the effect of typographic letter spacing.
glyph_item | a T |
text | text that glyph_item corresponds to (glyph_item->item->offset is an offset from the start of text) |
log_attrs | logical attributes for the item (the first logical attribute refers to the position before the first character in the item) |
letter_spacing | amount of letter spacing to add in Pango units. May be negative, though too large negative values will give ugly results. |
:Split(self @ T, text @ Std.String.T, split_index @ Std.Integer.SmallT) : Gtk.Pango.GlyphItem.T
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 Gtk.Pango.Item.Split (and uses it internally.)
orig | a Gtk.Pango.Item.T |
text | text to which positions in orig apply |
split_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 Free. |