Need some information to implement the textView dynamically.
If the x,y are coming as Integer value from device side..
using string length and font size to calculate the text area is not reliable. This is because when rendering text individual glyph metrics and eventual kerning values are taken in account. This is true especially for the so-called proportional font. The best approach is to let Embedded Wizard calculate the size required for a concrete string.
For this purpose the Text view provides methods to calculate the area, the position, etc. of the entire displayed text block or a single text row. See the section: Arrange other views on the content of the Text view. You can perform the calculations also by using methods of the Resources::Font class. See the section: Reference for the Mosaic class Resources::Font.
To configure the position of the Text view dynamically, you use the view's property Bounds. Also possible, the position can be adjusted by modifying the view's property ScrollOffset.
I hope it helps you further.
thanks for the reply,
1. Can I say that to configure the position of the Text view dynamically, I have to use the view's property Bounds. . And In bounds four parameter are needed x1, x2, y1, and y2.
2. How to pass the parameter for bounds , I tried to experiment with following approach
var int32 x1 = 10;var int32 x2 = 60;var int32 y1 = 10;var int32 y2 = 30;
Text.Bounds = <x1 ,y1, x2, y2>;
if you want to use variables, you should use the rect() instant constructor:
Text.Bounds = rect( x1, y1, x2, y2 );
Hi Manfred ,
One more Question
If I have gui component that is changed dynamically by changing the bounds , so other widget like Text view1, Text view2 and vertical list will be scaled automatically . Or i need to calculate and resize them manually.
if your GUI component contains other views and you resize the GUI component, the views within your GUI component can be arranged automatically according to their layout constraints.
All other GUI components beside the one you resize will not arranged or scaled automatically - this have to be implemented according your needs.
please note that Height is an attribute of the font resource - thus it cannot be changed during runtime. All attributes of a font resource have to be defined at design time. Changing the height (or other attributes) of a font resource, requires a new rasterization of the font. The rasterization of fonts is done during code generation (except you are using a True Type Font Engine within the target).
If you want to change the font used by your text views during runtime, you can prepare several font resources and select the font by using the property Font of your text views.
In principle yes - with version 11.00 dynamically configured fonts can be used if the target provides a Platform Package with an external True Type Font Engine.
This is not available for Win32 or WebGL.
Ask Embedded Wizard
Welcome to the question and answer site for Embedded Wizard users and UI developers.
Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!