mirror of
https://github.com/typst/typst
synced 2025-05-15 01:25:28 +08:00
Fix warning when compiling without embedded fonts
This commit is contained in:
parent
72f4c543cc
commit
9ff9615208
@ -5,7 +5,6 @@ use std::path::{Path, PathBuf};
|
|||||||
|
|
||||||
use memmap2::Mmap;
|
use memmap2::Mmap;
|
||||||
use typst::diag::StrResult;
|
use typst::diag::StrResult;
|
||||||
use typst::eval::Bytes;
|
|
||||||
use typst::font::{Font, FontBook, FontInfo, FontVariant};
|
use typst::font::{Font, FontBook, FontInfo, FontVariant};
|
||||||
use walkdir::WalkDir;
|
use walkdir::WalkDir;
|
||||||
|
|
||||||
@ -82,7 +81,7 @@ impl FontSearcher {
|
|||||||
#[cfg(feature = "embed-fonts")]
|
#[cfg(feature = "embed-fonts")]
|
||||||
fn add_embedded(&mut self) {
|
fn add_embedded(&mut self) {
|
||||||
let mut process = |bytes: &'static [u8]| {
|
let mut process = |bytes: &'static [u8]| {
|
||||||
let buffer = Bytes::from_static(bytes);
|
let buffer = typst::eval::Bytes::from_static(bytes);
|
||||||
for (i, font) in Font::iter(buffer).enumerate() {
|
for (i, font) in Font::iter(buffer).enumerate() {
|
||||||
self.book.push(font.info().clone());
|
self.book.push(font.info().clone());
|
||||||
self.fonts.push(FontSlot {
|
self.fonts.push(FontSlot {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user