# FontFamilyKey

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/media/fonts/struct-fontfamilykey/

**struct** · [`ferroui-base`](/docs/0.5.0/api/ferroui-base/) · v0.5.0

```rust
struct FontFamilyKey
```

Represents an identifier for a `FontFamily`.

The source is a [`UriRef`](/docs/0.5.0/api/ferroui-base/utilities/enum-uriref/): an absolute URL (`ferres://App/Assets#Inter`
without the name, `fonts:Inter`), or a reference relative to the base URI
of the document that names the font (`/Assets/Fonts`).

Two keys are equal when their sources and their base URIs are, compared
as .NET's `Uri` compares them (decision O5 of
docs/idiomatic-rust-signatures.md, the explicit key of the .NET rule): an
absolute URL without its fragment, a relative reference by its whole text.
The comparison reads the text of the URLs and allocates nothing, since
font families compare their keys on the hot paths of text layout.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/fonts/font_family_key.rs#L22)

## Members

- [`new`](#function-new)
- [`with_base_uri`](#function-with_base_uri)
- [`source`](#function-source)
- [`base_uri`](#function-base_uri)

<a id="function-new"></a>

### new

```rust
fn new(source: UriRef) -> Self
```

Creates a key for a source.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/fonts/font_family_key.rs#L34)

<a id="function-with_base_uri"></a>

### with_base_uri

```rust
fn with_base_uri(source: UriRef, base_uri: Option<Url>) -> Self
```

Creates a key for a source that is resolved against a base URI.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/fonts/font_family_key.rs#L39)

<a id="function-source"></a>

### source

```rust
fn source(self: &Self) -> &UriRef
```

Gets the source of the font family.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/fonts/font_family_key.rs#L49)

<a id="function-base_uri"></a>

### base_uri

```rust
fn base_uri(self: &Self) -> Option<&Url>
```

Gets the base URI of the font family.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/fonts/font_family_key.rs#L54)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`ResourceKeyObject`](/docs/0.5.0/api/ferroui-base/controls/trait-resourcekeyobject/)
- [`PropertyValue`](/docs/0.5.0/api/ferroui-base/trait-propertyvalue/)
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- `ToString`
- `ErasedDestructor`
- `IntoEither`
- `Clone`
- `Debug`
- `PartialEq`
- `Eq`
- `Hash`
- `Display`

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
