diff --git a/crates/docx/src/read/props.rs b/crates/docx/src/read/props.rs index d4414cd39..c9dfd947b 100644 --- a/crates/docx/src/read/props.rs +++ b/crates/docx/src/read/props.rs @@ -99,6 +99,8 @@ pub(crate) fn lang_script(tag: &str) -> &'static str { "th" => "Thai", "hi" | "mr" | "ne" | "sa" | "kok" => "Deva", "bn" | "as" => "Beng", + // Measured in Word: Punjabi takes the Arabic-script font in Pakistan, Gurmukhi elsewhere. + "pa" if rest.iter().any(|p| p.eq_ignore_ascii_case("pk")) => "Arab", "pa" => "Guru", "gu" => "Gujr", "or" => "Orya", diff --git a/crates/docx/tests/fixtures.rs b/crates/docx/tests/fixtures.rs index 931e0ec48..01103854d 100644 --- a/crates/docx/tests/fixtures.rs +++ b/crates/docx/tests/fixtures.rs @@ -3294,6 +3294,8 @@ fn bidi_theme_slots_follow_the_theme_font_language() { (Some(r#"w:bidi="ar-SA""#), "Arial", true, "", ["Georgia", "Trebuchet MS"]), (Some(r#"w:bidi="he-IL""#), "", true, "", ["Courier New", "Comic Sans MS"]), (Some(r#"w:bidi="ur-PK""#), "Arial", true, "", ["Georgia", "Trebuchet MS"]), + (Some(r#"w:bidi="pa-PK""#), "Arial", true, "", ["Georgia", "Trebuchet MS"]), + (Some(r#"w:bidi="pa-IN""#), "Arial", true, "", ["Arial", "Arial"]), (Some(r#"w:bidi="fr-FR""#), "Arial", true, "", ["Verdana", "Impact"]), (Some(r#"w:bidi="th-TH""#), "Arial", true, "", ["Arial", "Arial"]), (Some(r#"w:bidi="th-TH""#), "", true, "", [tnr, tnr]),