TextOut layer and BorderColor

Discuss any general programming issues here
Post Reply
Flinx
Posts: 188
Joined: Sun Feb 14, 2021 9:54 am
Location: Germany

TextOut layer and BorderColor

Post by Flinx »

While experimenting with text objects, I noticed that when the text is semi-transparent, the border color is partially used as font color. Is this a bug?
Also, the program crashes when BorderColor gets an ARGB value.

Code: Select all

@DISPLAY {Width = 650, Height = 400, Color = #GRAY, Layers = True}
SetFont(#SERIF, 400)
SetFontColor(#GRAY)
SetFontStyle(#BORDER, {BorderColor=$ff00ff, BorderSize=3})
;SetFontStyle(#BORDER, {BorderColor=ARGB(128, $ff00ff), BorderSize=3}) ;crash
TextOut(#CENTER, #CENTER, "T", {Name="T1", Transparency=0})
For i=0 To 255
	SetLayerStyle("T1", {Transparency=i})
	Wait(3)
Next
User avatar
airsoftsoftwair
Posts: 5425
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: TextOut layer and BorderColor

Post by airsoftsoftwair »

Flinx wrote: Sun Nov 28, 2021 2:28 pm While experimenting with text objects, I noticed that when the text is semi-transparent, the border color is partially used as font color. Is this a bug?
That's actually a feature. I could easily fix it for your case but I don't want to do that because Hollywood uses different kinds of border creation algorithms and I could only fix for your case but not for the others so we'd end up with inconsistencies then which is why I want to leave it the way it is.

The crash is of course a bug and is fixed now.

Code: Select all

- Fix: Crash when using border transparency on a non-antialiased text layer
Flinx
Posts: 188
Joined: Sun Feb 14, 2021 9:54 am
Location: Germany

Re: TextOut layer and BorderColor

Post by Flinx »

That wasn't necessarily a request for a fix, I just always ask when I think something is odd.
At least that is not what I would expect when an argument is called transparency.
Maybe you should mention the behavior in the documentation.
Flinx
Posts: 188
Joined: Sun Feb 14, 2021 9:54 am
Location: Germany

Re: TextOut layer and BorderColor

Post by Flinx »

By the way, thanks for mentioning non-antialiasing. For some reason I don't remember, I assumed antialias would not work with my textout layers. Probably I had done something wrong.
User avatar
airsoftsoftwair
Posts: 5425
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: TextOut layer and BorderColor

Post by airsoftsoftwair »

Flinx wrote: Sun Dec 12, 2021 10:43 am Maybe you should mention the behavior in the documentation.
The problem is that the behaviour is not consistent. For graphics primitives layers you should get a better border, that's why this is currently not mentioned in the doc :)
Post Reply