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 Pango.Coverage.

Return type:

Pango.Coverage

Gets the Pango.Coverage for a PangoFT2Font. Use Pango.Font.get_coverage() instead.

PangoFT2.font_get_kerning(font, left, right)[source]
Parameters:
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 Pango.Font
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 Pango.GlyphString onto a FreeType2 bitmap.

PangoFT2.render_layout(bitmap, layout, x, y)[source]
Parameters:
  • bitmap (freetype2.Bitmap) – a FT_Bitmap to render the layout onto
  • layout (Pango.Layout) – a Pango.Layout
  • x (int) – the X position of the left of the layout (in pixels)
  • y (int) – the Y position of the top of the layout (in pixels)

Render a Pango.Layout onto a FreeType2 bitmap

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

Render a Pango.LayoutLine onto a FreeType2 bitmap

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

Render a Pango.LayoutLine 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 FT_Bitmap to render the layout onto
  • layout (Pango.Layout) – a Pango.Layout
  • 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 Pango.Layout 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 Pango.Matrix, or None to use an identity transformation
  • 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 Pango.GlyphString 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 Pango.Context 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.