Functions ========= .. currentmodule:: gi.repository.PangoXft .. function:: get_font_map(display: ~gi.repository.xlib.Display, screen: int) -> ~gi.repository.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. .. versionadded:: 1.2 :param display: an X display :param screen: the screen number of a screen within ``display`` :return: a ``PangoFontMap`` object, owned by Pango. .. function:: picture_render(display: ~gi.repository.xlib.Display, src_picture: int, dest_picture: int, font: ~gi.repository.Pango.Font, glyphs: ~gi.repository.Pango.GlyphString, x: int, y: int) -> None Renders a ``PangoGlyphString`` onto an Xrender Picture object. :param display: an X display :param src_picture: the source picture to draw the string with :param dest_picture: the destination picture to draw the string onto :param font: the font in which to draw the string :param glyphs: the glyph string to draw :param x: the x position of start of string (in pixels) :param y: the y position of baseline (in pixels) .. function:: render(draw: ~gi.repository.xft.Draw, color: ~gi.repository.xft.Color, font: ~gi.repository.Pango.Font, glyphs: ~gi.repository.Pango.GlyphString, x: int, y: int) -> None Renders a ``PangoGlyphString`` onto an XftDraw object wrapping an X drawable. :param draw: the XftDraw object. :param color: the color in which to draw the string :param font: the font in which to draw the string :param glyphs: the glyph string to draw :param x: the x position of start of string (in pixels) :param y: the y position of baseline (in pixels) .. function:: render_layout(draw: ~gi.repository.xft.Draw, color: ~gi.repository.xft.Color, layout: ~gi.repository.Pango.Layout, x: int, y: int) -> None Render a ``PangoLayout`` onto a XftDraw .. versionadded:: 1.8 :param draw: an XftDraw :param color: the foreground color in which to draw the layout (may be overridden by color attributes) :param layout: a ``PangoLayout`` :param x: the X position of the left of the layout (in Pango units) :param y: the Y position of the top of the layout (in Pango units) .. function:: render_layout_line(draw: ~gi.repository.xft.Draw, color: ~gi.repository.xft.Color, line: ~gi.repository.Pango.LayoutLine, x: int, y: int) -> None Render a ``PangoLayoutLine`` onto a XftDraw .. versionadded:: 1.8 :param draw: an XftDraw :param color: the foreground color in which to draw the layout line (may be overridden by color attributes) :param line: a ``PangoLayoutLine`` :param x: the x position of start of string (in Pango units) :param y: the y position of baseline (in Pango units) .. function:: render_transformed(draw: ~gi.repository.xft.Draw, color: ~gi.repository.xft.Color, matrix: ~gi.repository.Pango.Matrix | None, font: ~gi.repository.Pango.Font, glyphs: ~gi.repository.Pango.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. .. versionadded:: 1.8 :param draw: an XftDraw :param color: the color in which to draw the glyphs :param matrix: a ``PangoMatrix`` :param font: the font in which to draw the string :param glyphs: the glyph string to draw :param x: the x position of the start of the string (in Pango units in user space coordinates) :param y: the y position of the baseline (in Pango units in user space coordinates) .. function:: set_default_substitute(display: ~gi.repository.xlib.Display, screen: int, func: ~typing.Callable[[~gi.repository.fontconfig.Pattern, ~typing.Any], None], data: ~typing.Any = None) -> None Sets a function that will be called to do final configuration substitution on a :obj:`~gi.repository.fontconfig.Pattern` before it is used to load the font. This function can be used to do things like set hinting and antialiasing options. .. versionadded:: 1.2 .. deprecated:: 1.46 Use :func:`~gi.repository.PangoFc.PangoFc.FontMap.set_default_substitute` instead. :param display: an X Display :param screen: the screen number of a screen within ``display`` :param func: function to call to to do final config tweaking on :obj:`~gi.repository.fontconfig.Pattern` objects. :param data: data to pass to ``func`` .. function:: shutdown_display(display: ~gi.repository.xlib.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. .. versionadded:: 1.2 :param display: an X display :param screen: the screen number of a screen within ``display`` .. function:: substitute_changed(display: ~gi.repository.xlib.Display, screen: int) -> None Call this function any time the results of the default substitution function set with :func:`~gi.repository.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. .. versionadded:: 1.2 .. deprecated:: 1.46 Use :func:`~gi.repository.PangoFc.PangoFc.FontMap.substitute_changed` instead. :param display: an X Display :param screen: the screen number of a screen within ``display``