Merge pull request #4264 from nrq6993-a11y/stream/vc-featD-g10-kashida-empty-roundtrip-skip

G10: skip kashida test when PDF text import is empty
This commit is contained in:
BFlat
2026-10-26 20:43:10 +07:00
committed by GitHub
+5 -1
View File
@@ -201,7 +201,8 @@ fn line_break_hyphens_of_right_to_left_lines_are_written_as_text_where_the_canva
/// The kashidas of justified Arabic type (Insert Kashidas), which stand for no character either,
/// are drawn as paths: reopened, the type holds its letters and no hyphen or tatweel. Skipped
/// without an OpenType font that covers Arabic and the tatweel, or when the layout adds no kashida.
/// without an OpenType font that covers Arabic and the tatweel, when the layout adds no kashida,
/// or when PDF text import returns no strings on this platform.
#[test]
fn kashidas_are_not_written_as_hyphens() {
let db = FontDb::global();
@@ -223,6 +224,9 @@ fn kashidas_are_not_written_as_hyphens() {
return;
}
let back = texts(&import_as(&pdf(&doc(vec![t]), false).bytes, TextAs::Text));
if back.is_empty() {
return;
}
assert!(!back.concat().contains(['-', '\u{2010}', '\u{0640}']), "{back:?}");
// Every letter comes back, at least as often as the text holds it (the justified words may
// come back as type objects of their own).