Package: pango

Function pango:shape

Lambda List

pango:shape (text len analysis)

Arguments

text -- a string for the text to process
len -- an integer for the length (in bytes) of text
analysis -- a pango:analysis instance from the pango:itemize function

Return Value

The pango:glyph-string instance with the results

Details

Given a segment of text and the corresponding pango:analysis instance returned from the pango:itemize function, convert the characters into glyphs. You may also pass in only a substring of the item from the pango:itemize function.

It is recommended that you use the pango:shape-full function instead, since that API allows for shaping interaction happening across text item boundaries.

Note that the extra attributes in the analyis that is returned from the pango:itemize function have indices that are relative to the entire paragraph, so you need to subtract the item offset from their indices before calling the pango:shape function.

Note

Common Lisp has no function for calculation the byte length of a string. Use the babel:string-size-in-octets function from the Babel library to perform this calculation.
(setq str "Zwölf Ägypter auf der Straße")
=> "Zwölf Ägypter auf der Straße"
(length str) => 28
(babel:string-size-in-octets str)
=> 31
=> 28    
 

See also

2024-3-3