Class: PangoFc::FontMap

Inherits:
Pango::FontMap show all
Defined in:
(unknown)

Direct Known Subclasses

PangoFT2::FontMap

Instance Method Summary collapse

Methods inherited from Pango::FontMap

#changed, #get_family, #item_type, #item_type=, #list_families, #load_font, #load_fontset, #n_items, #n_items=, #reload_font, #serial

Instance Method Details

#add_decoder_find_func(findfunc, user_data, dnotify) ⇒ nil

This function saves a callback method in the PangoFcFontMap that will be called whenever new fonts are created.

If the function returns a PangoFcDecoder, that decoder will be used to determine both coverage via a FcCharSet and a one-to-one mapping of characters to glyphs. This will allow applications to have application-specific encodings for various fonts.

Parameters:

  • findfunc (PangoFc::DecoderFindFunc)

    The PangoFcDecoderFindFunc callback function

  • user_data (GObject)

    User data.

  • dnotify (GLib::DestroyNotify)

    A GDestroyNotify callback that will be called when the fontmap is finalized and the decoder is released.

Returns:

  • (nil)

#cache_clearnil

Clear all cached information and fontsets for this font map.

This should be called whenever there is a change in the output of the default_substitute() virtual function of the font map, or if fontconfig has been reinitialized to new configuration.

Returns:

  • (nil)

#configfontconfig::Config

Fetches the FcConfig attached to a font map.

See also: [methodPangoFc.FontMap.set_config].

Returns:

  • (fontconfig::Config)

    the FcConfig object attached to fcfontmap, which might be nil. The return value is owned by Pango and should not be freed.

#config=(fcconfig) ⇒ nil

Set the FcConfig for this font map to use.

The default value is nil, which causes Fontconfig to use its global "current config". You can create a new FcConfig object and use this API to attach it to a font map.

This is particularly useful for example, if you want to use application fonts with Pango. For that, you would create a fresh FcConfig, add your app fonts to it, and attach it to a new Pango font map.

If fcconfig is different from the previous config attached to the font map, [methodPangoFc.FontMap.config_changed] is called.

This function acquires a reference to the FcConfig object; the caller does not need to retain a reference.

Parameters:

  • fcconfig (fontconfig::Config)

    a FcConfig

Returns:

  • (nil)

#config_changednil

Informs font map that the fontconfig configuration (i.e., FcConfig object) used by this font map has changed.

This currently calls [methodPangoFc.FontMap.cache_clear] which ensures that list of fonts, etc will be regenerated using the updated configuration.

Returns:

  • (nil)

#create_contextPango::Context

Creates a new context for this fontmap.

This function is intended only for backend implementations deriving from PangoFcFontMap; it is possible that a backend will store additional information needed for correct operation on the PangoContext after calling this function.

Returns:

#find_decoder(pattern) ⇒ PangoFc::Decoder

Finds the decoder to use for pattern.

Decoders can be added to a font map using [methodPangoFc.FontMap.add_decoder_find_func].

Parameters:

  • pattern (fontconfig::Pattern)

    The FcPattern to find the decoder for.

Returns:

  • (PangoFc::Decoder)

    a newly created PangoFcDecoder object or nil if no decoder is set for pattern.

#get_hb_face(fcfont) ⇒ HarfBuzz::face_t

Retrieves the hb_face_t for the given PangoFcFont.

Parameters:

Returns:

  • (HarfBuzz::face_t)

    the hb_face_t for the given font

#set_default_substitute(func, data, notify) ⇒ nil

Sets a function that will be called to do final configuration substitution on a FcPattern before it is used to load the font.

This function can be used to do things like set hinting and antialiasing options.

Parameters:

  • func (PangoFc::SubstituteFunc)

    function to call to to do final config tweaking on FcPattern objects

  • data (GObject)

    data to pass to func

  • notify (GLib::DestroyNotify)

    function to call when data is no longer used

Returns:

  • (nil)

#shutdownnil

Clears all cached information for the fontmap and marks all fonts open for the fontmap as dead.

See the shutdown() virtual function of PangoFcFont.

This function might be used by a backend when the underlying windowing system for the font map exits. This function is only intended to be called only for backend implementations deriving from PangoFcFontMap.

Returns:

  • (nil)

#substitute_changednil

Call this function any time the results of the default substitution function set with [methodPangoFc.FontMap.set_default_substitute] change.

That is, if your substitution function will return different results for the same input pattern, you must call this function.

Returns:

  • (nil)