summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authordamaxwell <damaxwell@alaska.edu>2023-07-19 02:25:24 -0800
committerGitHub <noreply@github.com>2023-07-19 12:25:24 +0200
commit8a57395ee48ecee02c2eb833d232979730f0e445 (patch)
tree7a66d64f2f4b8afd509db0a89d5bf25a2ab1c72b /tests
parentf39bfa476222aa92a590d65f7c2d58612f24eef2 (diff)
Support OpenType writing script (#1697)
Diffstat (limited to 'tests')
-rw-r--r--tests/ref/text/lang.pngbin4207 -> 5252 bytes
-rw-r--r--tests/ref/text/shaping.pngbin2606 -> 3902 bytes
-rw-r--r--tests/typ/text/lang.typ20
-rw-r--r--tests/typ/text/shaping.typ10
4 files changed, 30 insertions, 0 deletions
diff --git a/tests/ref/text/lang.png b/tests/ref/text/lang.png
index 9ec88152..a5ae8979 100644
--- a/tests/ref/text/lang.png
+++ b/tests/ref/text/lang.png
Binary files differ
diff --git a/tests/ref/text/shaping.png b/tests/ref/text/shaping.png
index 278fe8ee..a77dda3a 100644
--- a/tests/ref/text/shaping.png
+++ b/tests/ref/text/shaping.png
Binary files differ
diff --git a/tests/typ/text/lang.typ b/tests/typ/text/lang.typ
index a70b4d63..7f1ae1fc 100644
--- a/tests/typ/text/lang.typ
+++ b/tests/typ/text/lang.typ
@@ -23,6 +23,26 @@
#text(lang: "sr")[Бб]
---
+// Verify that writing script/language combination has an effect
+#{
+ set text(size:20pt)
+ set text(script: "latn", lang: "en")
+ [Ş ]
+ set text(script: "latn", lang: "ro")
+ [Ş ]
+ set text(script: "grek", lang: "ro")
+ [Ş ]
+}
+
+---
+// Error: 19-23 expected string or auto, found none
+#set text(script: none)
+
+---
+// Error: 19-23 expected three or four letter script code (ISO 15924 or 'math')
+#set text(script: "ab")
+
+---
// Error: 17-21 expected string, found none
#set text(lang: none)
diff --git a/tests/typ/text/shaping.typ b/tests/typ/text/shaping.typ
index 3a99815b..3a8d5411 100644
--- a/tests/typ/text/shaping.typ
+++ b/tests/typ/text/shaping.typ
@@ -12,6 +12,16 @@ ABCअपार्टमेंट
अ पा र् ट में ट
---
+// A forced `latn` script inhibits Devanagari font features.
+#set text(script: "latn")
+ABCअपार्टमेंट
+
+---
+// A forced `deva` script enables Devanagari font features.
+#set text(script: "deva")
+ABCअपार्टमेंट
+
+---
// Test that RTL safe-to-break doesn't panic even though newline
// doesn't exist in shaping output.
#set text(dir: rtl, font: "Noto Serif Hebrew")