From 55e32759b1a363a34fffaa3c50680bcaa4624fa1 Mon Sep 17 00:00:00 2001 From: aiongg Date: Thu, 22 Oct 2026 04:15:17 +0000 Subject: [PATCH] =?UTF-8?q?Integration:=20subset=20fallback=20test=20names?= =?UTF-8?q?=20the=20face=20the=20build=20leads=20with=20(#2609=20=C3=97=20?= =?UTF-8?q?#1760)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #2609 put the Japanese faces ahead of the bundled Inter face and rewrote the #1760 test to expect Inter, which holds only without craft-fonts. With CRAFT_FONTS_DIR, BIZ UDPGothic has ő and draws it. The test now expects the Japanese sans face when the build has one, Inter otherwise. --- crates/edit/src/tests.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/crates/edit/src/tests.rs b/crates/edit/src/tests.rs index 5b76060c5..cf3860237 100644 --- a/crates/edit/src/tests.rs +++ b/crates/edit/src/tests.rs @@ -5342,10 +5342,12 @@ fn a_shaped_run_is_one_text_object_with_each_glyph_where_shaping_put_it() { #[test] fn a_subset_program_is_not_trusted_for_new_characters_and_the_error_names_the_character() { let mut doc = embedded_program_page("BT /F1 12 Tf 72 700 Td (Stable text) Tj ET", "ABCDEF+Inter-Regular"); - // The subset's own program is not trusted for a character: the bundled Inter face draws it - // through a generated font instead (the subset may map a code whose outline was dropped). + // The subset's own program is not trusted for a character: a fallback face draws it through a + // generated font instead (the subset may map a code whose outline was dropped). The Japanese + // sans face leads the fallbacks when built with craft-fonts; the bundled Inter face otherwise. let edit = text::rewrite_block(&mut doc, 0, 0, Some("Stable tőxt"), &text::BlockStyle::default()).unwrap(); - assert_eq!(edit.substituted.as_deref(), Some("Inter Type3")); + let face = pdfcraft_fonts::document_japanese_font_for_style(false, false).map_or("Inter", |f| f.family); + assert_eq!(edit.substituted, Some(format!("{face} Type3"))); assert_eq!(text::text_blocks(&reopen(&doc), 0).unwrap()[0].editor_text, "Stable tőxt"); // A character no fallback face has is refused, named, and left as it was. let mut doc = embedded_program_page("BT /F1 12 Tf 72 700 Td (Stable text) Tj ET", "ABCDEF+Inter-Regular");