:right-sidebar: True Buffer =================================================================== .. currentmodule:: gi.repository.PangoOT .. class:: Buffer(**kwargs) :no-contents-entry: :Constructors: :: new(font:PangoFc.Font) -> PangoOT.Buffer Constructors ------------ .. rst-class:: interim-class .. class:: Buffer :no-index: .. classmethod:: new(font: ~gi.repository.PangoFc.Font) -> ~gi.repository.PangoOT.Buffer Creates a new ``PangoOTBuffer`` for the given OpenType font. .. versionadded:: 1.4 :param font: a ``PangoFcFont`` Methods ------- .. rst-class:: interim-class .. class:: Buffer :no-index: .. method:: add_glyph(glyph: int, properties: int, cluster: int) -> None Appends a glyph to a ``PangoOTBuffer``, with ``properties`` identifying which features should be applied on this glyph. See :obj:`~gi.repository.PangoOT.Ruleset.add_feature`. .. versionadded:: 1.4 :param glyph: the glyph index to add, like a ``PangoGlyph`` :param properties: the glyph properties :param cluster: the cluster that this glyph belongs to .. method:: clear() -> None Empties a ``PangoOTBuffer``, make it ready to add glyphs to. .. versionadded:: 1.4 .. method:: destroy() -> None Destroys a ``PangoOTBuffer`` and free all associated memory. .. versionadded:: 1.4 .. method:: get_glyphs() -> list[~gi.repository.PangoOT.Glyph] Gets the glyph array contained in a ``PangoOTBuffer``. The glyphs are owned by the buffer and should not be freed, and are only valid as long as buffer is not modified. .. versionadded:: 1.4 .. method:: output(glyphs: ~gi.repository.Pango.GlyphString) -> None Exports the glyphs in a ``PangoOTBuffer`` into a ``PangoGlyphString``. This is typically used after the OpenType layout processing is over, to convert the resulting glyphs into a generic Pango glyph string. .. versionadded:: 1.4 :param glyphs: a ``PangoGlyphString`` .. method:: set_rtl(rtl: bool) -> None Sets whether glyphs will be rendered right-to-left. This setting is needed for proper horizontal positioning of right-to-left scripts. .. versionadded:: 1.4 :param rtl: :const:`True` for right-to-left text .. method:: set_zero_width_marks(zero_width_marks: bool) -> None Sets whether characters with a mark class should be forced to zero width. This setting is needed for proper positioning of Arabic accents, but will produce incorrect results with standard OpenType Indic fonts. .. versionadded:: 1.6 :param zero_width_marks: :const:`True` if characters with a mark class should be forced to zero width