Page 1 of 1

Text rendering is pixellated?

Posted: Sun Apr 26, 2020 2:39 pm
by Oarc
I don't think this is a bug since it seems others don't have this issue.

I tried rolling back to 0.18.16, and tried versions .19/20/21.

The issue is shown in the attached picture.
font scaling issue.png
font scaling issue.png (896.57 KiB) Viewed 2147 times
The code I am using to generate this is:

Code: Select all

/c rid = rendering.draw_text{text="Welcome...", surface=game.surfaces[1], target=game.player.character, target_offset={1,1}, color={}, scale=10, font="default", time_to_live=0, draw_on_ground=true, orientation=0, alignment=center, scale_with_zoom=false, only_in_alt_mode=false}
If I remove the font parameter, I get what is shown in the bottom right, the thick bold but clean font.
If I specify "default" as the font, or "scenario-message-dialog" I get this pixellated font...

I only noticed this recently. I tried restarting my computer, changing graphics options (everything is maxed out), checking integrity of the steam install...

Any ideas on how to fix this? A complete reinstall maybe?

Re: Text rendering is pixellated?

Posted: Mon Apr 27, 2020 5:47 am
by posila
You need to use font, that is defined in data prototypes as either having a border, or size greater than 32. Either of those conditions will use signed distance field to render those fonts and will scale well.

Otherwise font atlas will be created for size the font is defined for (+ modified by GUI scale), and when rescaled to any other size, it will look like crap.

Re: Text rendering is pixellated?

Posted: Mon Apr 27, 2020 6:38 pm
by Oarc
What are those fonts that fit your categories?

Code: Select all

default-game
and

Code: Select all

count-font
?

Also, this same lua line USED to work a few weeks ago. Something happened and the exact same stuff no longer works...

Was this changed in a recent update?

I used to be able to use

Code: Select all

scenario-message-dialog
before and it worked for me and lots of other players.

Thanks for the help!

Re: Text rendering is pixellated?

Posted: Tue Apr 28, 2020 5:55 am
by posila
Oarc wrote: Mon Apr 27, 2020 6:38 pm I used to be able to use

Code: Select all

scenario-message-dialog
before and it worked for me and lots of other players.
I was wrong about size threshold for switching to SDF. It's not larger than 32, but just 16. scenario-message-dialog used to have size 18 and was changed to 16.

Re: Text rendering is pixellated?

Posted: Tue Apr 28, 2020 4:07 pm
by Oarc
Thanks for the clarification!