refactor(ui-egui): move system_fonts.rs into platform/

This commit is contained in:
aiongg
2026-10-27 00:34:32 +00:00
parent ed09547ecf
commit 80c4572cfa
4 changed files with 7 additions and 5 deletions
+2 -2
View File
@@ -50,8 +50,6 @@ mod panels;
pub use print_ui::{Handling as PrintHandling, OptionsSource, PrintDraft, PrinterSource, Which as PrintWhich, system_printers};
pub use redact_ui::{HiddenDraft, PagesDraft as RedactPagesDraft, RedactPrefs, SearchDraft as RedactSearchDraft, SearchMode as RedactSearchMode};
pub mod i18n;
#[cfg(not(target_arch = "wasm32"))]
mod system_fonts;
mod tab_context;
pub mod theme;
mod widgets;
@@ -122,6 +120,8 @@ use platform::open_worker;
#[cfg(not(target_arch = "wasm32"))]
use platform::pickers;
pub use platform::portable;
#[cfg(not(target_arch = "wasm32"))]
use platform::system_fonts;
pub use platform::ui_scale;
pub use platform::updates;
pub use platform::window_controls;
+2
View File
@@ -9,6 +9,8 @@ pub(super) mod open_worker;
#[cfg(not(target_arch = "wasm32"))]
pub(super) mod pickers;
pub mod portable;
#[cfg(not(target_arch = "wasm32"))]
pub(super) mod system_fonts;
pub mod ui_scale;
pub mod updates;
pub mod window_controls;
@@ -472,7 +472,7 @@ mod tests {
#[test]
fn a_face_without_the_probe_is_rejected() {
// Inter is Latin, Greek and Cyrillic only.
let inter = include_bytes!("../../../assets/fonts/Inter-Regular.ttf");
let inter = include_bytes!("../../../../assets/fonts/Inter-Regular.ttf");
assert_eq!(face_with(inter, PROBE), None);
assert_eq!(face_with(inter, HANS_PROBE), None);
assert_eq!(face_with(inter, HANT_PROBE), None);
@@ -561,7 +561,7 @@ mod tests {
assert!(path.extension().is_some_and(|e| e == "ttf" || e == "ttc"), "{path:?}");
}
// Inter has no Hangul.
let inter = include_bytes!("../../../assets/fonts/Inter-Regular.ttf");
let inter = include_bytes!("../../../../assets/fonts/Inter-Regular.ttf");
assert_eq!(face_with(inter, HANGUL_PROBE), None);
}
@@ -612,7 +612,7 @@ mod tests {
std::fs::create_dir_all(&supplemental).expect("build a temp macOS-shaped font tree");
let dirs = [root.to_string_lossy().to_string(), supplemental.to_string_lossy().to_string()];
let names: Vec<&str> = dirs.iter().map(|d| d.as_str()).collect();
let inter: &[u8] = include_bytes!("../../../assets/fonts/Inter-Regular.ttf");
let inter: &[u8] = include_bytes!("../../../../assets/fonts/Inter-Regular.ttf");
let spaced = "Devanagari Sangam MN.ttc";
std::fs::write(supplemental.join(spaced), inter).expect("place a face at the spaced path");
let found = macos_families_in(&names, &[spaced]).iter().any(|p| read(p, 'A', MAX_BYTES).is_some());