Class: PangoFT2::FontMap

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

Overview

The PangoFT2FontMap is the PangoFontMap implementation for FreeType fonts.

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from PangoFc::FontMap

#add_decoder_find_func, #cache_clear, #config, #config=, #config_changed, #find_decoder, #get_hb_face, #shutdown

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

Constructor Details

#initializePango::FontMap

Create a new PangoFT2FontMap object.

A fontmap is used to cache information about available fonts, and holds certain global parameters such as the resolution and the default substitute function (see [methodPangoFT2.FontMap.set_default_substitute]). with g_object_unref() when you are finished with it.

Class Method Details

.for_displayPango::FontMap

Returns a PangoFT2FontMap.

This font map is cached and should not be freed. If the font map is no longer needed, it can be released with pango_ft2_shutdown_display(). Use of the global PangoFT2 fontmap is deprecated; use pango_ft2_font_map_new() instead.

Returns:

Instance Method Details

#create_contextPango::Context

Create a PangoContext for the given fontmap.

Returns:

  • (Pango::Context)

    the newly created context; free with g_object_unref().

#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 (PangoFT2::SubstituteFunc)

    function to call to to do final config tweaking on Fc::Pattern objects.

  • data (GObject)

    data to pass to func

  • notify (GLib::DestroyNotify)

    function to call when data is no longer used.

Returns:

  • (nil)

#set_resolution(dpi_x, dpi_y) ⇒ nil

Sets the horizontal and vertical resolutions for the fontmap.

Parameters:

  • dpi_x (Float)

    dots per inch in the X direction

  • dpi_y (Float)

    dots per inch in the Y direction

Returns:

  • (nil)

#substitute_changednil

Call this function any time the results of the default substitution function set with pango_ft2_font_map_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)