From 4e3036afcbdf2814889030413ffa81c8cc697341 Mon Sep 17 00:00:00 2001 From: Martin Haug Date: Tue, 31 May 2022 22:56:08 +0200 Subject: Sub- and superscripts Fixes to PDF export I guess Also improved rendition for non-Latin scripts --- tests/ref/layout/columns.png | Bin 122766 -> 106624 bytes tests/ref/text/baseline.png | Bin 1325 -> 6212 bytes tests/ref/text/features.png | Bin 11686 -> 10734 bytes tests/ref/text/indent.png | Bin 46160 -> 46855 bytes tests/ref/text/shifts.png | Bin 0 -> 2958 bytes tests/typ/text/baseline.typ | 13 +++++++++---- tests/typ/text/features.typ | 11 ----------- tests/typ/text/shifts.typ | 12 ++++++++++++ 8 files changed, 21 insertions(+), 15 deletions(-) create mode 100644 tests/ref/text/shifts.png create mode 100644 tests/typ/text/shifts.typ (limited to 'tests') diff --git a/tests/ref/layout/columns.png b/tests/ref/layout/columns.png index 3f471415..6f210510 100644 Binary files a/tests/ref/layout/columns.png and b/tests/ref/layout/columns.png differ diff --git a/tests/ref/text/baseline.png b/tests/ref/text/baseline.png index 71f75d9b..7baa0167 100644 Binary files a/tests/ref/text/baseline.png and b/tests/ref/text/baseline.png differ diff --git a/tests/ref/text/features.png b/tests/ref/text/features.png index cde62d8c..36609d89 100644 Binary files a/tests/ref/text/features.png and b/tests/ref/text/features.png differ diff --git a/tests/ref/text/indent.png b/tests/ref/text/indent.png index 09d8e68d..2196c33c 100644 Binary files a/tests/ref/text/indent.png and b/tests/ref/text/indent.png differ diff --git a/tests/ref/text/shifts.png b/tests/ref/text/shifts.png new file mode 100644 index 00000000..52e897fd Binary files /dev/null and b/tests/ref/text/shifts.png differ 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 @@ -34,13 +34,6 @@ fi vs. #text(ligatures: false)[No fi] #text(number-width: "tabular")[3456789123] \ #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") @@ -65,10 +58,6 @@ fi vs. #text(features: (liga: 0))[No fi] // Error: 24-25 expected string or auto, found integer #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..624db7e1 --- /dev/null +++ b/tests/typ/text/shifts.typ @@ -0,0 +1,12 @@ +// 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] -- cgit v1.2.3