Link formatting and vertical shifts
Issue description
Text that will end up in a link box is set using "bounds"
as both the bottom-edge
and top-edge
, then the link box itself is put on the text baseline. As a result, when the link text contains letters with descenders (such as p, j, y...), the whole link box is shifted upwards:
Suggestions
Using set text(bottom-edge: "baseline", top-edge: "cap-height")
instead of set text(bottom-edge: "bounds", top-edge: "bounds")
ensures that the baseline is shared between a link and the surrounding text. Although it shrinks the link box, I still prefer this:
If there was a way to just add a couple points to the lower and upper bounds, I would absolutely go for it.
Bonus points
...for adding a few links, both internal and external, using texts with different constraints on the letters (both ascenders and descenders, ascenders only, descenders only, prisoner's constraint), in main.typ
. String examples: Typst
(ascenders + descenders), bottom link
(ascenders only), some page
(descenders only), our own success
(prisoner's constraint).