Details
-
Suggestion
-
Resolution: Done
-
P3: Somewhat important
-
5.7
-
None
-
659d5202f915b84bd22b618b0696bbe68ab4b6b0
Description
With the following example
Text { width: ... height: ... fontSizeMode: Text.Fit font.pixelSize: 100 }
there's no way of knowing what the actual font size used is. This feature would be useful when you want another Text item that has the same font size as the calculated one. For example, see the attached picture. Each block is a Text item with its width and height set (e.g. in a row). The "italic" and "bold" text has different styling/font family and may even be animated, so it can't be a part of the same Text item. Currently there's no way to match the "italic" and "bold" font sizes to the "Normal text".
The code would look something like this:
Row { Text { id: normalText text: "normalText" width: ... height: ... fontSizeMode: Text.Fit font.pixelSize: 100 } Text { text: "italic" width: ... height: ... font.family: "Some Font" font.pixelSize: normalText.effectiveFontPixelSize } Text { text: "bold" width: ... height: ... font.family: "Some Other Font" font.pixelSize: normalText.effectiveFontPixelSize } }
Attachments
Issue Links
- is duplicated by
-
QTBUG-51133 Be able to determine which font size is actually being used when Text.fontSizeMode is effectiveSize
-
- Closed
-