PangoFc.Decoder

g GObject.Object GObject.Object PangoFc.Decoder PangoFc.Decoder GObject.Object->PangoFc.Decoder

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

get_charset (fcfont)

get_glyph (fcfont, wc)

Virtual Methods

Inherited:

GObject.Object (7)

do_get_charset (fcfont)

do_get_glyph (fcfont, wc)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class PangoFc.Decoder(**kwargs)
Bases:

GObject.Object

Abstract:

Yes

Structure:

PangoFc.DecoderClass

PangoFcDecoder is a virtual base class that implementations will inherit from.

It’s the interface that is used to define a custom encoding for a font. These objects are created in your code from a function callback that was originally registered with [method`PangoFc`.FontMap.add_decoder_find_func]. Pango requires information about the supported charset for a font as well as the individual character to glyph conversions. Pango gets that information via the #get_charset and #get_glyph callbacks into your object implementation.

New in version 1.6.

get_charset(fcfont)
Parameters:

fcfont (PangoFc.Font) – the PangoFcFont to query.

Returns:

the FcCharset for fcfont; must not be modified or freed.

Return type:

fontconfig.CharSet

Generates an FcCharSet of supported characters for the fcfont given.

The returned FcCharSet will be a reference to an internal value stored by the PangoFcDecoder and must not be modified or freed.

New in version 1.6.

get_glyph(fcfont, wc)
Parameters:
  • fcfont (PangoFc.Font) – a PangoFcFont to query.

  • wc (int) – the Unicode code point to convert to a single PangoGlyph.

Returns:

the glyph index, or 0 if the glyph isn’t covered by the font.

Return type:

int

Generates a PangoGlyph for the given Unicode point using the custom decoder.

For complex scripts where there can be multiple glyphs for a single character, the decoder will return whatever glyph is most convenient for it. (Usually whatever glyph is directly in the fonts character map table.)

New in version 1.6.

do_get_charset(fcfont) virtual
Parameters:

fcfont (PangoFc.Font) – the PangoFcFont to query.

Returns:

the FcCharset for fcfont; must not be modified or freed.

Return type:

fontconfig.CharSet

Generates an FcCharSet of supported characters for the fcfont given.

The returned FcCharSet will be a reference to an internal value stored by the PangoFcDecoder and must not be modified or freed.

New in version 1.6.

do_get_glyph(fcfont, wc) virtual
Parameters:
  • fcfont (PangoFc.Font) – a PangoFcFont to query.

  • wc (int) – the Unicode code point to convert to a single PangoGlyph.

Returns:

the glyph index, or 0 if the glyph isn’t covered by the font.

Return type:

int

Generates a PangoGlyph for the given Unicode point using the custom decoder.

For complex scripts where there can be multiple glyphs for a single character, the decoder will return whatever glyph is most convenient for it. (Usually whatever glyph is directly in the fonts character map table.)

New in version 1.6.