Function pango::shape_full

source ·
pub fn shape_full(
    item_text: &str,
    paragraph_text: Option<&str>,
    analysis: &Analysis,
    glyphs: &mut GlyphString,
)
Expand description

Convert the characters in @text into glyphs.

Given a segment of text and the corresponding Analysis structure returned from itemize(), convert the characters into glyphs. You may also pass in only a substring of the item from itemize().

This is similar to shape(), except it also can optionally take the full paragraph text as input, which will then be used to perform certain cross-item shaping interactions. If you have access to the broader text of which @item_text is part of, provide the broader text as @paragraph_text. If @paragraph_text is None, item text is used instead.

Some aspects of hyphen insertion and text transformation (in particular, capitalization) require log attrs, and thus can only be handled by shape_item().

Note that the extra attributes in the @analyis that is returned from itemize() have indices that are relative to the entire paragraph, so you do not pass the full paragraph text as @paragraph_text, you need to subtract the item offset from their indices before calling shape_full().

§item_text

valid UTF-8 text to shape.

§item_length

the length (in bytes) of @item_text. -1 means nul-terminated text.

§paragraph_text

text of the paragraph (see details).

§paragraph_length

the length (in bytes) of @paragraph_text. -1 means nul-terminated text.

§analysis

Analysis structure from itemize().

§glyphs

glyph string in which to store results.