#[repr(transparent)]
pub struct GlyphItem { /* private fields */ }
Expand description

A GlyphItem is a pair of a Item and the glyphs resulting from shaping the items text.

As an example of the usage of GlyphItem, the results of shaping text with Layout is a list of LayoutLine, each of which contains a list of GlyphItem.

Implementations

Splits a shaped item (GlyphItem) 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 (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 @self; it will be reused as one of the elements in the list.

text

text that @list applies to

list

a AttrList

Returns

a list of glyph items resulting from splitting @self. Free the elements using Pango::GlyphItem::free(), the list using g_slist_free().

Modifies @self 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 @self.

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 @self (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.)

text

text to which positions in @self 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 pango_glyph_item_free().

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Returns the type identifier of Self.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Ensures that the type has been registered with the type system.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.