# FontCollectionBaseImpl

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

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

```rust
trait FontCollectionBaseImpl: Sized + 'static
```

The abstract and virtual members of a font collection deriving from
[`FontCollectionBase`](/docs/0.5.0/api/ferroui-base/media/fonts/struct-fontcollectionbase/).

`this` is the collection itself. A default implementation is the base
class behaviour; an override calls it with
`FontCollectionBase::<member>(this, ..)`.

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

## Members

- [`base`](#function-base)
- [`key`](#function-key)
- [`try_match_character`](#function-try_match_character)
- [`try_match_character_from_platform`](#function-try_match_character_from_platform)
- [`try_create_synthetic_glyph_typeface`](#function-try_create_synthetic_glyph_typeface)
- [`try_get_glyph_typeface`](#function-try_get_glyph_typeface)
- [`try_get_family_typefaces`](#function-try_get_family_typefaces)

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

### base

```rust
fn base(this: &Self) -> &FontCollectionBase
```

The base class state of the collection.

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

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

### key

```rust
fn key(this: &Self) -> url::Url
```

Gets the unique identifier for the font collection (a URL of the
`fonts:` scheme, see `IFontCollection::key`).

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

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

### try_match_character

```rust
fn try_match_character(this: &Self, codepoint: i32, style: FontStyle, weight: FontWeight, stretch: FontStretch, family_name: Option<&str>, culture: Option<&Locale>) -> Option<Typeface>
```

Tries to match a specified character to a `Typeface` that supports
specified font properties.

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

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

### try_match_character_from_platform

```rust
fn try_match_character_from_platform(_this: &Self, _codepoint: i32, _key: FontCollectionKey, _family_name: Option<&str>, _culture: Option<&Locale>) -> Option<Rc<GlyphTypeface>>
```

Hook for platform-backed collections (e.g. the system font collection)
to consult the underlying font manager for a fallback typeface.
Invoked at most once per (script-bucket, culture) pair from
`FontCollectionBase::try_match_character`.

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

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

### try_create_synthetic_glyph_typeface

```rust
fn try_create_synthetic_glyph_typeface(this: &Self, glyph_typeface: &Rc<GlyphTypeface>, style: FontStyle, weight: FontWeight, stretch: FontStretch) -> Option<Rc<GlyphTypeface>>
```

Try to get a synthetic glyph typeface for given parameters.

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

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

### try_get_glyph_typeface

```rust
fn try_get_glyph_typeface(this: &Self, family_name: &str, style: FontStyle, weight: FontWeight, stretch: FontStretch) -> Option<Rc<GlyphTypeface>>
```

Try to get a glyph typeface for given parameters.

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

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

### try_get_family_typefaces

```rust
fn try_get_family_typefaces(this: &Self, family_name: &str) -> Option<Vec<Typeface>>
```

Tries to get a list of typefaces for the specified family name.

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

## Trait implementations

- [`FontCollectionBaseImpl`](/docs/0.5.0/api/ferroui-base/media/fonts/trait-fontcollectionbaseimpl/)

## Availability

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