Buffer

class Buffer(**kwargs)
Constructors:

new(font:PangoFc.Font) -> PangoOT.Buffer

Constructors

class Buffer
classmethod new(font: Font) Buffer

Creates a new PangoOTBuffer for the given OpenType font.

Added in version 1.4.

Parameters:

font – a PangoFcFont

Methods

class Buffer
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 add_feature.

Added in version 1.4.

Parameters:
  • glyph – the glyph index to add, like a PangoGlyph

  • properties – the glyph properties

  • cluster – the cluster that this glyph belongs to

clear() None

Empties a PangoOTBuffer, make it ready to add glyphs to.

Added in version 1.4.

destroy() None

Destroys a PangoOTBuffer and free all associated memory.

Added in version 1.4.

get_glyphs() list[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.

Added in version 1.4.

output(glyphs: 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.

Added in version 1.4.

Parameters:

glyphs – a PangoGlyphString

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.

Added in version 1.4.

Parameters:

rtlTrue for right-to-left text

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.

Added in version 1.6.

Parameters:

zero_width_marksTrue if characters with a mark class should be forced to zero width