Support rich text in rendering.draw_text

grilledham
Inserter
Inserter
Posts: 23
Joined: Tue Sep 25, 2018 9:32 pm
Contact:

Support rich text in rendering.draw_text

Post by grilledham »

It would be nice if rendering.draw_text supported rich text.
draw_text.png
draw_text.png (1.44 MiB) Viewed 4923 times
Bilka
Factorio Staff
Factorio Staff
Posts: 3871
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Support rich text in rendering.draw_text

Post by Bilka »

I can't easily scale, rotate, and calculate the size of rich text, so this is unlikely to happen. You could just draw the sprites yourself.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Rseding91
Factorio Staff
Factorio Staff
Posts: 17471
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Support rich text in rendering.draw_text

Post by Rseding91 »

In addition to what Bilka said I have negative interest in making rich-text work anywhere in the game.

If I was allowed I would remove the entire feature.

So, I'm going to move this to won't-implement until some point that we either remove rich text from the game or Bilka decides to implement support for it.

So, probably forever.
If you want to get ahold of me I'm almost always on Discord.
Genhis
Factorio Staff
Factorio Staff
Posts: 989
Joined: Wed Dec 24, 2014 8:19 am
Contact:

Re: Support rich text in rendering.draw_text

Post by Genhis »

Implemented for 1.1.77
mmmPI
Smart Inserter
Smart Inserter
Posts: 5294
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Support rich text in rendering.draw_text

Post by mmmPI »

There sure must be an interesting story behind this :)

I appreciate the rich text feature for that i have friends who don't play in english and it help reduce confusion about naming things.

I have no idea what kind of complications it creates to manage such feature.
Genhis
Factorio Staff
Factorio Staff
Posts: 989
Joined: Wed Dec 24, 2014 8:19 am
Contact:

Re: Support rich text in rendering.draw_text

Post by Genhis »

An interesting story? Well, Bilka asked me to implement it a few weeks ago because of some changes I made in 1.2 branch, and BurninSun actually pushed me to do it with how determined he was to make a rich text parser in Lua. :D

At first, it seemed like I would have to cut features like scaling and alignment because I didn't want to spend much time on this but it turned out not as bad. The most difficult thing (orientation) had already been implemented. So, I added features + tests step by step and JanSharp helped me with in-game testing.

However, Rseding's point is still valid. Rich text rendering is not optimized.
ljdp
Long Handed Inserter
Long Handed Inserter
Posts: 99
Joined: Wed Jul 01, 2015 12:33 am
Contact:

Re: Support rich text in rendering.draw_text

Post by ljdp »

Using the quality parameter in an item tag, like [item=iron-plate,quality=rare] doesn't work with rendering.draw_text. It does work in chat though. It would be great rendering did support the quality param, as I'm rendering auxilary machine information when alt-mode is on and some items have higher quality.
ljdp
Long Handed Inserter
Long Handed Inserter
Posts: 99
Joined: Wed Jul 01, 2015 12:33 am
Contact:

Re: Support rich text in rendering.draw_text

Post by ljdp »

Also worth noting I can't use rendering.draw_sprite to draw the quality icon on top in my situation, as I'm rendering a rectangle as a background element, there's no render layer that will let me draw the sprite above the rectangle.
Post Reply

Return to “Implemented mod requests”