Page 1 of 1

[15 Mar 2009] Another Bug with SetLayerStyle()---Changing Font Size

Posted: Sat Jun 13, 2020 5:32 pm
by PEB
Note: This is an archived post that was originally sent to the Hollywood mailing list on Sun, 15 Mar 2009 11:07:44 -0000

Hi Andreas,

I just noticed another bug that at least shows up with OS 4.1. If a font is first set with SetFont(), the size of the font cannot be changed with SetLayerStyle() unless the font is first changed to a different one. The following code shows the problem:

Code: Select all

EnableLayers()
SetFont("DejaVu Sans Bold.font", 16)
CreateTextObject(1, "This is a test")
DisplayTextObject(1, #CENTER, #CENTER)
WaitLeftMouse()
;SetLayerStyle(1, {Font="DejaVu Sans Bold.font", FontSize=40})
SetLayerStyle(1, {FontSize=40})
WaitLeftMouse()
SetLayerStyle(1, {Font="DejaVu Sans.font"})
SetLayerStyle(1, {FontSize=40})
After the first mouse press, nothing changes, and it doesn't matter if the same font is declared again in the SetLayerStyle() call. However, if SetLayerStyle() is used to change the font, then the font can be resized.

[17 Mar 2009] Re: Another Bug with SetLayerStyle()---Changing Font Size

Posted: Sat Jun 13, 2020 5:32 pm
by airsoftsoftwair
Note: This is an archived post that was originally sent to the Hollywood mailing list on Tue, 17 Mar 2009 10:16:39 +0100
Hi Andreas,

I just noticed another bug that at least shows up with OS 4.1. If a font is first set with SetFont(), the size of the font cannot be changed with SetLayerStyle() unless the font is first changed to a different one. The following code shows the problem:

Code: Select all

EnableLayers()
SetFont("DejaVu Sans Bold.font", 16)
CreateTextObject(1, "This is a test")
DisplayTextObject(1, #CENTER, #CENTER)
WaitLeftMouse()
;SetLayerStyle(1, {Font="DejaVu Sans Bold.font", FontSize=40})
SetLayerStyle(1, {FontSize=40})
WaitLeftMouse()
SetLayerStyle(1, {Font="DejaVu Sans.font"})
SetLayerStyle(1, {FontSize=40})
After the first mouse press, nothing changes, and it doesn't matter if the same font is declared again in the SetLayerStyle() call. However, if SetLayerStyle() is used to change the font, then the font can be resized.
Thanks for the report. That's fixed now, too.