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.
Members
DEFAULT_FONT_FAMILY_NAMEnewwith_base_uridefault_familynamefamily_nameskeyfamily_typefacesptr_eqparseparse_with_base_uri
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.
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.
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.
default_family
fn default_family() -> FontFamily
Represents the default font family.
name
fn name(self: &Self) -> &str
Gets the primary family name of the font family.
family_names
fn family_names(self: &Self) -> &FamilyNameCollection
Gets the family names.
key
fn key(self: &Self) -> Option<&FontFamilyKey>
Gets the key for associated assets.
family_typefaces
fn family_typefaces(self: &Self) -> Vec<Typeface>
Returns the typefaces for the font family.
ptr_eq
fn ptr_eq(self: &Self, other: &FontFamily) -> bool
Whether both handles refer to the same instance (C# ReferenceEquals).
parse
fn parse(s: &str) -> Result<FontFamily, FormatError>
Parses a FontFamily string.
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.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeResourceKeyObjectPropertyValueAnyValueClassDefaultsBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedToStringErasedDestructorIntoEitherCloneDefaultFrom<&str>FromStrDisplayDebugPartialEqEqHashFrom<FontFamily>MarkupTypedValueTypeRegistration
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.