Use select_fallback as well

This commit is contained in:
Laurenz Stampfl 2025-07-20 10:06:33 +02:00
parent f9862eba8d
commit c384f6b6c0

View File

@ -7,6 +7,7 @@ use hayro_syntax::page::Page;
use hayro_syntax::Pdf;
use std::hash::{Hash, Hasher};
use std::sync::Arc;
use typst_library::text::FontInfo;
struct DocumentRepr {
pdf: Arc<Pdf>,
@ -121,6 +122,9 @@ fn get_standard_fonts(world: Tracked<dyn World + '_>) -> Arc<StandardFonts> {
None
}
})
.or_else(|| {
book.select_fallback(None, variant, "A")
})
.and_then(|i| world.font(i))
.map(|font| font.data().clone())
};