diff --git a/tests/ref/issue-4454-footnote-ref-numbering.png b/tests/ref/issue-4454-footnote-ref-numbering.png index a517d5fb4..c561426f6 100644 Binary files a/tests/ref/issue-4454-footnote-ref-numbering.png and b/tests/ref/issue-4454-footnote-ref-numbering.png differ diff --git a/tests/ref/long-scripts.png b/tests/ref/long-scripts.png new file mode 100644 index 000000000..84758d087 Binary files /dev/null and b/tests/ref/long-scripts.png differ diff --git a/tests/ref/scripts-with-bundeled-fonts.png b/tests/ref/scripts-with-bundeled-fonts.png new file mode 100644 index 000000000..fb99b1bd6 Binary files /dev/null and b/tests/ref/scripts-with-bundeled-fonts.png differ diff --git a/tests/ref/sub-super-italic-compensation.png b/tests/ref/sub-super-italic-compensation.png new file mode 100644 index 000000000..b6c8ad06a Binary files /dev/null and b/tests/ref/sub-super-italic-compensation.png differ diff --git a/tests/ref/sub-super-non-typographic.png b/tests/ref/sub-super-non-typographic.png index b905e7d32..68e748c54 100644 Binary files a/tests/ref/sub-super-non-typographic.png and b/tests/ref/sub-super-non-typographic.png differ diff --git a/tests/ref/sub-super-typographic.png b/tests/ref/sub-super-typographic.png new file mode 100644 index 000000000..a0c53d500 Binary files /dev/null and b/tests/ref/sub-super-typographic.png differ diff --git a/tests/ref/sub-super.png b/tests/ref/sub-super.png index 10fe77b07..803e128f8 100644 Binary files a/tests/ref/sub-super.png and b/tests/ref/sub-super.png differ diff --git a/tests/ref/super-1em.png b/tests/ref/super-1em.png new file mode 100644 index 000000000..da222a294 Binary files /dev/null and b/tests/ref/super-1em.png differ diff --git a/tests/ref/super-highlight.png b/tests/ref/super-highlight.png new file mode 100644 index 000000000..2b148f827 Binary files /dev/null and b/tests/ref/super-highlight.png differ diff --git a/tests/ref/super-underline.png b/tests/ref/super-underline.png index 4608d1a83..8564d7205 100644 Binary files a/tests/ref/super-underline.png and b/tests/ref/super-underline.png differ diff --git a/tests/suite/text/shift.typ b/tests/suite/text/shift.typ index 3b8d2ccbd..71461bdfe 100644 --- a/tests/suite/text/shift.typ +++ b/tests/suite/text/shift.typ @@ -1,19 +1,78 @@ // Test sub- and superscript shifts. --- sub-super --- +#let sq = box(square(size: 4pt)) #table( columns: 3, - [Typo.], [Fallb.], [Synth], - [x#super[1]], [x#super[5n]], [x#super[2 #box(square(size: 6pt))]], - [x#sub[1]], [x#sub[5n]], [x#sub[2 #box(square(size: 6pt))]], + [Typo.], [Fallb.], [Synth.], + [x#super[1 #sq]], [x#super[5: #sq]], [x#super(typographic: false)[2 #sq]], + [x#sub[1 #sq]], [x#sub[5: #sq]], [x#sub(typographic: false)[2 #sq]], ) +--- sub-super-typographic --- +#set text(size: 20pt) +// Libertinus Serif supports "subs" and "sups" for `typo`, but not for `synth`. +#let synth = [1,2,3] +#let typo = [123] +#let sq = [1#box(square(size: 4pt))2] +x#super(synth) x#super(typo) x#super(sq) \ +x#sub(synth) x#sub(typo) x#sub(sq) + +--- sub-super-italic-compensation --- +#set text(size: 20pt, style: "italic") +// Libertinus Serif supports "subs" and "sups" for `typo`, but not for `synth`. +#let synth = [1,2,3] +#let typo = [123] +#let sq = [1#box(square(size: 4pt))2] +x#super(synth) x#super(typo) x#super(sq) \ +x#sub(synth) x#sub(typo) x#sub(sq) + --- sub-super-non-typographic --- #set super(typographic: false, baseline: -0.25em, size: 0.7em) n#super[1], n#sub[2], ... n#super[N] --- super-underline --- #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\]]))) \ +#set super(typographic: false) +#underline[The claim#super[4]] has been disputed. \ +The claim#super[#underline[4]] has been disputed. \ +The claim #underline(super[4]) has been disputed. \ +#set super(typographic: true) +#underline[The claim#super[4]] has been disputed. \ +The claim#super[#underline[4]] has been disputed. \ +The claim #underline(super[4]) has been disputed. + +--- super-highlight --- +#set super(typographic: false) +#highlight[The claim#super[4]] has been disputed. \ +The claim#super[#highlight[4]] has been disputed. \ +It really has been#super(highlight[4]) \ +#set super(typographic: true) +#highlight[The claim#super[4]] has been disputed. \ +The claim#super[#highlight[4]] has been disputed. \ +It really has been#super(highlight[4]) + +--- super-1em --- +Test#super[#box(rect(height: 1em))]#box(rect(height: 1em)) + +--- long-scripts --- +|longscript| \ +|#super(typographic: true)[longscript]| \ +|#super(typographic: false)[longscript]| \ +|#sub(typographic: true)[longscript]| \ +|#sub(typographic: false)[longscript]| + +--- scripts-with-bundeled-fonts --- +#let test(font, weights, styles) = { + for weight in weights { + for style in styles { + text(font: font, weight: weight, style: style)[Xx#super[Xx]#sub[Xx]] + linebreak() + } + } +} + +#test("DejaVu Sans Mono", ("regular", "bold"), ("normal", "oblique")) +#test("Libertinus Serif", ("regular", "semibold", "bold"), ("normal", "italic")) +#test("New Computer Modern", ("regular", "bold"), ("normal", "italic")) +#test("New Computer Modern Math", (400, 450, "bold"), ("normal",))