Problem with Scaling Text

Report any Hollywood bugs here
Post Reply
PEB
Posts: 567
Joined: Sun Feb 21, 2010 1:28 am

Problem with Scaling Text

Post by PEB »

Is there a reason why I can't get this text to scale to a width of 277?

Code: Select all

EnableLayers()
TextOut (20, 20, "Test Block Of Text", {Name="Text"})
SetLayerStyle("Text", {FontSize=76, Font=#SANS})
DebugPrint(GetAttribute(#LAYER, "Text", #ATTRRAWWIDTH))
WaitLeftMouse()
;SetLayerStyle("Text", {ScaleX=0.5})
;SetLayerStyle("Text", {Width="50%"})
SetLayerStyle("Text", {Width=277})
DebugPrint(GetAttribute(#LAYER, "Text", #ATTRRAWWIDTH))
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Problem with Scaling Text

Post by airsoftsoftwair »

Yes. The reason is that vector text is scaled using floating point coefficients which means that it's not possible to set a fixed pixel size. The pixel size you specify is just an approximation. The final size can always be a few pixels off. The same is true for layers for type #VECTORPATH.
Post Reply