Functions

get_font_map(display: Display, screen: int) 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.

Added in version 1.2.

Parameters:
  • display – an X display

  • screen – the screen number of a screen within display

Returns:

a PangoFontMap object, owned by Pango.

picture_render(display: Display, src_picture: int, dest_picture: int, font: Font, glyphs: GlyphString, x: int, y: int) None

Renders a PangoGlyphString onto an Xrender Picture object.

Parameters:
  • display – an X display

  • src_picture – the source picture to draw the string with

  • dest_picture – the destination picture to draw the string onto

  • font – the font in which to draw the string

  • glyphs – the glyph string to draw

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

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

render(draw: Draw, color: Color, font: Font, glyphs: GlyphString, x: int, y: int) None

Renders a PangoGlyphString onto an XftDraw object wrapping an X drawable.

Parameters:
  • draw – the XftDraw object.

  • color – the color in which to draw the string

  • font – the font in which to draw the string

  • glyphs – the glyph string to draw

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

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

render_layout(draw: Draw, color: Color, layout: Layout, x: int, y: int) None

Render a PangoLayout onto a XftDraw

Added in version 1.8.

Parameters:
  • draw – an XftDraw

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

  • layout – a PangoLayout

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

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

render_layout_line(draw: Draw, color: Color, line: LayoutLine, x: int, y: int) None

Render a PangoLayoutLine onto a XftDraw

Added in version 1.8.

Parameters:
  • draw – an XftDraw

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

  • line – a PangoLayoutLine

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

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

render_transformed(draw: Draw, color: Color, matrix: Matrix | None, font: Font, glyphs: GlyphString, x: int, y: int) None

Renders a PangoGlyphString onto a XftDraw, 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.

Added in version 1.8.

Parameters:
  • draw – an XftDraw

  • color – the color in which to draw the glyphs

  • matrix – a PangoMatrix

  • font – the font in which to draw the string

  • glyphs – the glyph string to draw

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

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

set_default_substitute(display: Display, screen: int, func: Callable[[...], None], *data: Any) None

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

Added in version 1.2.

Deprecated since version 1.46: Use set_default_substitute() instead.

Parameters:
  • display – an X Display

  • screen – the screen number of a screen within display

  • func – function to call to to do final config tweaking on Pattern objects.

  • data – data to pass to func

shutdown_display(display: Display, screen: int) None

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.

Added in version 1.2.

Parameters:
  • display – an X display

  • screen – the screen number of a screen within display

substitute_changed(display: Display, screen: int) None

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

Added in version 1.2.

Deprecated since version 1.46: Use substitute_changed() instead.

Parameters:
  • display – an X Display

  • screen – the screen number of a screen within display