Package: pango

Function pango:itemize

Lambda List

pango:itemize (context text start len attrs iter &key direction)

Arguments

context -- a pango:context object holding information that affects the itemization process
text -- a string for the text to itemize, must be valid UTF-8
start -- an integer for the first byte in text to process
len -- an integer for the number of bytes, (not characters, to process after start, this must be >= 0
attrs -- a pango:attr-list instance for the set of attributes that apply to text
iter -- a cached pango:attr-iterator attribute iterator, or nil
direction -- a pango:direction value for the base direction to use for bidirectional processing, or the default nil value

Return Value

The list of pango:item instances.

Details

Breaks a piece of text into segments with consistent directional level and shaping engine. Each byte of text will be contained in exactly one of the items in the returned list. The generated list of items will be in logical order, the start offsets of the items are ascending.

The iter argument should be an iterator over attrs currently positioned at a range before or containing start. The iter argument will be advanced to the range covering the position just after start + len, that is, if itemizing in a loop, just keep passing in the same iter.

The direction argument specifies the base direction to use when computing bidirectional levels. For the default nil value the base direction is obtained from the pango:context object using the pango:context-base-dir function.

Notes

This function includes the functionality of the pango_itemize_with_base_dir() function using the direction keyword argument.
 

See also

2026-03-23