How to adapt PixelSize if Text width is fixed
-
Hello,
I have trouble to do a simple thing.
I have a
Text Component
that cannot have awidth
bigger than 300 (this is an example).
I have a defaultfont.pixelSize
. However, if mytext
has too many characters, I would like to reduce thepixelSize
of it.Example:
Text { ont.pixelSize: 20 text : myText //If Text width > 300, I would like to change font.pixelSize }
Any suggestion ? Thanks a lot
-
Hello,
I have trouble to do a simple thing.
I have a
Text Component
that cannot have awidth
bigger than 300 (this is an example).
I have a defaultfont.pixelSize
. However, if mytext
has too many characters, I would like to reduce thepixelSize
of it.Example:
Text { ont.pixelSize: 20 text : myText //If Text width > 300, I would like to change font.pixelSize }
Any suggestion ? Thanks a lot
-
See Text::fontSizeMode. There's
Text.HorizontalFit
.