Functions#
- get_font_map(display: Display, screen: int) FontMap#
Returns the
PangoXftFontMapfor 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
PangoFontMapobject, owned by Pango.
- picture_render(display: Display, src_picture: int, dest_picture: int, font: Font, glyphs: GlyphString, x: int, y: int) None#
Renders a
PangoGlyphStringonto 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
PangoGlyphStringonto 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
PangoLayoutonto a XftDrawAdded 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
PangoLayoutx – 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
PangoLayoutLineonto a XftDrawAdded 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
PangoLayoutLinex – 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
PangoGlyphStringonto a XftDraw, possibly transforming the layed-out coordinates through a transformation matrix.Note that the transformation matrix for
fontis not changed, so to produce correct rendering results, thefontmust have been loaded using aPangoContextwith 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
PangoMatrixfont – 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[[Pattern, Any], None], data: Any = None) None#
Sets a function that will be called to do final configuration substitution on a
Patternbefore 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
displayfunc – function to call to to do final config tweaking on
Patternobjects.data – data to pass to
func
- shutdown_display(display: Display, screen: int) None#
Release any resources that have been cached for the combination of
displayandscreen. 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