Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: FontMap

[15:7] extends: object

PangoCairoFontMap is an interface exported by font maps for use with Cairo. The actual type of the font map will depend on the particular font technology Cairo was compiled to use.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • FontMap (Handle = null)

    Creates a new FontMap by wrapping a native handle or another wrapper.

    • @p Handle is the native handle or another wrapper whose handle to adopt.
  • toNativeHandle (Source)

    Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from fn.call(...), another generated wrapper exposing handle(), or null. Returns null when the argument carries no pointer.

    • @p Source is the raw handle, raw buffer, wrapper, or null.
    • @r A raw pointer carrier or null when no pointer is present.
  • getLib ()

    Returns the opened native library for this generated wrapper.

    • @r The opened native library.
  • handle ()

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • create_context ()

    Create a PangoContext for the given fontmap.

  • get_font_type ()

    Gets the type of Cairo font backend that @fontmap uses.

  • get_resolution ()

    Gets the resolution for the fontmap. See [method@PangoCairo.FontMap.set_resolution].

  • set_default ()

    Sets a default PangoCairoFontMap to use with Cairo. This can be used to change the Cairo font backend that the default fontmap uses for example. The old default font map is unreffed and the new font map referenced. Note that since Pango 1.32.6, the default fontmap is per-thread. This function only changes the default fontmap for the current thread. Default fontmaps of existing threads are not changed. Default fontmaps of any new threads will still be created using [func@PangoCairo.FontMap.new]. A value of %NULL for @fontmap will cause the current default font map to be released and a new default font map to be created on demand, using [func@PangoCairo.FontMap.new].

    • @r None.
  • set_resolution (double dpi)

    Sets the resolution for the fontmap. This is a scale factor between points specified in a PangoFontDescription and Cairo units. The default value is 96, meaning that a 10 point font will be 13 units high. (10 * 96. / 72. = 13.3).

    • @p dpi is the resolution in "dots per inch". (Physical inches aren't actually involved; the terminology is conventional.).
    • @r None.