FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    FontFamily

    struct · ferroui-base · v0.5.0

    struct FontFamily
    

    Represents a family of related fonts.

    A cheap to clone handle; equality compares the family names and the key.

    View source

    Members

    DEFAULT_FONT_FAMILY_NAME

    const DEFAULT_FONT_FAMILY_NAME: &'static str
    

    The name of the placeholder family that resolves to the font manager's default font family.

    Source

    new

    fn new(name: &str) -> Self
    

    Creates a font family from a family name, a comma separated list of family names or source#name segments.

    Panics when name is empty.

    Source

    with_base_uri

    fn with_base_uri(base_uri: Option<&url::Url>, name: &str) -> Self
    

    Creates a font family whose relative sources are resolved against base_uri (the URL of the document that names the family).

    Panics when name is empty.

    Source

    default_family

    fn default_family() -> FontFamily
    

    Represents the default font family.

    Source

    name

    fn name(self: &Self) -> &str
    

    Gets the primary family name of the font family.

    Source

    family_names

    fn family_names(self: &Self) -> &FamilyNameCollection
    

    Gets the family names.

    Source

    key

    fn key(self: &Self) -> Option<&FontFamilyKey>
    

    Gets the key for associated assets.

    Source

    family_typefaces

    fn family_typefaces(self: &Self) -> Vec<Typeface>
    

    Returns the typefaces for the font family.

    Source

    ptr_eq

    fn ptr_eq(self: &Self, other: &FontFamily) -> bool
    

    Whether both handles refer to the same instance (C# ReferenceEquals).

    Source

    parse

    fn parse(s: &str) -> Result<FontFamily, FormatError>
    

    Parses a FontFamily string.

    Source

    parse_with_base_uri

    fn parse_with_base_uri(s: &str, base_uri: Option<&url::Url>) -> Result<FontFamily, FormatError>
    

    Parses a FontFamily string, resolving relative sources against base_uri.

    Source

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.