diff options
| author | Laurenz <laurmaedje@gmail.com> | 2024-10-27 19:04:55 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-27 18:04:55 +0000 |
| commit | be7cfc85d08c545abfac08098b7b33b4bd71f37e (patch) | |
| tree | f4137fa2aaa57babae1f7603a9b2ed7e688f43d8 /crates/typst-kit/src/fonts.rs | |
| parent | b8034a343831e8609aec2ec81eb7eeda57aa5d81 (diff) | |
Split out four new crates (#5302)
Diffstat (limited to 'crates/typst-kit/src/fonts.rs')
| -rw-r--r-- | crates/typst-kit/src/fonts.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/typst-kit/src/fonts.rs b/crates/typst-kit/src/fonts.rs index 8c8981a1..83e13fd8 100644 --- a/crates/typst-kit/src/fonts.rs +++ b/crates/typst-kit/src/fonts.rs @@ -8,12 +8,12 @@ //! - For math: New Computer Modern Math //! - For code: Deja Vu Sans Mono -use std::path::PathBuf; +use std::fs; +use std::path::{Path, PathBuf}; use std::sync::OnceLock; -use std::{fs, path::Path}; use fontdb::{Database, Source}; -use typst::text::{Font, FontBook, FontInfo}; +use typst_library::text::{Font, FontBook, FontInfo}; use typst_timing::TimingScope; /// Holds details about the location of a font and lazily the font itself. @@ -46,7 +46,7 @@ impl FontSlot { pub fn get(&self) -> Option<Font> { self.font .get_or_init(|| { - let _scope = TimingScope::new("load font", None); + let _scope = TimingScope::new("load font"); let data = fs::read( self.path .as_ref() @@ -196,7 +196,7 @@ impl FontSearcher { #[cfg(feature = "embed-fonts")] fn add_embedded(&mut self) { for data in typst_assets::fonts() { - let buffer = typst::foundations::Bytes::from_static(data); + let buffer = typst_library::foundations::Bytes::from_static(data); for (i, font) in Font::iter(buffer).enumerate() { self.book.push(font.info().clone()); self.fonts.push(FontSlot { |
