Functions

get_font_map (display, screen)

picture_render (display, src_picture, dest_picture, font, glyphs, x, y)

render (draw, color, font, glyphs, x, y)

render_layout (draw, color, layout, x, y)

render_layout_line (draw, color, line, x, y)

render_transformed (draw, color, matrix, font, glyphs, x, y)

set_default_substitute (display, screen, func, *data)

shutdown_display (display, screen)

substitute_changed (display, screen)

Details

PangoXft.get_font_map(display, screen)[source]
Parameters:
  • display (xlib.Display) – an X display

  • screen (int) – the screen number of a screen within display

Returns:

a PangoFontMap object, owned by Pango.

Return type:

Pango.FontMap

Returns the PangoXftFontMap for the given display and screen. The fontmap is owned by Pango and will be valid until the display is closed.

New in version 1.2.

PangoXft.picture_render(display, src_picture, dest_picture, font, glyphs, x, y)[source]
Parameters:
  • display (xlib.Display) – an X display

  • src_picture (int) – the source picture to draw the string with

  • dest_picture (int) – the destination picture to draw the string onto

  • 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 start of string (in pixels)

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

Renders a PangoGlyphString onto an Xrender Picture object.

PangoXft.render(draw, color, font, glyphs, x, y)[source]
Parameters:
  • draw (xft.Draw) – the xft.Draw object.

  • color (xft.Color) – the color in 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 start of string (in pixels)

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

Renders a PangoGlyphString onto an xft.Draw object wrapping an X drawable.

PangoXft.render_layout(draw, color, layout, x, y)[source]
Parameters:
  • draw (xft.Draw) – an xft.Draw

  • color (xft.Color) – the foreground color in which to draw the layout (may be overridden by color attributes)

  • 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 xft.Draw

New in version 1.8.

PangoXft.render_layout_line(draw, color, line, x, y)[source]
Parameters:
  • draw (xft.Draw) – an xft.Draw

  • color (xft.Color) – the foreground color in which to draw the layout line (may be overridden by color attributes)

  • line (Pango.LayoutLine) – a PangoLayoutLine

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

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

Render a PangoLayoutLine onto a xft.Draw

New in version 1.8.

PangoXft.render_transformed(draw, color, matrix, font, glyphs, x, y)[source]
Parameters:
  • draw (xft.Draw) – an xft.Draw

  • color (xft.Color) – the color in which to draw the glyphs

  • 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 xft.Draw, 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.8.

PangoXft.set_default_substitute(display, screen, func, *data)[source]
Parameters:

Sets a function that will be called to do final configuration substitution on a fontconfig.Pattern before it is used to load the font. This function can be used to do things like set hinting and antialiasing options.

New in version 1.2.

Deprecated since version 1.46: Use PangoFc.FontMap.set_default_substitute() instead.

PangoXft.shutdown_display(display, screen)[source]
Parameters:
  • display (xlib.Display) – an X display

  • screen (int) – the screen number of a screen within display

Release any resources that have been cached for the combination of display and screen. Note that when the X display is closed, resources are released automatically, without needing to call this function.

New in version 1.2.

PangoXft.substitute_changed(display, screen)[source]
Parameters:

Call this function any time the results of the default substitution function set with PangoXft.set_default_substitute() change. That is, if your substitution function will return different results for the same input pattern, you must call this function.

New in version 1.2.

Deprecated since version 1.46: Use PangoFc.FontMap.substitute_changed() instead.