iOSFont underline ? ? ?

As I am working on an imager to print the content of an iOSHTMLViewer, I just bump into the harsh reality that iOSFonts have no underline.

I checked in XCode, and indeed, there is no underline there either.

Since a browser can indeed have underlined text, I will have to emulate it.

Apple’s mysteries are infinite :frowning:

As far as I know underline is not part of the font but a possible attribute of an NSAttributedString. So, as long as you cannot output such one, yes, emulation sounds like the way to go.

I have one iOS app where Underlined Text is an option, and I use a method I wrote similar to drawText in Xojo
Since UL is not a direct font attribute, I had to calculate the bounding rectangle for the text, adjust for the font acender and draw a line

as you know … iOS app was not written in Xojo

perhaps this might work?

g.drawline x,y+g.textascender,x+stringWidth(s),y+g.textAscender

I do pretty much the same, by drawing a line under the text.