Class: PangoFc::FontMap
- Inherits:
-
Pango::FontMap
- Object
- Pango::FontMap
- PangoFc::FontMap
- Defined in:
- (unknown)
Direct Known Subclasses
Instance Method Summary collapse
-
#add_decoder_find_func(findfunc, user_data, dnotify) ⇒ nil
This function saves a callback method in the
PangoFcFontMapthat will be called whenever new fonts are created. -
#cache_clear ⇒ nil
Clear all cached information and fontsets for this font map.
-
#config ⇒ fontconfig::Config
Fetches the
FcConfigattached to a font map. -
#config=(fcconfig) ⇒ nil
Set the
FcConfigfor this font map to use. -
#config_changed ⇒ nil
Informs font map that the fontconfig configuration (i.e., FcConfig object) used by this font map has changed.
-
#create_context ⇒ Pango::Context
Creates a new context for this fontmap.
-
#find_decoder(pattern) ⇒ PangoFc::Decoder
Finds the decoder to use for pattern.
-
#get_hb_face(fcfont) ⇒ HarfBuzz::face_t
Retrieves the
hb_face_tfor the givenPangoFcFont. -
#set_default_substitute(func, data, notify) ⇒ nil
Sets a function that will be called to do final configuration substitution on a
FcPatternbefore it is used to load the font. -
#shutdown ⇒ nil
Clears all cached information for the fontmap and marks all fonts open for the fontmap as dead.
-
#substitute_changed ⇒ nil
Call this function any time the results of the default substitution function set with [methodPangoFc.FontMap.set_default_substitute] change.
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.
#cache_clear ⇒ nil
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.
#config ⇒ fontconfig::Config
Fetches the FcConfig attached to a font map.
See also: [methodPangoFc.FontMap.set_config].
#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.
#config_changed ⇒ nil
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.
#create_context ⇒ Pango::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.
#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].
#get_hb_face(fcfont) ⇒ HarfBuzz::face_t
Retrieves the hb_face_t for the given PangoFcFont.
#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.
#shutdown ⇒ nil
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.
#substitute_changed ⇒ nil
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.