Package: pango

Function pango:attr-list-splice

Lambda List

pango:attr-list-splice (attrlist1 attrlist2 pos len)

Arguments

attrlist1 -- a pango:attr-list instance
attrlist2 -- a pango:attr-list instance
pos -- an integer for the position in the attribute list at which to insert attrlist2
len -- an integer for the length of the spliced segment, note that this must be specified since the attributes in attrlist2 may only be present at some subsection of this range

Details

This function opens up a hole in the attribute list, fills it in with attributes from the left, and then merges attrlist2 on top of the hole. This operation is equivalent to stretching every attribute that applies at position pos in the attribute list by an amount len, and then calling the pango:attr-list-change function with a copy of each attribute in attrlist2 in sequence, offset in position by pos.

This operation proves useful for, for instance, inserting a pre-edit string in the middle of an edit buffer.
 

See also

#2025-1-1