improv: reuse loaded fonts by cosmic-text for svg renderer
This commit is contained in:
parent
ebb3b125bf
commit
5013f63956
2 changed files with 18 additions and 5 deletions
|
|
@ -161,6 +161,14 @@ impl FontSystem {
|
|||
&mut self.raw
|
||||
}
|
||||
|
||||
/// Returns a reference to the underlying [`fontdb::Database`].
|
||||
///
|
||||
/// Unlike going through [`raw`](Self::raw) and `db_mut`, this does not
|
||||
/// clear `cosmic-text`'s internal font-match cache.
|
||||
pub fn db(&self) -> &cosmic_text::fontdb::Database {
|
||||
self.raw.db()
|
||||
}
|
||||
|
||||
/// Loads a font from its bytes.
|
||||
pub fn load_font(&mut self, bytes: Cow<'static, [u8]>) {
|
||||
if let Cow::Borrowed(bytes) = bytes {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue