diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-06-01 11:47:05 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-01 11:47:05 +0200 |
| commit | 665ed12825918bd02a6d6dbcb67860a83dd41600 (patch) | |
| tree | 65d700531cd8a47fab4789c8feadaac08953b096 /tests | |
| parent | 97858e5992a52459dd8a34be7a6b4786952b491a (diff) | |
| parent | 755d46819894f9ad5285526206892471e6e71ef8 (diff) | |
Merge pull request #72 from typst/true-superscript
Sub- and superscripts
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ref/layout/columns.png | bin | 122766 -> 106624 bytes | |||
| -rw-r--r-- | tests/ref/text/baseline.png | bin | 1325 -> 6204 bytes | |||
| -rw-r--r-- | tests/ref/text/features.png | bin | 11686 -> 10734 bytes | |||
| -rw-r--r-- | tests/ref/text/indent.png | bin | 46160 -> 46855 bytes | |||
| -rw-r--r-- | tests/ref/text/shifts.png | bin | 0 -> 7907 bytes | |||
| -rw-r--r-- | tests/typ/text/baseline.typ | 13 | ||||
| -rw-r--r-- | tests/typ/text/features.typ | 11 | ||||
| -rw-r--r-- | tests/typ/text/shifts.typ | 19 |
8 files changed, 28 insertions, 15 deletions
diff --git a/tests/ref/layout/columns.png b/tests/ref/layout/columns.png Binary files differindex 3f471415..6f210510 100644 --- a/tests/ref/layout/columns.png +++ b/tests/ref/layout/columns.png diff --git a/tests/ref/text/baseline.png b/tests/ref/text/baseline.png Binary files differindex 71f75d9b..37bb1949 100644 --- a/tests/ref/text/baseline.png +++ b/tests/ref/text/baseline.png diff --git a/tests/ref/text/features.png b/tests/ref/text/features.png Binary files differindex cde62d8c..36609d89 100644 --- a/tests/ref/text/features.png +++ b/tests/ref/text/features.png diff --git a/tests/ref/text/indent.png b/tests/ref/text/indent.png Binary files differindex 09d8e68d..2196c33c 100644 --- a/tests/ref/text/indent.png +++ b/tests/ref/text/indent.png diff --git a/tests/ref/text/shifts.png b/tests/ref/text/shifts.png Binary files differnew file mode 100644 index 00000000..c1e9dec6 --- /dev/null +++ b/tests/ref/text/shifts.png diff --git a/tests/typ/text/baseline.typ b/tests/typ/text/baseline.typ index 5f451563..cd331c77 100644 --- a/tests/typ/text/baseline.typ +++ b/tests/typ/text/baseline.typ @@ -1,4 +1,9 @@ -// Test text baseline. - ---- -Hi #text(1.5em)[You], #text(0.75em)[how are you?] +// Test text baseline.
+
+---
+Hi #text(1.5em)[You], #text(0.75em)[how are you?]
+
+Our cockatoo was one of the
+#text(baseline: -0.2em)[#circle(radius: 2pt) first]
+#text(baseline: 0.2em)[birds #circle(radius: 2pt)]
+that ever learned to mimic a human voice.
diff --git a/tests/typ/text/features.typ b/tests/typ/text/features.typ index 739230c9..070fdcdf 100644 --- a/tests/typ/text/features.typ +++ b/tests/typ/text/features.typ @@ -35,13 +35,6 @@ fi vs. #text(ligatures: false)[No fi] #text(number-width: "tabular")[0123456789] --- -// Test number position. -#set text("IBM Plex Sans") -#text(number-position: "normal")[C2H4] \ -#text(number-position: "subscript")[C2H4] \ -#text(number-position: "superscript")[C2H4] - ---- // Test extra number stuff. #set text("IBM Plex Sans") 0 vs. #text(slashed-zero: true)[0] \ @@ -66,9 +59,5 @@ fi vs. #text(features: (liga: 0))[No fi] #set text(number-type: 2) --- -// Error: 24-35 expected "lining" or "old-style" -#set text(number-type: "different") - ---- // Error: 21-26 expected array of strings or dictionary mapping tags to integers, found boolean #set text(features: false) diff --git a/tests/typ/text/shifts.typ b/tests/typ/text/shifts.typ new file mode 100644 index 00000000..b70425c4 --- /dev/null +++ b/tests/typ/text/shifts.typ @@ -0,0 +1,19 @@ +// Test sub- and superscipt shifts. + +--- +#table(columns: 3, + [Typo.], [Fallb.], [Synth], + [x#super[1]], [x#super[5n]], [x#super[2 #square(width: 6pt)]], + [x#sub[1]], [x#sub[5n]], [x#sub[2 #square(width: 6pt)]], +) + +--- +#set super(typographic: false, baseline: -0.25em, size: 0.7em) +n#super[1], n#sub[2], ... n#super[N] + +--- +#set underline(stroke: 0.5pt, offset: 0.15em) + +#underline[The claim#super[\[4\]]] has been disputed. \ +The claim#super[#underline[\[4\]]] has been disputed. \ +It really has been#super(box(text(baseline: 0pt, underline[\[4\]]))) \ |
