# FontFamilyLoader

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

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

```rust
struct FontFamilyLoader
```

Finds the font assets of a font family source.

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

## Members

- [`load_font_assets`](#function-load_font_assets)
- [`is_font_source`](#function-is_font_source)
- [`is_font_file`](#function-is_font_file)

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

### load_font_assets

```rust
fn load_font_assets(source: &url::Url) -> Vec<url::Url>
```

Loads all font assets that belong to the specified source: a single
font file, a file name pattern (`MyFont*.ttf`) or a location holding
font files.

Panics when no asset loader is registered with the locator.

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

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

### is_font_source

```rust
fn is_font_source(uri: &url::Url) -> bool
```

Whether the URL (without its query) names a font file.

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

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

### is_font_file

```rust
fn is_font_file(file_path: &str) -> bool
```

Whether the path has a font file extension (`.ttf`, `.otf`, `.ttc`).

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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ErasedDestructor`
- `IntoEither`

## Availability

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