i have a project with views with all the elements inside without other containers (Only Root);
! [Project | 273x383] (upload: //bh7FLzFcCGoU2HTcfg7jMZWqML8.png)
i tried to make this view in “Percent” mode, to make it flexible between screens. The components shrink perfectly from img 1 to img 2 as you can see, but the text stays on the same size.
How can i make the text larger or smaller based on page’s size?
I have to put the text in another container? There’s a global option that i’m missing? Is it possible to resize live the text format?
I think you will be much happier if you learn the fundamentals of the Flex Container. This is a great place for one, it’s built for exactly what you’re looking for (and will do it better and easier than coordinate percent too)
In regards to the sizing, I think you’re looking for a style class with a media query.
Or you could try setting your font size in ‘em’ instead of ‘px’, that way it’s relative to its parent containers size.
i can’t switch to Flex because my pages layout use different shapes, and i cannot configurate them on a flex container.
The Style class with media query is not working because i need to change live the value of the font, and not to change it at prefixed values.
I tried to change the font size value to em, but that is not resizing. It stays exactly like is it.
My goal is to maintain the label/component proportion: with this logic i expected that the text highlighted in yellow won’t exceed it’s space, and the text inside the orange label would shrink to stay inside the label without disappear, but it’s not working.
Is there a built in feature?
The solution here is to use nested flex containers, if you take a look at the Adhoc trends page on the Ignition Exchange, it is a really good example of how to do what you’re looking for.
Are you describing making the font smaller when it exceeds the bounds of the box?
Yes, i need to make the font smaller so it can stay inside the box (smaller, but with its right proportions)
I have created an example, i need to see the top text (e.g. font size 4) when my screen is smaller, and my bottom text (e.g. font size 8) when is bigger.
Assuming your view is a coordinate container, drag the file from your computer and drop it on a view in ignition perspective designer. When the ‘Link Image’ windows pops up select the ‘Embed Image’ option. Now you have some svg text in your view. Change the views root property mode to percent.
Now if you embed that view somewhere else the svg text will scale.
I’m not 100% on the svg code but it’s pretty straightforward to manipulate.
Definitely something for flex containers. As Keith suggested, you should familiarise yourself with the different container types, as how you would do something in Vision is almost guaranteed not how you would do it in Perspective. I use coord containers sparingly, only when absolutely necessary (p&id mimic layouts and device symbol templates). I use mostly flex and column containers for my content and breakpoint containers as the base of my main pages so that I can control how they display in mobile and desktop.
Edit: additionally, I would suggest learning some basic CSS as well. Understanding margins and padding would be my first suggestion
Best imo to use rem as it relates directly to the root font size
Edit 2yrs later:
I never use rem anymore , I use clamp(4pt, calc(0.8*(1.0vmin + 1.0vmax)), 100pt)
Adjust the values 4px, 0.8, and 100px to suit.
Edit3: 4 more months later...
Note that you should combine this with an 'orientation' media query to handle portrait orientations as well for mobile phone use