Make FontSystem global and simplify Paragraph API

This commit is contained in:
Héctor Ramón Jiménez 2023-09-11 02:47:24 +02:00
parent 9245423c5d
commit 346af3f8b0
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
15 changed files with 165 additions and 328 deletions

View file

@ -2,7 +2,6 @@
use crate::core::image;
use crate::core::svg;
use crate::core::Size;
use crate::text;
use std::borrow::Cow;
@ -18,9 +17,6 @@ pub trait Backend {
pub trait Text {
/// Loads a font from its bytes.
fn load_font(&mut self, font: Cow<'static, [u8]>);
/// Returns the [`cosmic_text::FontSystem`] of the [`Backend`].
fn font_system(&self) -> &text::FontSystem;
}
/// A graphics backend that supports image rendering.