Font#
PangoFcFont is a base class for font implementations
using the Fontconfig and FreeType libraries.
It is used in onjunction with FontMap.
When deriving from this class, you need to implement all
of its virtual functions other than shutdown() along with
the get_glyph_extents() virtual function from PangoFont.
Methods#
- class Font
- classmethod description_from_pattern(include_size: bool) FontDescription#
Creates a
PangoFontDescriptionthat matches the specified Fontconfig pattern as closely as possible.Many possible Fontconfig pattern values, such as %FC_RASTERIZER or %FC_DPI, don’t make sense in the context of
PangoFontDescription, so will be ignored.Added in version 1.4.
- Parameters:
include_size – if
True, the pattern will include the size from thepattern; otherwise the resulting pattern will be unsized. (only %FC_SIZE is examined, not %FC_PIXEL_SIZE)
- get_glyph(wc: str) int#
Gets the glyph index for a given Unicode character for
font.If you only want to determine whether the font has the glyph, use
has_char.Added in version 1.4.
- Parameters:
wc – Unicode character to look up
- get_languages() list[Language] | None#
Returns the languages that are supported by
font.This corresponds to the FC_LANG member of the FcPattern.
The returned array is only valid as long as the font and its fontmap are valid.
Added in version 1.48.
Deprecated since version 1.50: Use pango_font_get_language()
- get_unknown_glyph(wc: str) int#
Returns the index of a glyph suitable for drawing
wcas an unknown character.Use
GET_UNKNOWN_GLYPH()instead.Added in version 1.4.
- Parameters:
wc – the Unicode character for which a glyph is needed.
- has_char(wc: str) bool#
Determines whether
fonthas a glyph for the codepointwc.Added in version 1.4.
Deprecated since version 1.44: Use
has_char- Parameters:
wc – Unicode codepoint to look up
- kern_glyphs(glyphs: GlyphString) None#
This function used to adjust each adjacent pair of glyphs in
glyphsaccording to kerning information infont.Since 1.44, it does nothing.
Added in version 1.4.
Deprecated since version 1.32: Please do not use it in newly written code
- Parameters:
glyphs – a
PangoGlyphString