Switch to Buffer::from_static for embedded fonts

This commit is contained in:
Laurenz 2023-03-21 23:43:14 +01:00
parent a6b63b96f9
commit 9fc432a41d

View File

@ -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 {