pango::prelude

Trait FontFaceExt

Source
pub trait FontFaceExt: IsA<FontFace> + 'static {
    // Provided methods
    fn describe(&self) -> FontDescription { ... }
    fn face_name(&self) -> GString { ... }
    fn family(&self) -> FontFamily { ... }
    fn is_synthesized(&self) -> bool { ... }
    fn list_sizes(&self) -> Vec<i32> { ... }
}
Expand description

Trait containing all FontFace methods.

§Implementors

FontFace

Provided Methods§

Source

fn describe(&self) -> FontDescription

Returns a font description that matches the face.

The resulting font description will have the family, style, variant, weight and stretch of the face, but its size field will be unset.

§Returns

a newly-created FontDescription structure holding the description of the face. Use Pango::FontDescription::free() to free the result.

Source

fn face_name(&self) -> GString

Gets a name representing the style of this face.

Note that a font family may contain multiple faces with the same name (e.g. a variable and a non-variable face for the same style).

§Returns

the face name for the face. This string is owned by the face object and must not be modified or freed.

Source

fn family(&self) -> FontFamily

Available on crate feature v1_46 only.

Gets the FontFamily that @self belongs to.

§Returns

the FontFamily

Source

fn is_synthesized(&self) -> bool

Returns whether a FontFace is synthesized.

This will be the case if the underlying font rendering engine creates this face from another face, by shearing, emboldening, lightening or modifying it in some other way.

§Returns

whether @self is synthesized

Source

fn list_sizes(&self) -> Vec<i32>

List the available sizes for a font.

This is only applicable to bitmap fonts. For scalable fonts, stores None at the location pointed to by @sizes and 0 at the location pointed to by @n_sizes. The sizes returned are in Pango units and are sorted in ascending order.

§Returns
§sizes

location to store a pointer to an array of int. This array should be freed with g_free().

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§