Functions

font_get_coverage (font, language)

font_get_kerning (font, left, right)

get_unknown_glyph (font)

render (bitmap, font, glyphs, x, y)

render_layout (bitmap, layout, x, y)

render_layout_line (bitmap, line, x, y)

render_layout_line_subpixel (bitmap, line, x, y)

render_layout_subpixel (bitmap, layout, x, y)

render_transformed (bitmap, matrix, font, glyphs, x, y)

shutdown_display ()

Details

PangoFT2.font_get_coverage(font, language)[source]
Parameters:
Returns:

a PangoCoverage

Return type:

Pango.Coverage

Gets the PangoCoverage for a PangoFT2Font.

Use [method`Pango`.Font.get_coverage] instead.

PangoFT2.font_get_kerning(font, left, right)[source]
Parameters:
  • font (Pango.Font) – a PangoFont

  • left (int) – the left PangoGlyph

  • right (int) – the right PangoGlyph

Returns:

The amount of kerning (in Pango units) to apply for the given combination of glyphs.

Return type:

int

Retrieves kerning information for a combination of two glyphs.

Use PangoFc.Font.kern_glyphs() instead.

PangoFT2.get_unknown_glyph(font)[source]
Parameters:

font (Pango.Font) – a PangoFont

Returns:

a glyph index into font, or Pango.GLYPH_EMPTY

Return type:

int

Return the index of a glyph suitable for drawing unknown characters with font, or Pango.GLYPH_EMPTY if no suitable glyph found.

If you want to draw an unknown-box for a character that is not covered by the font, use PANGO_GET_UNKNOWN_GLYPH() instead.

PangoFT2.render(bitmap, font, glyphs, x, y)[source]
Parameters:
  • bitmap (freetype2.Bitmap) – the FreeType2 bitmap onto which to draw the string

  • font (Pango.Font) – the font in which to draw the string

  • glyphs (Pango.GlyphString) – the glyph string to draw

  • x (int) – the x position of the start of the string (in pixels)

  • y (int) – the y position of the baseline (in pixels)

Renders a PangoGlyphString onto a FreeType2 bitmap.

PangoFT2.render_layout(bitmap, layout, x, y)[source]
Parameters:

Render a PangoLayout onto a FreeType2 bitmap

PangoFT2.render_layout_line(bitmap, line, x, y)[source]
Parameters:

Render a PangoLayoutLine onto a FreeType2 bitmap

PangoFT2.render_layout_line_subpixel(bitmap, line, x, y)[source]
Parameters:

Render a PangoLayoutLine onto a FreeType2 bitmap, with he location specified in fixed-point Pango units rather than pixels.

(Using this will avoid extra inaccuracies from rounding to integer pixels multiple times, even if the final glyph positions are integers.)

New in version 1.6.

PangoFT2.render_layout_subpixel(bitmap, layout, x, y)[source]
Parameters:
  • bitmap (freetype2.Bitmap) – a freetype2.Bitmap to render the layout onto

  • layout (Pango.Layout) – a PangoLayout

  • x (int) – the X position of the left of the layout (in Pango units)

  • y (int) – the Y position of the top of the layout (in Pango units)

Render a PangoLayout onto a FreeType2 bitmap, with he location specified in fixed-point Pango units rather than pixels.

(Using this will avoid extra inaccuracies from rounding to integer pixels multiple times, even if the final glyph positions are integers.)

New in version 1.6.

PangoFT2.render_transformed(bitmap, matrix, font, glyphs, x, y)[source]
Parameters:
  • bitmap (freetype2.Bitmap) – the FreeType2 bitmap onto which to draw the string

  • matrix (Pango.Matrix or None) – a PangoMatrix

  • font (Pango.Font) – the font in which to draw the string

  • glyphs (Pango.GlyphString) – the glyph string to draw

  • x (int) – the x position of the start of the string (in Pango units in user space coordinates)

  • y (int) – the y position of the baseline (in Pango units in user space coordinates)

Renders a PangoGlyphString onto a FreeType2 bitmap, possibly transforming the layed-out coordinates through a transformation matrix.

Note that the transformation matrix for font is not changed, so to produce correct rendering results, the font must have been loaded using a PangoContext with an identical transformation matrix to that passed in to this function.

New in version 1.6.

PangoFT2.shutdown_display()[source]

Free the global fontmap. (See pango_ft2_font_map_for_display()) Use of the global PangoFT2 fontmap is deprecated.