:right-sidebar: True ScriptIter =================================================================== .. currentmodule:: gi.repository.Pango .. class:: ScriptIter(**kwargs) :no-contents-entry: A ``PangoScriptIter`` is used to iterate through a string and identify ranges in different scripts. Constructors ------------ .. rst-class:: interim-class .. class:: ScriptIter :no-index: .. classmethod:: new(text: str, length: int) -> ~gi.repository.Pango.ScriptIter 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 :obj:`~gi.repository.Pango.ScriptIter.free`\. .. versionadded:: 1.4 :param text: a UTF-8 string :param length: length of ``text``\, or -1 if ``text`` is nul-terminated Methods ------- .. rst-class:: interim-class .. class:: ScriptIter :no-index: .. method:: free() -> None Frees a ``PangoScriptIter``\. .. versionadded:: 1.4 .. method:: get_range() -> tuple[str, str, ~gi.repository.Pango.Script] Gets information about the range to which ``iter`` 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. .. versionadded:: 1.4 .. method:: next() -> bool Advances a ``PangoScriptIter`` to the next range. If ``iter`` is already at the end, it is left unchanged and :const:`False` is returned. .. versionadded:: 1.4