Basics
Guides
API Reference
Basics
Guides
API Reference
[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.
FontMap (Handle = null)
Creates a new
FontMapby wrapping a native handle or another wrapper.
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 exposinghandle(), or null. Returns null when the argument carries no pointer.
Source is the raw handle, raw buffer, wrapper, or null.A raw pointer carrier or null when no pointer is present.getLib ()
Returns the opened native library for this generated wrapper.
The opened native library.handle ()
Returns the wrapped NativeHandle.
The wrapped NativeHandle.isNull ()
Returns true when the wrapped handle is null.
A bool.describe ()
Returns a small string for debugging generated wrappers.
A string.asObject ()
Wraps this handle as
Object.
A Object object.asListModel ()
Wraps this handle as
ListModel.
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.
filename is Path to the font file.changed ()
Forces a change in the fontmap, which will cause any
PangoContextusing 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.
None.create_context ()
Creates a
PangoContextconnected 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 aPangoContext. 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.
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 inPangoContext.
load_font (object context, object desc)
Load the font in the fontmap that is the closest match for @desc.
context is the PangoContext the font will be used with.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.
context is the PangoContext the font will be used with.desc is a PangoFontDescription describing the font to load.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
its backend-dependent configuration (e.g. cairo font options) is replaced by the one in @context, and its variations are replaced byNote 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.font is a font in @fontmap.scale is the scale factor to apply.context is a PangoContext.variations is font variations to use.[224:14] static extends: object
Generated metadata helpers for FontMap class surfaces.
properties ()
Returns property metadata for
FontMap.
A list.
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.