Functions#
- font_get_coverage(font: Font, language: Language) Coverage#
Gets the
PangoCoveragefor aPangoFT2Font.Use
get_coverageinstead.- Parameters:
font – a Pango FT2 font
language – a language tag.
- Returns:
a
PangoCoverage
- font_get_kerning(font: Font, left: int, right: int) int#
Retrieves kerning information for a combination of two glyphs.
Use
kern_glyphs()instead.- Parameters:
font – a
PangoFontleft – the left
PangoGlyphright – the right
PangoGlyph
- Returns:
The amount of kerning (in Pango units) to apply for the given combination of glyphs.
- get_unknown_glyph(font: 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
GET_UNKNOWN_GLYPH()instead.- Parameters:
font – a
PangoFont- Returns:
a glyph index into
font, or %PANGO_GLYPH_EMPTY
- render(bitmap: Bitmap, font: Font, glyphs: GlyphString, x: int, y: int) None#
Renders a
PangoGlyphStringonto a FreeType2 bitmap.- Parameters:
bitmap – the FreeType2 bitmap onto 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 the start of the string (in pixels)
y – the y position of the baseline (in pixels)
- render_layout(bitmap: Bitmap, layout: Layout, x: int, y: int) None#
Render a
PangoLayoutonto a FreeType2 bitmap- Parameters:
bitmap – a FT_Bitmap to render the layout onto
layout – a
PangoLayoutx – the X position of the left of the layout (in pixels)
y – the Y position of the top of the layout (in pixels)
- render_layout_line(bitmap: Bitmap, line: LayoutLine, x: int, y: int) None#
Render a
PangoLayoutLineonto a FreeType2 bitmap- Parameters:
bitmap – a FT_Bitmap to render the line onto
line – a
PangoLayoutLinex – the x position of start of string (in pixels)
y – the y position of baseline (in pixels)
- render_layout_line_subpixel(bitmap: Bitmap, line: LayoutLine, x: int, y: int) None#
Render a
PangoLayoutLineonto 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.)
Added in version 1.6.
- Parameters:
bitmap – a FT_Bitmap to render the line onto
line – a
PangoLayoutLinex – the x position of start of string (in Pango units)
y – the y position of baseline (in Pango units)
- render_layout_subpixel(bitmap: Bitmap, layout: Layout, x: int, y: int) None#
Render a
PangoLayoutonto 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.)
Added in version 1.6.
- Parameters:
bitmap – a FT_Bitmap to render the layout onto
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_transformed(bitmap: Bitmap, matrix: Matrix | None, font: Font, glyphs: GlyphString, x: int, y: int) None#
Renders a
PangoGlyphStringonto a FreeType2 bitmap, 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.6.
- Parameters:
bitmap – the FreeType2 bitmap onto which to draw the string
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)