PangoOT.Buffer

Fields

None

Methods

class

new (font)

add_glyph (glyph, properties, cluster)

clear ()

destroy ()

get_glyphs ()

output (glyphs)

set_rtl (rtl)

set_zero_width_marks (zero_width_marks)

Details

class PangoOT.Buffer
classmethod new(font)
Parameters:

font (PangoFc.Font) – a PangoFcFont

Returns:

the newly allocated PangoOTBuffer, which should be freed with [method`PangoOT`.Buffer.destroy].

Return type:

PangoOT.Buffer

Creates a new PangoOTBuffer for the given OpenType font.

New in version 1.4.

add_glyph(glyph, properties, cluster)
Parameters:
  • glyph (int) – the glyph index to add, like a PangoGlyph

  • properties (int) – the glyph properties

  • cluster (int) – the cluster that this glyph belongs to

Appends a glyph to a PangoOTBuffer, with properties identifying which features should be applied on this glyph.

See [method`PangoOT`.Ruleset.add_feature].

New in version 1.4.

clear()

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

New in version 1.4.

destroy()

Destroys a PangoOTBuffer and free all associated memory.

New in version 1.4.

get_glyphs()
Returns:

location to store the array of glyphs

Return type:

glyphs: [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.

New in version 1.4.

output(glyphs)
Parameters:

glyphs (Pango.GlyphString) – a PangoGlyphString

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.

New in version 1.4.

set_rtl(rtl)
Parameters:

rtl (bool) – True for right-to-left text

Sets whether glyphs will be rendered right-to-left.

This setting is needed for proper horizontal positioning of right-to-left scripts.

New in version 1.4.

set_zero_width_marks(zero_width_marks)
Parameters:

zero_width_marks (bool) – True if characters with a mark class should be forced to zero width

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.

New in version 1.6.