summaryrefslogtreecommitdiff
path: root/tests/typ
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2020-12-17 15:43:30 +0100
committerLaurenz <laurmaedje@gmail.com>2020-12-17 15:43:30 +0100
commit6f111f941008f10ddc06e6f56da9e3582e90d2c4 (patch)
tree0ee44f6c9d88353320893522cf14931863ddf742 /tests/typ
parent7e91c8dc87e345ee38b934375d113e824a423a2b (diff)
Test [font] 🧣
Diffstat (limited to 'tests/typ')
-rw-r--r--tests/typ/func-font-fallback.typ18
-rw-r--r--tests/typ/func-font-properties.typ20
2 files changed, 38 insertions, 0 deletions
diff --git a/tests/typ/func-font-fallback.typ b/tests/typ/func-font-fallback.typ
new file mode 100644
index 00000000..587baed7
--- /dev/null
+++ b/tests/typ/func-font-fallback.typ
@@ -0,0 +1,18 @@
+// Test font fallback.
+
+// Source Sans Pro + Segoe UI Emoji.
+Emoji: 🏀
+
+// CMU Serif + Noto Emoji.
+[font: "CMU Serif", "Noto Emoji"][Emoji: 🏀]
+
+// Class definitions.
+[font: math=("CMU Serif", "Latin Modern Math", "Noto Emoji")]
+[font: math][Math: ∫ α + β ➗ 3]
+
+// Class redefinition.
+[font: sans-serif=("Noto Emoji",)]
+[font: sans-serif=("Archivo", sans-serif)]
+New sans-serif. 🚀
+
+// TODO: Add tests for other scripts.
diff --git a/tests/typ/func-font-properties.typ b/tests/typ/func-font-properties.typ
new file mode 100644
index 00000000..78093e98
--- /dev/null
+++ b/tests/typ/func-font-properties.typ
@@ -0,0 +1,20 @@
+// Test configuring font properties.
+
+[font: "PT Sans", 10pt]
+
+// Set same font size in three different ways.
+[font: 20pt][A]
+[font: 200%][A]
+[font: 15pt + 50%][A]
+
+// Do nothing.
+[font][Normal]
+
+// Set style (is available).
+[font: style=italic][Italic]
+
+// Set weight (is available).
+[font: weight=bold][Bold]
+
+// Set stretch (not available, matching closest).
+[font: stretch=ultra-condensed][Condensed]