Can we underline Font

Hi,

is it possible to underline my text as I cannot see anything related to this in previous problems. and in the font options. Thanks in advance

Hi @usama_jalal!

It seems like this is currently not possible.

You can only use color, outline and shadow.

If it is not to much text you can maybe use an image element to create a line or use html text instead.

I mean, I don’t really know the logistics of making 2d images/elements, but I suppose you could make a rectangle the same color as the text or whatever you want the outline to be and stick it below the text.

There isnt really any “logistics”, you just kinda do it. Make an element then change the type to whatever it needa be.

thats a big headache :confused:

How? It would take about 10 seconds.

what if I have 500 + texts that I need to underline

I could try to make a script to, but that might be hard.

I was just saying that because I do not have experience with elements like that.

change the text to an image, then resize it, thats it

1 Like

Do you think its a good solution to make 500+ lines in my texts? which are of different sizes . :confused:

A big hack (assuming it’s just English) you could do is create a custom font that has underline for all the letters and numbers and symbols you need and map them to a different unicode.

eg
a = a
ĂĄ = a

No I have to add localization so not just English

Then you are either going to have to:

Im that that familiar with HTML or multilanguage games, but is it possible to make the next needed to be underlined a variable, and then use an underline tag in HTML to make any text underlined?

Here’s a quick test to underline canvas fonts. It works by replacing the canvas font’s renderCharacter method with one that also draws an underline.

https://playcanvas.com/project/1275969/overview/underline-test-with-canvasfont

1 Like

Ah but there is small gap between the underline on each character.

At this point you need to decide if all the trouble is worth it to have some lines under the text.

If you’re a 1 man team or a hobbyist then sure you could make that call. But If you have a client or another party defining the requirements then as a developer you might just need to make it happen even if it’s a pain.

I mean, how many lines of text are we talking about here? Can we see an example? Send us the editor link