General Discussions
GUIText Font Scaling

When dealing with a GUIText inside of a widget I can see from the help document that there is the Options section that allows for control of font size. The only issue I have is that the options are for;

  • no change
  • change based off vertical scaling of the page
  • scale to topmost scaling, ie. the page

I am trying to get a GUIText to scale inside of a widget so that I can change the widget dimensions and have the text font scale with it. This way I don't have to build 20+ widgets to cover all the different font sizes that I may or may not need.

As far as I can find the font will scale to the page or not at all and that is about it for options. If there is something I am missing could someone please let me know. Or if they have sorted out a way to get the text font size to change in accordance with the widget size. Below is an example, the top box is the original, and the one below is the widget resized, but the text does not scale with it. I have been getting more and more requests to have different sizing of the same widgets and it would be nice to have one universal widget that I could use and not have to create a new one each time for a new size.

63613ca30f8c5

When dealing with a GUIText inside of a widget I can see from the help document that there is the _Options_ section that allows for control of font size. The only issue I have is that the options are for; - no change - change based off vertical scaling of the page - scale to topmost scaling, ie. the page I am trying to get a GUIText to scale inside of a widget so that I can change the widget dimensions and have the text font scale with it. This way I don't have to build 20+ widgets to cover all the different font sizes that I may or may not need. As far as I can find the font will scale to the page or not at all and that is about it for options. If there is something I am missing could someone please let me know. Or if they have sorted out a way to get the text font size to change in accordance with the widget size. Below is an example, the top box is the original, and the one below is the widget resized, but the text does not scale with it. I have been getting more and more requests to have different sizing of the same widgets and it would be nice to have one universal widget that I could use and not have to create a new one each time for a new size. ![63613ca30f8c5](serve/attachment&path=63613ca30f8c5)

To change this globally, go to your application Settings -> Edit Properties (Advanced) then copy ScaleDisplayContent and set the new value equal to 1 (True). This will add the property to your application layer which will override the OEM layer property.

This will cause all GUIText to scale with the scale of the parent widget. If you don't want to do this globally, you can always change the widget code to only affect specific objects:

Replace PickValid(\ScaleDisplayContent, 0) with 1 {True} in the code below for text which should scale. For existing widgets, the process may be slightly more involved, but hopefully, this will get you started.

GUIText(22, 54, 162, 19,
          1, 1, 1, 1, 1 { Scaling              },
          0, 0          { Movement             },
          1, PickValid(\ScaleDisplayContent, 0) { Visibility, Font Scaling },
          0, 0, 0       { Selectability        },
          Brush("<00000000>", 0, 1), Pen("<FF000000>", 1, 1),
          [<MediumFont>],
          0, 4,
          "%s",
          \GetPhrase("fo005HWec"));
To change this globally, go to your application Settings -&gt; Edit Properties (Advanced) then copy ScaleDisplayContent and set the new value equal to 1 (True). This will add the property to your application layer which will override the OEM layer property. This will cause all GUIText to scale with the scale of the parent widget. If you don&#039;t want to do this globally, you can always change the widget code to only affect specific objects: Replace **PickValid(\ScaleDisplayContent, 0) with 1 {True}** in the code below for text which should scale. For existing widgets, the process may be slightly more involved, but hopefully, this will get you started. ```` GUIText(22, 54, 162, 19, 1, 1, 1, 1, 1 { Scaling }, 0, 0 { Movement }, 1, PickValid(\ScaleDisplayContent, 0) { Visibility, Font Scaling }, 0, 0, 0 { Selectability }, Brush(&quot;&lt;00000000&gt;&quot;, 0, 1), Pen(&quot;&lt;FF000000&gt;&quot;, 1, 1), [&lt;MediumFont&gt;], 0, 4, &quot;%s&quot;, \GetPhrase(&quot;fo005HWec&quot;)); ````

Trihedral Engineering Ltd.

Hello Dave,

Thanks for the response. I do already have the ScaleDisplayContent set to 1 for my project, and I am looking to do it on a per widget basis. The code you sent will work for a GUIText, but when I look at the code for the premade widget 'Numeric Value' the code is a bit different. It is set into a GUITransform and the 'options' section of the GUITransform are for Bits. The Bit 1 (2^1) marks the transformas a GUIStretch, but when I added it into the code it did not do anything.

**Edit: I have found out how the bit function works (had to call in a programmer) and when I got it working the text after scaled up is very blurry and unusable. Is there a way to counter this?

Hello Dave, Thanks for the response. I do already have the ScaleDisplayContent set to 1 for my project, and I am looking to do it on a per widget basis. The code you sent will work for a GUIText, but when I look at the code for the premade widget &#039;Numeric Value&#039; the code is a bit different. It is set into a GUITransform and the &#039;options&#039; section of the GUITransform are for Bits. The Bit 1 (2^1) marks the transformas a GUIStretch, but when I added it into the code it did not do anything. **Edit: I have found out how the bit function works (had to call in a programmer) and when I got it working the text after scaled up is very blurry and unusable. Is there a way to counter this?
edited Nov 14 '22 at 6:33 pm

I don't think what you want/expect is possible with VTScada.

Getting reasonably crisp graphics, text, and pixel-perfect alignment is hard enough before throwing in scaling, and I've never been able to get them to look anywhere near as crisp as a certain other popular upcoming platform.

I've just picked the largest acceptable font size for things and designed screens with the intent that the font size will never scale.

I don&#039;t think what you want/expect is possible with VTScada. Getting reasonably crisp graphics, text, and pixel-perfect alignment is hard enough before throwing in scaling, and I&#039;ve never been able to get them to look anywhere near as crisp as a certain other popular upcoming platform. I&#039;ve just picked the largest acceptable font size for things and designed screens with the intent that the font size will never scale.
edited Nov 14 '22 at 8:30 pm

Hello Michael,

Thanks for the heads up. It would be nice to have something because when I have to resize the widgets for different numbers that needs different sizes it would be nice.

I might work with a programmer and see if we can come up with a script to resize text with some calculations or something.

Hello Michael, Thanks for the heads up. It would be nice to have something because when I have to resize the widgets for different numbers that needs different sizes it would be nice. I might work with a programmer and see if we can come up with a script to resize text with some calculations or something.

That'd be interesting to see.

I think in theory it's possible, but not only would you need custom code in every screen, you may need custom code on every text reference, as Fonts are tags, so you'd need a way to dynamically link to another tag on each text element.

That&#039;d be interesting to see. I think in theory it&#039;s possible, but not only would you need custom code in every screen, you may need custom code on every text reference, as Fonts are tags, so you&#039;d need a way to dynamically link to another tag on each text element.

I think it is possible as well. I will have to see what would require some scripting and what extra modules might have to happen to get it to work.

Fingers Crossed.

I think it is possible as well. I will have to see what would require some scripting and what extra modules might have to happen to get it to work. Fingers Crossed.
93
6
3
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft