[17:7] extends: object
A PangoFontDescription describes a font in an implementation-independent
manner. PangoFontDescription structures are used both to list what fonts
are available on the system and also for specifying the characteristics of a
font to load.
PangoFontDescription (Handle = null)
Creates a new font description structure with all fields unset.
Handle is an optional native handle or wrapper whose handle to adopt; when the native constructor is called.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.better_match (object old_match, object new_match)
Determines if the style attributes of @new_match are a closer match for
than those of @old_match are, or if @old_match is %NULL, determines if @new_match is a match at all. Approximate matching is done for weight and style; other style attributes must match exactly. Style attributes are all attributes other than family and size-related attributes. Approximate matching for style considers %PANGO_STYLE_OBLIQUE and %PANGO_STYLE_ITALIC as matches, but not as good a match as when the styles are equal. Note that @old_match must match @desc.old_match is a PangoFontDescription, or %NULL.new_match is a PangoFontDescription.%TRUE if @new_match is a better match.copy ()
Make a copy of a
PangoFontDescription.
the newly allocated PangoFontDescription, which should be freed with [method@Pango.FontDescription.free], or %NULL if @desc was %NULL..copy_static ()
Make a copy of a
PangoFontDescription, but don't duplicate allocated fields. This is like [method@Pango.FontDescription.copy], but only a shallow copy is made of the family name and other allocated fields. The result can only be used until @desc is modified or freed. This is meant to be used when the copy is only needed temporarily.
the newly allocated PangoFontDescription, which should be freed with [method@Pango.FontDescription.free], or %NULL if @desc was %NULL..equal (object desc2)
Compares two font descriptions for equality. Two font descriptions are considered equal if the fonts they describe are provably identical. This means that their masks do not have to match, as long as other fields are all the same. (Two font descriptions may result in identical fonts being loaded, but still compare %FALSE.)
desc2 is another PangoFontDescription.%TRUE if the two font descriptions are identical, %FALSE otherwise..free ()
Frees a font description.
None.get_color ()
Returns the color field of the font description. This field determines whether the font description should match fonts that have color glyphs, or fonts that don't.
get_family ()
Gets the family name field of a font description. See [method@Pango.FontDescription.set_family].
the family name field for the font description, or %NULL if not previously set. This has the same life-time as the font description itself and should not be freed..get_features ()
Gets the features field of a font description. See [method@Pango.FontDescription.set_features].
the features field for the font description, or %NULL if not previously set. This has the same life-time as the font description itself and should not be freed..get_gravity ()
Gets the gravity field of a font description. See [method@Pango.FontDescription.set_gravity].
the gravity field for the font description. Use [method@Pango.FontDescription.get_set_fields] to find out if the field was explicitly set or not..get_set_fields ()
Determines which fields in a font description have been set.
a bitmask with bits set corresponding to the fields in @desc that have been set..get_size ()
Gets the size field of a font description. See [method@Pango.FontDescription.set_size].
the size field for the font description in points or device units. You must call [method@Pango.FontDescription.get_size_is_absolute] to find out which is the case. Returns 0 if the size field has not previously been set or it has been set to 0 explicitly. Use [method@Pango.FontDescription.get_set_fields] to find out if the field was explicitly set or not..get_size_is_absolute ()
Determines whether the size of the font is in points (not absolute) or device units (absolute). See [method@Pango.FontDescription.set_size] and [method@Pango.FontDescription.set_absolute_size].
whether the size for the font description is in points or device units. Use [method@Pango.FontDescription.get_set_fields] to find out if the size field of the font description was explicitly set or not..get_stretch ()
Gets the stretch field of a font description. See [method@Pango.FontDescription.set_stretch].
the stretch field for the font description. Use [method@Pango.FontDescription.get_set_fields] to find out if the field was explicitly set or not..get_style ()
Gets the style field of a
PangoFontDescription. See [method@Pango.FontDescription.set_style].
the style field for the font description. Use [method@Pango.FontDescription.get_set_fields] to find out if the field was explicitly set or not..get_variant ()
Gets the variant field of a
PangoFontDescription. See [method@Pango.FontDescription.set_variant].
the variant field for the font description. Use [method@Pango.FontDescription.get_set_fields] to find out if the field was explicitly set or not..get_variations ()
Gets the variations field of a font description. See [method@Pango.FontDescription.set_variations].
the variations field for the font description, or %NULL if not previously set. This has the same life-time as the font description itself and should not be freed..get_weight ()
Gets the weight field of a font description. See [method@Pango.FontDescription.set_weight].
the weight field for the font description. Use [method@Pango.FontDescription.get_set_fields] to find out if the field was explicitly set or not..hash ()
Computes a hash of a
PangoFontDescriptionstructure. This is suitable to be used, for example, as an argument to g_hash_table_new(). The hash value is independent of @desc->mask.
the hash value..merge (object desc_to_merge, bool replace_existing)
Merges the fields that are set in @desc_to_merge into the fields in
If @replace_existing is %FALSE, only fields in @desc that are not already set are affected. If %TRUE, then fields that are already set will be replaced as well. If @desc_to_merge is %NULL, this function performs nothing.desc_to_merge is the PangoFontDescription to merge from, or %NULL.replace_existing is if %TRUE, replace fields in @desc with the corresponding values from @desc_to_merge, even if they are already exist..None.merge_static (object desc_to_merge, bool replace_existing)
Merges the fields that are set in @desc_to_merge into the fields in
without copying allocated fields. This is like [method@Pango.FontDescription.merge], but only a shallow copy is made of the family name and other allocated fields. @desc can only be used untilis modified or freed. This is meant to be used when the merged font description is only needed temporarily.desc_to_merge is the PangoFontDescription to merge from.replace_existing is if %TRUE, replace fields in @desc with the corresponding values from @desc_to_merge, even if they are already exist..None.set_absolute_size (double size)
Sets the size field of a font description, in device units. This is mutually exclusive with [method@Pango.FontDescription.set_size] which sets the font size in points.
size is the new size, in Pango units. There are %PANGO_SCALE Pango units in one device unit. For an output backend where a device unit is a pixel, a @size value of 10 * PANGO_SCALE gives a 10 pixel font..None.set_color (string color)
Sets the color field of a font description. This field determines whether the font description should match fonts that have color glyphs, or fonts that don't.
color is the PangoFontColor value.None.set_family (string family)
Sets the family name field of a font description. The family name represents a family of related font styles, and will resolve to a particular
PangoFontFamily. In some uses ofPangoFontDescription, it is also possible to use a comma separated list of family names for this field.
family is a string representing the family name..None.set_family_static (string family)
Sets the family name field of a font description, without copying the string. This is like [method@Pango.FontDescription.set_family], except that no copy of @family is made. The caller must make sure that the string passed in stays around until @desc has been freed or the name is set again. This function can be used if @family is a static string such as a C string literal, or if @desc is only needed temporarily.
family is a string representing the family name.None.set_features (string features)
Sets the features field of a font description. OpenType font features allow to enable or disable certain optional features of a font, such as tabular numbers. The format of the features string is comma-separated list of feature assignments, with each assignment being one of these forms: FEATURE=n where FEATURE must be a 4 character tag that identifies and OpenType feature, and n an integer (depending on the feature, the allowed values may be 0, 1 or bigger numbers). Unknown features are ignored. Note that font features set in this way are enabled for the entire text that is using the font, which is not appropriate for all OpenType features. The intended use case is to select character variations (features cv01 - c99), style sets (ss01 - ss20) and the like. Pango does not currently have a way to find supported OpenType features of a font. Both harfbuzz and freetype have API for this. See for example hb_ot_layout_table_get_feature_tags. Features that are not supported by the font are silently ignored.
features is a string representing the features.None.set_features_static (string features)
Sets the features field of a font description. This is like [method@Pango.FontDescription.set_features], except that no copy of
made. The caller must make sure that the string passed in stays around until @desc has been freed or the name is set again. This function can be used if @features is a static string such as a C string literal, or if @desc is only needed temporarily.features is a string representing the features.None.set_gravity (string gravity)
Sets the gravity field of a font description. The gravity field specifies how the glyphs should be rotated. If @gravity is %PANGO_GRAVITY_AUTO, this actually unsets the gravity mask on the font description. This function is seldom useful to the user. Gravity should normally be set on a
PangoContext.
gravity is the gravity for the font description..None.set_size (int size)
Sets the size field of a font description in fractional points. This is mutually exclusive with [method@Pango.FontDescription.set_absolute_size].
size is the size of the font in points, scaled by %PANGO_SCALE. (That is, a @size value of 10 * PANGO_SCALE is a 10 point font. The conversion factor between points and device units depends on system configuration and the output device. For screen display, a logical DPI of 96 is common, in which case a 10 point font corresponds to a 10 * (96 / 72) = 13.3 pixel font. Use [method@Pango.FontDescription.set_absolute_size] if you need a particular size in device units..None.set_stretch (string stretch)
Sets the stretch field of a font description. The [enum@Pango.Stretch] field specifies how narrow or wide the font should be.
stretch is the stretch for the font description.None.set_style (string style)
Sets the style field of a
PangoFontDescription. The [enum@Pango.Style] enumeration describes whether the font is slanted and the manner in which it is slanted; it can be either %PANGO_STYLE_NORMAL, %PANGO_STYLE_ITALIC, or %PANGO_STYLE_OBLIQUE. Most fonts will either have a italic style or an oblique style, but not both, and font matching in Pango will match italic specifications with oblique fonts and vice-versa if an exact match is not found.
style is the style for the font description.None.set_variant (string variant)
Sets the variant field of a font description. The [enum@Pango.Variant] can either be %PANGO_VARIANT_NORMAL or %PANGO_VARIANT_SMALL_CAPS.
variant is the variant type for the font description..None.set_variations (string variations)
Sets the variations field of a font description. OpenType font variations allow to select a font instance by specifying values for a number of axes, such as width or weight. The format of the variations string is AXIS1=VALUE,AXIS2=VALUE... with each AXIS a 4 character tag that identifies a font axis, and each VALUE a floating point number. Unknown axes are ignored, and values are clamped to their allowed range. Pango does not currently have a way to find supported axes of a font. Both harfbuzz and freetype have API for this. See for example hb_ot_var_get_axis_infos.
variations is a string representing the variations.None.set_variations_static (string variations)
Sets the variations field of a font description. This is like [method@Pango.FontDescription.set_variations], except that no copy of
is made. The caller must make sure that the string passed in stays around until @desc has been freed or the name is set again. This function can be used if @variations is a static string such as a C string literal, or if @desc is only needed temporarily.variations is a string representing the variations.None.set_weight (string weight)
Sets the weight field of a font description. The weight field specifies how bold or light the font should be. In addition to the values of the [enum@Pango.Weight] enumeration, other intermediate numeric values are possible.
weight is the weight for the font description..None.to_filename ()
Creates a filename representation of a font description. The filename is identical to the result from calling [method@Pango.FontDescription.to_string], but with underscores instead of characters that are untypical in filenames, and in lower case only.
a new string that must be freed with g_free()..to_string ()
Creates a string representation of a font description. See [func@Pango.FontDescription.from_string] for a description of the format of the string representation. The family list in the string description will only have a terminating comma if the last word of the list is a valid style option.
a new string that must be freed with g_free()..unset_fields (string to_unset)
Unsets some of the fields in a
PangoFontDescription. The unset fields will get back to their default values.
to_unset is bitmask of fields in the @desc to unset..None.