diff --git a/crates/typst/src/text/smartquote.rs b/crates/typst/src/text/smartquote.rs index 0bcccf41c..9b48c03ac 100644 --- a/crates/typst/src/text/smartquote.rs +++ b/crates/typst/src/text/smartquote.rs @@ -207,8 +207,8 @@ impl<'s> SmartQuotes<'s> { /// Currently, the supported languages are: English, Czech, Danish, German, /// Swiss / Liechtensteinian German, Estonian, Icelandic, Italian, Latin, /// Lithuanian, Latvian, Slovak, Slovenian, Spanish, Bosnian, Finnish, - /// Swedish, French, Hungarian, Polish, Romanian, Japanese, Traditional - /// Chinese, Russian, Norwegian, and Hebrew. + /// Swedish, French, Swiss French, Hungarian, Polish, Romanian, Japanese, + /// Traditional Chinese, Russian, Norwegian, and Hebrew. /// /// For unknown languages, the English quotes are used as fallback. pub fn get( @@ -227,6 +227,10 @@ impl<'s> SmartQuotes<'s> { false => ("‹", "›", "«", "»"), true => low_high, }, + "fr" if matches!(region, Some("CH")) => match alternative { + false => ("‹\u{202F}", "\u{202F}›", "«\u{202F}", "\u{202F}»"), + true => default, + }, "cs" | "da" | "de" | "sk" | "sl" if alternative => ("›", "‹", "»", "«"), "cs" | "de" | "et" | "is" | "lt" | "lv" | "sk" | "sl" => low_high, "da" => ("‘", "’", "“", "”"), diff --git a/tests/ref/smartquote-fr-ch.png b/tests/ref/smartquote-fr-ch.png new file mode 100644 index 000000000..30e91e401 Binary files /dev/null and b/tests/ref/smartquote-fr-ch.png differ diff --git a/tests/suite/text/smartquote.typ b/tests/suite/text/smartquote.typ index f5442ffd0..fe4e8c85c 100644 --- a/tests/suite/text/smartquote.typ +++ b/tests/suite/text/smartquote.typ @@ -22,6 +22,10 @@ #set text(lang: "fr") "Le cheval ne mange pas de salade de concombres" est la première phrase jamais prononcée au 'téléphone'. +--- smartquote-fr-ch --- +#set text(lang: "fr", region: "CH") +"Le cheval ne mange pas de salade de concombres" est la première phrase jamais prononcée au 'téléphone'. + --- smartquote-fi --- #set text(lang: "fi") "Hevonen ei syö kurkkusalaattia" oli ensimmäinen koskaan 'puhelimessa' lausuttu lause.