attractplus icon indicating copy to clipboard operation
attractplus copied to clipboard

Outline doesn't scale well if it is set before charsize

Open yarondotan opened this issue 1 year ago • 1 comments

In this example, am+ is running in 240p window.

Code: local title = title_surf.add_text( "[Title]", 42, 0, title_surf.width, title_surf.height-12 ) title.align = Align.Left title.outline = 3.0 title.charsize = font_size

Result: bad

After moving outline AFTER charsize: good

yarondotan avatar Jan 13 '25 23:01 yarondotan

Image Image

I could not reproduce your outline issue using the example you've given. As far as I'm aware you're displaying a 1440x1080 layout in a 320x240 window, with the font "Arial Rounded MT Bold" Only when I make the layout smaller do I see the thicker outline (on both titles) which is expected as it's 3/240 rather than 3/1080

local flw = fe.layout.width = 1440;
local flh = fe.layout.height = 1080;
// local flw = fe.layout.width = 320;
// local flh = fe.layout.height = 240;
fe.layout.font = "ARLRDBD.TTF";

local font_size = flh / 25;
local title_surf = ::fe.add_surface(flw, flh);
title_surf.add_rectangle(0, 0, title_surf.width, title_surf.height);

local title = title_surf.add_text( "Atari 2600", 10, 0, title_surf.width, title_surf.height );
title.align = Align.Left;
title.outline = 3.0;
title.char_size = font_size;

local title2 = title_surf.add_text( "Atari 2600", 10, font_size*2, title_surf.width, title_surf.height );
title2.align = Align.Left;
title2.char_size = font_size;
title2.outline = 3.0;

See if you can recreate your bug in a stand-alone layout (outside of STP) and post that.

Chadnaut avatar Jan 24 '25 04:01 Chadnaut

@yarondotan Is this still an issue?

oomek avatar Jul 06 '25 23:07 oomek

Took me a while to replicate this issue but I finally nailed it. I'm in the ZONE today.

Chadnaut avatar Oct 17 '25 14:10 Chadnaut