Functions ========= .. currentmodule:: gi.repository.PangoFT2 .. function:: font_get_coverage(font: ~gi.repository.Pango.Font, language: ~gi.repository.Pango.Language) -> ~gi.repository.Pango.Coverage Gets the ``PangoCoverage`` for a ``PangoFT2Font``\. Use :obj:`~gi.repository.Pango.Font.get_coverage` instead. :param font: a Pango FT2 font :param language: a language tag. :return: a ``PangoCoverage`` .. function:: font_get_kerning(font: ~gi.repository.Pango.Font, left: int, right: int) -> int Retrieves kerning information for a combination of two glyphs. Use :func:`~gi.repository.PangoFc.Font.kern_glyphs` instead. :param font: a ``PangoFont`` :param left: the left ``PangoGlyph`` :param right: the right ``PangoGlyph`` :return: The amount of kerning (in Pango units) to apply for the given combination of glyphs. .. function:: get_unknown_glyph(font: ~gi.repository.Pango.Font) -> 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 :func:`~gi.repository.Pango.GET_UNKNOWN_GLYPH` instead. :param font: a ``PangoFont`` :return: a glyph index into ``font``\, or %PANGO_GLYPH_EMPTY .. function:: render(bitmap: ~gi.repository.freetype2.Bitmap, font: ~gi.repository.Pango.Font, glyphs: ~gi.repository.Pango.GlyphString, x: int, y: int) -> None Renders a ``PangoGlyphString`` onto a FreeType2 bitmap. :param bitmap: the FreeType2 bitmap onto 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 the start of the string (in pixels) :param y: the y position of the baseline (in pixels) .. function:: render_layout(bitmap: ~gi.repository.freetype2.Bitmap, layout: ~gi.repository.Pango.Layout, x: int, y: int) -> None Render a ``PangoLayout`` onto a FreeType2 bitmap :param bitmap: a FT_Bitmap to render the layout onto :param layout: a ``PangoLayout`` :param x: the X position of the left of the layout (in pixels) :param y: the Y position of the top of the layout (in pixels) .. function:: render_layout_line(bitmap: ~gi.repository.freetype2.Bitmap, line: ~gi.repository.Pango.LayoutLine, x: int, y: int) -> None Render a ``PangoLayoutLine`` onto a FreeType2 bitmap :param bitmap: a FT_Bitmap to render the line onto :param line: a ``PangoLayoutLine`` :param x: the x position of start of string (in pixels) :param y: the y position of baseline (in pixels) .. function:: render_layout_line_subpixel(bitmap: ~gi.repository.freetype2.Bitmap, line: ~gi.repository.Pango.LayoutLine, x: int, y: int) -> None Render a ``PangoLayoutLine`` 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.) .. versionadded:: 1.6 :param bitmap: a FT_Bitmap to render the line onto :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_layout_subpixel(bitmap: ~gi.repository.freetype2.Bitmap, layout: ~gi.repository.Pango.Layout, x: int, y: int) -> None Render a ``PangoLayout`` 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.) .. versionadded:: 1.6 :param bitmap: a FT_Bitmap to render the layout onto :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_transformed(bitmap: ~gi.repository.freetype2.Bitmap, 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 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 ``PangoContext`` with an identical transformation matrix to that passed in to this function. .. versionadded:: 1.6 :param bitmap: the FreeType2 bitmap onto which to draw the string :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:: shutdown_display() -> None Free the global fontmap. (See :func:`~gi.repository.PangoFT2.FontMap.for_display`) Use of the global PangoFT2 fontmap is deprecated.