2.25 <PangoScriptIter>

Structure: <PangoScriptIter>

A <PangoScriptIter> is used to iterate through a string and identify ranges in different scripts.

Procedures

Method: script-iter:free self
Method: free self

Frees a <PangoScriptIter>.

self

Passed: a <PangoScriptIter>.

a <PangoScriptIter>

Method: script-iter:get-range self ⇒ start end script
Method: get-range self ⇒ start end script

Gets information about the range to which self currently points.

The range is the set of locations p where *start <= p < *end. (That is, it doesn’t include the character stored at *end)

Note that while the type of the script argument is declared as <PangoScript>, as of Pango 1.18, this function simply returns <GUnicodeScript> values. Callers must be prepared to handle unknown values.

self

Passed: a <PangoScriptIter>.

a <PangoScriptIter>

start

Returned: a string.

location to store start position of the range

end

Returned: a string.

location to store end position of the range

script

Returned: a <PangoScript>.

location to store script for range

Procedure: script-iter:new text length ⇒ %return

Create a new <PangoScriptIter>, used to break a string of Unicode text into runs by Unicode script.

No copy is made of text, so the caller needs to make sure it remains valid until the iterator is freed with script-iter:free.

text

Passed: a string.

a UTF-8 string

length

Passed: a 32-bit integer.

length of text, or -1 if text is nul-terminated

%return

Returned: a <PangoScriptIter>.

the new script iterator, initialized to point at the first range in the text, which should be freed with script-iter:free. If the string is empty, it will point at an empty range.

Method: script-iter:next? self ⇒ %return
Method: next? self ⇒ %return

Advances a <PangoScriptIter> to the next range.

If self is already at the end, it is left unchanged and #f is returned.

self

Passed: a <PangoScriptIter>.

a <PangoScriptIter>

%return

Returned: a boolean.

#t if self was successfully advanced