Page 1 of 1

[2.0.64] Rich text icons get underlined

Posted: Wed Aug 13, 2025 1:19 am
by hgschmie
consider this relatively unremarkable label style:

styles.tt_clickable_label = {
type = 'label_style',
parent = 'semibold_label',
underlined = true,
font_color = default_color,
hovered_font_color = hovered_color,
clicked_font_color = hovered_color,
}


When rendering a rich text with this style as a label, it looks like this:
Screenshot 2025-08-12 at 18.06.58.png
Screenshot 2025-08-12 at 18.06.58.png (772.46 KiB) Viewed 605 times
The ugly part is this:
Screenshot 2025-08-12 at 18.13.15.png
Screenshot 2025-08-12 at 18.13.15.png (9.43 KiB) Viewed 605 times
The oil rich text icon gets the same underline as the text.

This might be opening a can of worms but this should only underline "regular" text. Any rich text should not be underlined (and probably whitespace surrounding the rich text should not either.

Re: [2.0.64] Rich text icons get underlined

Posted: Wed Aug 13, 2025 2:27 am
by eugenekay
Maybe I am misunderstanding completely, but Rich Text is a piece of the parent text; not a standalone Icon element. It just happens to be using a PNG Icon for the rendered Glyph, rather than something coming from a Unicode font.

You asked for underlined = true,; and now you are surprised that it has an underline?

This is different than the "Web Centric" expectations which a User may have. Here in the Forums an Underline tag is interrupted by an Image: Under :arrow: lined. But Factorio is not a Web browser, so there is no reason/expectation for it to follow HTML/CSS rules.

Re: [2.0.64] Rich text icons get underlined

Posted: Wed Aug 13, 2025 5:09 am
by hgschmie
It still looks ugly. So why not ask? Worst thing is "we won't change it". :-)

Re: [2.0.64] Rich text icons get underlined

Posted: Thu Aug 14, 2025 12:53 pm
by Rseding91
Thanks for the report. Looking into the underline implementation I'm going to put this into minor issues only because it was never explicitly intended to underline rich text. Although saying that, it was also never intended to be used outside of of hyperlinks.

Maybe some day if someone wants to they will re-work it to have better support but for now it's only officially supported use-case is hyperlinks and if it works in other places - why not.

Re: [2.0.64] Rich text icons get underlined

Posted: Thu Aug 14, 2025 7:06 pm
by hgschmie
Thanks for looking into this. I agree, it is a minor issue.