summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGabriel Araújo <gabriel140492@gmail.com>2024-05-15 10:42:13 -0300
committerGitHub <noreply@github.com>2024-05-15 13:42:13 +0000
commit017f2f45666abdc4a1c6a253f0e04a271b5a82c1 (patch)
treee652e90aefc67124afbfd072e45188a9d9dfe4f7 /tests
parent484a0e60d8087fac38b98f697b68f2dd4e829d59 (diff)
Fix hyphen duplication rule for some languages (#4058)
Diffstat (limited to 'tests')
-rw-r--r--tests/ref/hyphenate-es-captalized-names.pngbin0 -> 4238 bytes
-rw-r--r--tests/ref/hyphenate-es-repeat-hyphen.pngbin0 -> 3224 bytes
-rw-r--r--tests/ref/hyphenate-pt-dash-emphasis.pngbin0 -> 983 bytes
-rw-r--r--tests/ref/hyphenate-pt-no-repeat-hyphen.pngbin0 -> 1533 bytes
-rw-r--r--tests/ref/hyphenate-pt-repeat-hyphen-hyphenate-true-with-emphasis.pngbin0 -> 1350 bytes
-rw-r--r--tests/ref/hyphenate-pt-repeat-hyphen-hyphenate-true.pngbin0 -> 1341 bytes
-rw-r--r--tests/ref/hyphenate-pt-repeat-hyphen-natural-word-breaking.pngbin0 -> 1341 bytes
-rw-r--r--tests/suite/layout/inline/hyphenate.typ52
8 files changed, 52 insertions, 0 deletions
diff --git a/tests/ref/hyphenate-es-captalized-names.png b/tests/ref/hyphenate-es-captalized-names.png
new file mode 100644
index 00000000..803d6795
--- /dev/null
+++ b/tests/ref/hyphenate-es-captalized-names.png
Binary files differ
diff --git a/tests/ref/hyphenate-es-repeat-hyphen.png b/tests/ref/hyphenate-es-repeat-hyphen.png
new file mode 100644
index 00000000..a4c5a060
--- /dev/null
+++ b/tests/ref/hyphenate-es-repeat-hyphen.png
Binary files differ
diff --git a/tests/ref/hyphenate-pt-dash-emphasis.png b/tests/ref/hyphenate-pt-dash-emphasis.png
new file mode 100644
index 00000000..cab13ea4
--- /dev/null
+++ b/tests/ref/hyphenate-pt-dash-emphasis.png
Binary files differ
diff --git a/tests/ref/hyphenate-pt-no-repeat-hyphen.png b/tests/ref/hyphenate-pt-no-repeat-hyphen.png
new file mode 100644
index 00000000..d0e34c9b
--- /dev/null
+++ b/tests/ref/hyphenate-pt-no-repeat-hyphen.png
Binary files differ
diff --git a/tests/ref/hyphenate-pt-repeat-hyphen-hyphenate-true-with-emphasis.png b/tests/ref/hyphenate-pt-repeat-hyphen-hyphenate-true-with-emphasis.png
new file mode 100644
index 00000000..0bb23ab1
--- /dev/null
+++ b/tests/ref/hyphenate-pt-repeat-hyphen-hyphenate-true-with-emphasis.png
Binary files differ
diff --git a/tests/ref/hyphenate-pt-repeat-hyphen-hyphenate-true.png b/tests/ref/hyphenate-pt-repeat-hyphen-hyphenate-true.png
new file mode 100644
index 00000000..d08859fb
--- /dev/null
+++ b/tests/ref/hyphenate-pt-repeat-hyphen-hyphenate-true.png
Binary files differ
diff --git a/tests/ref/hyphenate-pt-repeat-hyphen-natural-word-breaking.png b/tests/ref/hyphenate-pt-repeat-hyphen-natural-word-breaking.png
new file mode 100644
index 00000000..d08859fb
--- /dev/null
+++ b/tests/ref/hyphenate-pt-repeat-hyphen-natural-word-breaking.png
Binary files differ
diff --git a/tests/suite/layout/inline/hyphenate.typ b/tests/suite/layout/inline/hyphenate.typ
index bcad4d93..c366b38f 100644
--- a/tests/suite/layout/inline/hyphenate.typ
+++ b/tests/suite/layout/inline/hyphenate.typ
@@ -50,6 +50,58 @@ It's a #emph[Tree]beard.
#set text(hyphenate: true)
#h(6pt) networks, the rest.
+--- hyphenate-pt-repeat-hyphen-natural-word-breaking ---
+// The word breaker naturally breaks arco-da-velha at arco-/-da-velha,
+// so we shall repeat the hyphen, even that hyphenate is set to false.
+#set page(width: 4cm)
+#set text(lang: "pt")
+
+Alguma coisa no arco-da-velha é algo que está muito longe.
+
+--- hyphenate-pt-repeat-hyphen-hyphenate-true ---
+#set page(width: 4cm)
+#set text(lang: "pt", hyphenate: true)
+
+Alguma coisa no arco-da-velha é algo que está muito longe.
+
+--- hyphenate-pt-repeat-hyphen-hyphenate-true-with-emphasis ---
+#set page(width: 4cm)
+#set text(lang: "pt", hyphenate: true)
+
+Alguma coisa no _arco-da-velha_ é algo que está muito longe.
+
+--- hyphenate-pt-no-repeat-hyphen ---
+#set page(width: 4cm)
+#set text(lang: "pt", hyphenate: true)
+
+Um médico otorrinolaringologista cuida da garganta do paciente.
+
+--- hyphenate-pt-dash-emphasis ---
+// If the hyphen is followed by a space we shall not repeat the hyphen
+// at the next line
+#set page(width: 4cm)
+#set text(lang: "pt", hyphenate: true)
+
+Quebabe é a -melhor- comida que existe.
+
+--- hyphenate-es-repeat-hyphen ---
+#set page(width: 6cm)
+#set text(lang: "es", hyphenate: true)
+
+Lo que entendemos por nivel léxico-semántico, en cuanto su sentido más
+gramatical: es aquel que estudia el origen y forma de las palabras de
+un idioma.
+
+--- hyphenate-es-captalized-names ---
+// If the hyphen is followed by a capitalized word we shall not repeat
+// the hyphen at the next line
+#set page(width: 6.2cm)
+#set text(lang: "es", hyphenate: true)
+
+Tras el estallido de la contienda Ruiz-Giménez fue detenido junto a sus
+dos hermanos y puesto bajo custodia por las autoridades republicanas, con
+el objetivo de protegerle de las patrullas de milicianos.
+
--- costs-widow-orphan ---
#set page(height: 60pt)