Quote from
Vadim on May 20, 2021, 2:39 pm
@lolo
If you need to increase the font of objects, regardless of what size and other properties it had, then you can do it like this (suppose there are three objects). Using this code, first we get the font properties, then we add one item to the font size and overwrite the font properties by changing only its size.
SetVar "[ObjectsCount]" "3"
Loop "1" "[ObjectsCount]" "[i]"
GetObjectInfo "Object[i]" "FontColor" "[FontColor]"
GetObjectInfo "Object[i]" "FontName" "[FontName]"
GetObjectInfo "Object[i]" "FontSize" "[FontSize]"
GetObjectInfo "Object[i]" "FontStyle" "[FontStyle]"
GetObjectInfo "Object[i]" "FontCharSet" "[FontCharSet]"
SetVar "[FontSize]" "[FontSize]+1"
SetObjectFont "Object[i]" "[FontColor]" "[FontName]" "[FontSize]" "[FontStyle]" "[FontCharSet]"
EndLoop
In the attached demo, press the Start button to increase the font by one point.
@lolo
If you need to increase the font of objects, regardless of what size and other properties it had, then you can do it like this (suppose there are three objects). Using this code, first we get the font properties, then we add one item to the font size and overwrite the font properties by changing only its size.
SetVar "[ObjectsCount]" "3"
Loop "1" "[ObjectsCount]" "[i]"
GetObjectInfo "Object[i]" "FontColor" "[FontColor]"
GetObjectInfo "Object[i]" "FontName" "[FontName]"
GetObjectInfo "Object[i]" "FontSize" "[FontSize]"
GetObjectInfo "Object[i]" "FontStyle" "[FontStyle]"
GetObjectInfo "Object[i]" "FontCharSet" "[FontCharSet]"
SetVar "[FontSize]" "[FontSize]+1"
SetObjectFont "Object[i]" "[FontColor]" "[FontName]" "[FontSize]" "[FontStyle]" "[FontCharSet]"
EndLoop
In the attached demo, press the Start button to increase the font by one point.
Uploaded files:- You need to login to have access to uploads.
luishp and proforma.guyot have reacted to this post.