2021-04-24 11:56 AM
Currently it seems that text can only be rotated by a multiple of 90 °. In a current project, however, I have a customer requirement that text must be rotated by any angle, since the display must be mounted rotated. What would be the best approach to implement this in the current circumstances?
Solved! Go to Solution.
2021-05-05 01:38 AM
Hi,
Here is a demo I made a while back using a custom widget called TextArc which can rotate a text at any angle but also around a circle or a curve. Have a look at the implementation in Screen1View.cpp/hpp and at the code of the widget in TextArc.cpp/hpp in the TouchGFX/widgets folder. The demo was made for a STM32L4R9-dk board but that doesn't change anything in the code :thumbs_up:
Since this is a custom widget you will not be able to see it in TouchGFX Designer, which is why I use what I call "dummies" (the red circle and box) to help me set the coordinates and angles.
/Romain
2021-04-27 05:27 AM
Hi,
Is the text already known and will not change ? With this scenario you take an image of the text and use it with a texture mapper widget.
Otherwise I have a custom widget that does this but I am not 100% sure I can share it, I need to check.
/Romain
2021-05-04 09:13 AM
Hi,
thank you very much for your reply! In my current implementation I am using images of the text and rotate it with a texture mapper widget, exactly as you suggested. But this is not a good solution, especially since I am dealing with instances of the TextAreaWithOneWildcard class (so dyanmic text), and because the angle must be adjustable. So my first thought was that it might be possible to access the pixel data of the TextArea instance directly, rotate it with the use of a suitable rotational matrix and write it directly to the framebuffer (or a dynamic bitmap, or whatever the suitable approach would be). I would be very grateful for any help.
Ulrich
2021-05-05 01:38 AM
Hi,
Here is a demo I made a while back using a custom widget called TextArc which can rotate a text at any angle but also around a circle or a curve. Have a look at the implementation in Screen1View.cpp/hpp and at the code of the widget in TextArc.cpp/hpp in the TouchGFX/widgets folder. The demo was made for a STM32L4R9-dk board but that doesn't change anything in the code :thumbs_up:
Since this is a custom widget you will not be able to see it in TouchGFX Designer, which is why I use what I call "dummies" (the red circle and box) to help me set the coordinates and angles.
/Romain
2021-05-10 08:47 AM
Dear Romain,
thank you very much for your help! Hope these features will find their way into the framework.
Ulrich
2021-05-10 11:29 PM
I'm pushing for it ;)
/Romain
2022-07-22 07:01 AM
@Romain DIELEMAN
This is a pretty cool widget. Great job!
I second the vote to get it into the designer/framework.