mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-10-24 10:08:00 -06:00
#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.
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user