PangoFc.Font

g GObject.Object GObject.Object Pango.Font Pango.Font GObject.Object->Pango.Font PangoFc.Font PangoFc.Font Pango.Font->PangoFc.Font

Subclasses:

None

Methods

Inherited:

Pango.Font (13), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

description_from_pattern (pattern, include_size)

get_glyph (wc)

get_languages ()

get_unknown_glyph (wc)

has_char (wc)

kern_glyphs (glyphs)

unlock_face ()

Virtual Methods

Inherited:

Pango.Font (8), GObject.Object (7)

Properties

Name

Type

Flags

Short Description

fontmap

PangoFc.FontMap

r/w

The PangoFc font map this font is associated with (Since: 1.26)

pattern

int

r/w/co

The fontconfig pattern for this font

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

description

Pango.FontDescription

r

font_pattern

fontconfig.Pattern

r

fontmap

Pango.FontMap

r

is_hinted

int

r

is_transformed

int

r

matrix

Pango.Matrix

r

metrics_by_lang

[object]

r

parent_instance

Pango.Font

r

priv

object

r

Class Details

class PangoFc.Font(**kwargs)
Bases:

Pango.Font

Abstract:

Yes

Structure:

PangoFc.FontClass

PangoFcFont is a base class for font implementations using the Fontconfig and FreeType libraries.

It is used in onjunction with [class`PangoFc`.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.

classmethod description_from_pattern(pattern, include_size)
Parameters:
  • pattern (fontconfig.Pattern) – a FcPattern

  • include_size (bool) – if True, the pattern will include the size from the pattern; otherwise the resulting pattern will be unsized. (only %FC_SIZE is examined, not %FC_PIXEL_SIZE)

Returns:

a new PangoFontDescription. Free with Pango.FontDescription.free().

Return type:

Pango.FontDescription

Creates a PangoFontDescription that 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.

New in version 1.4.

get_glyph(wc)
Parameters:

wc (str) – Unicode character to look up

Returns:

the glyph index, or 0, if the Unicode character doesn’t exist in the font.

Return type:

int

Gets the glyph index for a given Unicode character for self.

If you only want to determine whether the font has the glyph, use [method`PangoFc`.Font.has_char].

New in version 1.4.

get_languages()
Returns:

a None-terminated array of PangoLanguage *

Return type:

[Pango.Language] or None

Returns the languages that are supported by self.

This corresponds to the FC_LANG member of the fontconfig.Pattern.

The returned array is only valid as long as the font and its fontmap are valid.

New in version 1.48.

Deprecated since version 1.50: Use pango_font_get_language()

get_unknown_glyph(wc)
Parameters:

wc (str) – the Unicode character for which a glyph is needed.

Returns:

a glyph index into self.

Return type:

int

Returns the index of a glyph suitable for drawing wc as an unknown character.

Use PANGO_GET_UNKNOWN_GLYPH() instead.

New in version 1.4.

has_char(wc)
Parameters:

wc (str) – Unicode codepoint to look up

Returns:

True if self has the requested codepoint.

Return type:

bool

Determines whether self has a glyph for the codepoint wc.

New in version 1.4.

Deprecated since version 1.44: Use [method`Pango`.Font.has_char]

kern_glyphs(glyphs)
Parameters:

glyphs (Pango.GlyphString) – a PangoGlyphString

This function used to adjust each adjacent pair of glyphs in glyphs according to kerning information in self.

Since 1.44, it does nothing.

New in version 1.4.

Deprecated since version 1.32.

unlock_face()

Releases a font previously obtained with [method`PangoFc`.Font.lock_face].

New in version 1.4.

Deprecated since version 1.44: Use pango_font_get_hb_font() instead

Property Details

PangoFc.Font.props.fontmap
Name:

fontmap

Type:

PangoFc.FontMap

Default Value:

None

Flags:

READABLE, WRITABLE

The PangoFc font map this font is associated with.

PangoFc.Font.props.pattern
Name:

pattern

Type:

int

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The fontconfig pattern for this font.