Basics
Guides
API Reference
Basics
Guides
API Reference
[13:7] extends: object
A PangoFont is used to represent a font in a rendering-system-independent
manner.
Font (Handle = null)
Creates a new
Fontby 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.FnDescribe ()
Returns a description of the font, with font size set in points. Use [method@Pango.Font.describe_with_absolute_size] if you want the font size in device units.
describe_with_absolute_size ()
Returns a description of the font, with absolute font size set in device units. Use [method@Pango.Font.describe] if you want the font size in points.
get_coverage (object language)
Computes the coverage map for a given font and language tag.
language is the language tag.get_face ()
Gets the
PangoFontFaceto which @font belongs. Note that this function can returnNULLin cases where the font outlives its font map.
get_font_map ()
Gets the font map for which the font was created. Note that the font maintains a weak reference to the font map, so if all references to font map are dropped, the font map will be finalized even if there are fonts created with the font map that are still alive. In that case this function will return %NULL. It is the responsibility of the user to ensure that the font map is kept alive. In most uses this is not an issue as a
PangoContextholds a reference to the font map.
get_hb_font ()
Get a
hb_font_tobject backing this font. Note that the objects returned by this function are cached and immutable. If you need to make changes to thehb_font_t, use hb_font_create_sub_font().
get_metrics (object language)
Gets overall metric information for a font. Since the metrics may be substantially different for different scripts, a language tag can be provided to indicate that the metrics should be retrieved that correspond to the script(s) used by that language. If @font is %NULL, this function gracefully sets some sane values in the output variables and returns.
language is language tag used to determine which script to get the metrics for, or %NULL to indicate to get the metrics for the entire font..serialize ()
Serializes the @font in a way that can be uniquely identified. There are no guarantees about the format of the output across different versions of Pango. The intended use of this function is testing, benchmarking and debugging. The format is not meant as a permanent storage format. To recreate a font from its serialized form, use [func@Pango.Font.deserialize].

Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.