Page 1 of 1

Problem with Scaling Text

Posted: Mon Jan 11, 2016 6:44 am
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))

Re: Problem with Scaling Text

Posted: Mon Jan 11, 2016 6:34 pm
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.