Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: FontMap

[14:7] extends: object

A PangoFontMap represents the set of fonts available for a particular rendering system. This is a virtual object with implementations being specific to particular rendering systems.

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.
  • asObject ()

    Wraps this handle as Object.

    • @r A Object object.
  • asListModel ()

    Wraps this handle as ListModel.

    • @r A ListModel object.
  • add_font_file (string filename)

    Loads a font file with one or more fonts into the PangoFontMap. The added fonts will take precedence over preexisting fonts with the same name.

    • @p filename is Path to the font file.
  • changed ()

    Forces a change in the fontmap, which will cause any PangoContext using this fontmap to change. This function is only useful when implementing a new backend for Pango, something applications won't do. Backends should call this function if they have attached extra data to the fontmap and such data is changed.

    • @r None.
  • create_context ()

    Creates a PangoContext connected to @fontmap. This is equivalent to [ctor@Pango.Context.new] followed by [method@Pango.Context.set_font_map]. If you are using Pango as part of a higher-level system, that system may have it's own way of create a PangoContext. For instance, the GTK toolkit has, among others, gtk_widget_get_pango_context(). Use those instead.

  • get_family (string name)

    Gets a font family by name.

    • @p name is a family name.
  • get_serial ()

    Returns the current serial number of @fontmap. The serial number is initialized to an small number larger than zero when a new fontmap is created and is increased whenever the fontmap is changed. It may wrap, but will never have the value 0. Since it can wrap, never compare it with "less than", always use "not equals". The fontmap can only be changed using backend-specific API, like changing fontmap resolution. This can be used to automatically detect changes to a PangoFontMap, like in PangoContext.

  • load_font (object context, object desc)

    Load the font in the fontmap that is the closest match for @desc.

    • @p context is the PangoContext the font will be used with.
    • @p desc is a PangoFontDescription describing the font to load.
  • load_fontset (object context, object desc, object language)

    Load a set of fonts in the fontmap that can be used to render a font matching @desc.

    • @p context is the PangoContext the font will be used with.
    • @p desc is a PangoFontDescription describing the font to load.
    • @p language is a PangoLanguage the fonts will be used for.
  • reload_font (object font, double scale, object context, string variations)

    Returns a new font that is like @font, except that it is scaled by

    • @scale, its backend-dependent configuration (e.g. cairo font options) is replaced by the one in @context, and its variations are replaced by
    • @variations. Note that the scaling here is meant to be linear, so this scaling can be used to render a font on a hi-dpi display without changing its optical size.
    • @p font is a font in @fontmap.
    • @p scale is the scale factor to apply.
    • @p context is a PangoContext.
    • @p variations is font variations to use.

class: FontMapMeta

[224:14] static extends: object

Generated metadata helpers for FontMap class surfaces.

Methods

  • properties ()

    Returns property metadata for FontMap.

    • @r A list.