mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 18:58:36 +00:00
mcu: Fix missing glyphs in the slide puzzle
Scan for string literals to make sure to include the special characters used in the demo.
This commit is contained in:
parent
9f957e7db5
commit
7c37a3b14e
2 changed files with 28 additions and 9 deletions
|
@ -41,7 +41,7 @@ mod unique_id;
|
|||
mod visible;
|
||||
mod z_order;
|
||||
|
||||
use std::rc::Rc;
|
||||
use std::{collections::HashSet, rc::Rc};
|
||||
|
||||
use crate::langtype::Type;
|
||||
|
||||
|
@ -186,6 +186,8 @@ pub async fn run_passes(
|
|||
collect_globals::collect_globals(doc, diag);
|
||||
|
||||
if compiler_config.embed_resources == crate::EmbedResourcesKind::EmbedTextures {
|
||||
let mut characters_seen = HashSet::new();
|
||||
|
||||
// Include at least the default font sizes used in the MCU backend
|
||||
let mut font_pixel_sizes = vec![(12. * compiler_config.scale_factor) as i16];
|
||||
for component in (root_component.used_types.borrow().sub_components.iter())
|
||||
|
@ -196,12 +198,14 @@ pub async fn run_passes(
|
|||
compiler_config.scale_factor,
|
||||
&mut font_pixel_sizes,
|
||||
);
|
||||
embed_glyphs::scan_string_literals(component, &mut characters_seen);
|
||||
}
|
||||
|
||||
embed_glyphs::embed_glyphs(
|
||||
root_component,
|
||||
compiler_config.scale_factor,
|
||||
font_pixel_sizes,
|
||||
characters_seen,
|
||||
std::iter::once(&*doc).chain(type_loader.all_documents()),
|
||||
diag,
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue