mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-02 22:54:36 +00:00
Add support for a font-metrics property to Text/TextInput. (#6452)
The struct held provides access to the design metrics of the font scaled to the font pixel size used by the element. ChangeLog: Slint Language: Added font-metrics property to `Text` and `TextInput`. Closes #6047
This commit is contained in:
parent
b41b389e55
commit
0b028bfb6f
36 changed files with 742 additions and 55 deletions
|
@ -784,6 +784,7 @@ When not part of a layout, its width or height defaults to 100% of the parent el
|
|||
- **`font-size`** (_in_ _length_): The font size of the text.
|
||||
- **`font-weight`** (_in_ _int_): The weight of the font. The values range from 100 (lightest) to 900 (thickest). 400 is the normal weight.
|
||||
- **`font-italic`** (_in_ _bool_): Whether or not the font face should be drawn italicized or not. (default value: false)
|
||||
- **`font-metrics`** (_out_ _struct [`FontMetrics`](structs.md#fontmetrics)_): The design metrics of the font scaled to the font pixel size used by the element.
|
||||
- **`has-focus`** (_out_ _bool_): `TextInput` sets this to `true` when it's focused. Only then it receives [`KeyEvent`](structs.md#keyevent)s.
|
||||
- **`horizontal-alignment`** (_in_ _enum [`TextHorizontalAlignment`](enums.md#texthorizontalalignment)_): The horizontal alignment of the text.
|
||||
- **`input-type`** (_in_ _enum [`InputType`](enums.md#inputtype)_): Use this to configure `TextInput` for editing special input, such as password fields. (default value: `text`)
|
||||
|
@ -847,6 +848,7 @@ and the text itself.
|
|||
- **`font-size`** (_in_ _length_): The font size of the text.
|
||||
- **`font-weight`** (_in_ _int_): The weight of the font. The values range from 100 (lightest) to 900 (thickest). 400 is the normal weight.
|
||||
- **`font-italic`** (_in_ _bool_): Whether or not the font face should be drawn italicized or not. (default value: false)
|
||||
- **`font-metrics`** (_out_ _struct [`FontMetrics`](structs.md#fontmetrics)_): The design metrics of the font scaled to the font pixel size used by the element.
|
||||
- **`horizontal-alignment`** (_in_ _enum [`TextHorizontalAlignment`](enums.md#texthorizontalalignment)_): The horizontal alignment of the text.
|
||||
- **`letter-spacing`** (_in_ _length_): The letter spacing allows changing the spacing between the glyphs. A positive value increases the spacing and a negative value decreases the distance. (default value: 0)
|
||||
- **`overflow`** (_in_ _enum [`TextOverflow`](enums.md#textoverflow)_): What happens when the text overflows (default value: clip).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue