summaryrefslogtreecommitdiff
path: root/tests/typ/text
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-03-08 10:43:03 +0100
committerLaurenz <laurmaedje@gmail.com>2023-03-08 10:44:24 +0100
commit1b2b53ecb91a9bd7fb3493e471ae03cd142a7c03 (patch)
tree682124c2343db9491c84bddbdca026c676f220c6 /tests/typ/text
parent25b5bd117529cd04bb789e1988eb3a3db8025a0e (diff)
Require font to be a named argument
Diffstat (limited to 'tests/typ/text')
-rw-r--r--tests/typ/text/chinese.typ2
-rw-r--r--tests/typ/text/deco.typ4
-rw-r--r--tests/typ/text/edge.typ2
-rw-r--r--tests/typ/text/features.typ4
-rw-r--r--tests/typ/text/font.typ16
-rw-r--r--tests/typ/text/lang.typ2
-rw-r--r--tests/typ/text/microtype.typ2
-rw-r--r--tests/typ/text/raw.typ2
-rw-r--r--tests/typ/text/shaping.typ2
-rw-r--r--tests/typ/text/space.typ4
-rw-r--r--tests/typ/text/symbol.typ2
-rw-r--r--tests/typ/text/tracking-spacing.typ2
12 files changed, 20 insertions, 24 deletions
diff --git a/tests/typ/text/chinese.typ b/tests/typ/text/chinese.typ
index 04fa7027..258d72fd 100644
--- a/tests/typ/text/chinese.typ
+++ b/tests/typ/text/chinese.typ
@@ -1,7 +1,7 @@
// Test chinese text from Wikipedia.
---
-#set text("Noto Serif CJK SC")
+#set text(font: "Noto Serif CJK SC")
是美国广播公司电视剧《迷失》第3季的第22和23集,也是全剧的第71集和72集
由执行制作人戴蒙·林道夫和卡尔顿·库斯编剧,导演则是另一名执行制作人杰克·本德
diff --git a/tests/typ/text/deco.typ b/tests/typ/text/deco.typ
index 5e9de5b3..f3be17e7 100644
--- a/tests/typ/text/deco.typ
+++ b/tests/typ/text/deco.typ
@@ -10,7 +10,7 @@
#underline(offset: 5pt)[Further below.]
// Different color.
-#underline(red, evade: false)[Critical information is conveyed here.]
+#underline(stroke: red, evade: false)[Critical information is conveyed here.]
// Inherits font color.
#text(fill: red, underline[Change with the wind.])
@@ -19,7 +19,7 @@
#overline(underline[Running amongst the wolves.])
---
-#let redact = strike.with(10pt, extent: 0.05em)
+#let redact = strike.with(stroke: 10pt, extent: 0.05em)
#let highlight = strike.with(stroke: 10pt + rgb("abcdef88"), extent: 0.05em)
// Abuse thickness and transparency for redacting and highlighting stuff.
diff --git a/tests/typ/text/edge.typ b/tests/typ/text/edge.typ
index 8c4c4a57..85aff68a 100644
--- a/tests/typ/text/edge.typ
+++ b/tests/typ/text/edge.typ
@@ -5,7 +5,7 @@
#set text(size: 8pt)
#let try(top, bottom) = rect(inset: 0pt, fill: conifer)[
- #set text("IBM Plex Mono", top-edge: top, bottom-edge: bottom)
+ #set text(font: "IBM Plex Mono", top-edge: top, bottom-edge: bottom)
From #top to #bottom
]
diff --git a/tests/typ/text/features.typ b/tests/typ/text/features.typ
index c706afed..360e8a11 100644
--- a/tests/typ/text/features.typ
+++ b/tests/typ/text/features.typ
@@ -11,7 +11,7 @@
---
// Test alternates and stylistic sets.
-#set text("IBM Plex Serif")
+#set text(font: "IBM Plex Serif")
a vs #text(alternates: true)[a] \
ß vs #text(stylistic-set: 5)[ß]
@@ -33,7 +33,7 @@ fi vs. #text(ligatures: false)[No fi]
---
// Test extra number stuff.
-#set text("IBM Plex Serif")
+#set text(font: "IBM Plex Serif")
0 vs. #text(slashed-zero: true)[0] \
1/2 vs. #text(fractions: true)[1/2]
diff --git a/tests/typ/text/font.typ b/tests/typ/text/font.typ
index e832ab1d..9844d066 100644
--- a/tests/typ/text/font.typ
+++ b/tests/typ/text/font.typ
@@ -18,8 +18,8 @@
// Set stretch (not available, matching closest).
#text(stretch: 50%)[Condensed]
-// Set family.
-#text(family: "IBM Plex Serif")[Serif]
+// Set font family.
+#text(font: "IBM Plex Serif")[Serif]
// Emoji.
Emoji: 🐪, 🌋, 🏞
@@ -32,16 +32,16 @@ Emoji: 🐪, 🌋, 🏞
// Disable font fallback beyond the user-specified list.
// Without disabling, New Computer Modern Math would come to the rescue.
-#set text("PT Sans", "Twitter Color Emoji", fallback: false)
+#set text(font: ("PT Sans", "Twitter Color Emoji"), fallback: false)
2π = 𝛼 + 𝛽. ✅
---
// Test string body.
#text("Text") \
#text(red, "Text") \
-#text("Ubuntu", blue, "Text") \
-#text([Text], teal, "IBM Plex Serif") \
-#text(forest, "New Computer Modern", [Text]) \
+#text(font: "Ubuntu", blue, "Text") \
+#text([Text], teal, font: "IBM Plex Serif") \
+#text(forest, font: "New Computer Modern", [Text]) \
---
// Error: 11-16 unexpected argument
@@ -56,9 +56,5 @@ Emoji: 🐪, 🌋, 🏞
#set text(size: 10pt, 12pt)
---
-// Error: 32-39 unexpected argument
-#set text(family: "Helvetica", "Arial")
-
----
// Error: 11-31 unexpected argument
#set text(something: "invalid")
diff --git a/tests/typ/text/lang.typ b/tests/typ/text/lang.typ
index 7d22fdc6..a70b4d63 100644
--- a/tests/typ/text/lang.typ
+++ b/tests/typ/text/lang.typ
@@ -12,7 +12,7 @@
---
// Test that the language passed to the shaper has an effect.
-#set text("Ubuntu")
+#set text(font: "Ubuntu")
// Some lowercase letters are different in Serbian Cyrillic compared to other
// Cyrillic languages. Since there is only one set of Unicode codepoints for
diff --git a/tests/typ/text/microtype.typ b/tests/typ/text/microtype.typ
index 252d163d..4c2b4d0b 100644
--- a/tests/typ/text/microtype.typ
+++ b/tests/typ/text/microtype.typ
@@ -12,7 +12,7 @@
]
// Test hanging punctuation with RTL.
-#set text(lang: "he", "PT Sans", "Noto Serif Hebrew")
+#set text(lang: "he", font: ("PT Sans", "Noto Serif Hebrew"))
בנייה נכונה של משפטים ארוכים דורשת ידע בשפה. אז בואו נדבר על מזג האוויר.
---
diff --git a/tests/typ/text/raw.typ b/tests/typ/text/raw.typ
index f8731cca..ecc81154 100644
--- a/tests/typ/text/raw.typ
+++ b/tests/typ/text/raw.typ
@@ -46,7 +46,7 @@ The keyword ```rust let```.
---
// Text show rule
-#show raw: set text("Roboto")
+#show raw: set text(font: "Roboto")
`Roboto`
---
diff --git a/tests/typ/text/shaping.typ b/tests/typ/text/shaping.typ
index 51199090..3a99815b 100644
--- a/tests/typ/text/shaping.typ
+++ b/tests/typ/text/shaping.typ
@@ -14,5 +14,5 @@ ABCअपार्टमेंट
---
// Test that RTL safe-to-break doesn't panic even though newline
// doesn't exist in shaping output.
-#set text(dir: rtl, "Noto Serif Hebrew")
+#set text(dir: rtl, font: "Noto Serif Hebrew")
\ ט
diff --git a/tests/typ/text/space.typ b/tests/typ/text/space.typ
index b95da872..a3fd6c0a 100644
--- a/tests/typ/text/space.typ
+++ b/tests/typ/text/space.typ
@@ -23,11 +23,11 @@ A /**/B/**/ C
---
// Test that a run consisting only of whitespace isn't trimmed.
-A#text("IBM Plex Serif")[ ]B
+A#text(font: "IBM Plex Serif")[ ]B
---
// Test font change after space.
-Left #text("IBM Plex Serif")[Right].
+Left #text(font: "IBM Plex Serif")[Right].
---
// Test that linebreak consumed surrounding spaces.
diff --git a/tests/typ/text/symbol.typ b/tests/typ/text/symbol.typ
index 3b7028e9..949f82d2 100644
--- a/tests/typ/text/symbol.typ
+++ b/tests/typ/text/symbol.typ
@@ -5,7 +5,7 @@
#emoji.woman.old
#emoji.turtle
-#set text("New Computer Modern Math")
+#set text(font: "New Computer Modern Math")
#sym.arrow
#sym.arrow.l
#sym.arrow.r.squiggly
diff --git a/tests/typ/text/tracking-spacing.typ b/tests/typ/text/tracking-spacing.typ
index 413194ba..a89b991f 100644
--- a/tests/typ/text/tracking-spacing.typ
+++ b/tests/typ/text/tracking-spacing.typ
@@ -11,7 +11,7 @@ I'm in#text(tracking: 0.15em + 1.5pt)[ spaace]!
---
// Test that tracking doesn't disrupt mark placement.
-#set text("PT Sans", "Noto Serif Hebrew")
+#set text(font: ("PT Sans", "Noto Serif Hebrew"))
#set text(tracking: 0.3em)
טֶקסט