mirror of
https://github.com/typst/typst
synced 2025-05-12 03:56:21 +08:00
Switch to Buffer::from_static
for embedded fonts
This commit is contained in:
parent
a6b63b96f9
commit
9fc432a41d
@ -623,8 +623,8 @@ impl FontSearcher {
|
||||
/// Add fonts that are embedded in the binary.
|
||||
#[cfg(feature = "embed-fonts")]
|
||||
fn add_embedded(&mut self) {
|
||||
let mut add = |bytes: &[u8]| {
|
||||
let buffer = Buffer::from(bytes);
|
||||
let mut add = |bytes: &'static [u8]| {
|
||||
let buffer = Buffer::from_static(bytes);
|
||||
for (i, font) in Font::iter(buffer).enumerate() {
|
||||
self.book.push(font.info().clone());
|
||||
self.fonts.push(FontSlot {
|
||||
|
Loading…
x
Reference in New Issue
Block a user