Not enough space between the text and the line below using Typst underline function

Hi,
The picture shows that overline function works, there is enough space between the text and the line above it. The underline function does not produce the expected output. There is no space between the text and the line below it. My typst code is:

#set align(center)
#overline[#underline[#text(font: "bebas neue", size: 18pt)[#text(rgb("#000000"))[*SOME DUMMY TEXT*]]]]

Hey. Note that for more accessible documents, you should use a different
approach. I’m also facing this issue in the IJIMAI template. I haven’t had time to address this yet.

error: PDF/UA-1 error: cannot combine underline, overline, or strike
  ┌─ file.typ:1:10
  │
1 │ #overline(underline[text])
  │           ^^^^^^^^^^^^^^^

The underline function has an offset argument you can use to tune this, but I’m not sure what’s going wrong here. Maybe the font has a property for this, that Typst is following?

So I compiled your example code on my system and there is enough space between the text and the line below it.
The difference is that my machine does not have the “babas neue” font installed, so Typst does a font substitution. That suggests it’s a font-related issue.
Update. Yes it is. I installed the Babas Neue font, restarted Typst and set offset: auto and sure enough there’s no daylight between the line and the letters. It absolutely is a font issue.
The workaround is offset: 1pt for example.

1 Like

Thank you for your feedback, I have set the offset property of underline to 2pt and the output is good, I see space between the text and the line below. Thank you for your support.