parley/font.rs
1// Copyright 2021 the Parley Authors
2// SPDX-License-Identifier: Apache-2.0 OR MIT
3
4use fontique::Collection;
5
6use fontique::SourceCache;
7
8/// A font database/cache (wrapper around a Fontique [`Collection`] and [`SourceCache`]).
9///
10/// This type is designed to be a global resource with only one per-application (or per-thread).
11#[derive(Default, Clone)]
12pub struct FontContext {
13 pub collection: Collection,
14 pub source_cache: SourceCache,
15}
16
17impl FontContext {
18 /// Create a new `FontContext`, discovering system fonts if available.
19 pub fn new() -> Self {
20 Default::default()
21 }
22}