mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 18:58: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
13
internal/compiler/tests/syntax/elements/text.slint
Normal file
13
internal/compiler/tests/syntax/elements/text.slint
Normal file
|
@ -0,0 +1,13 @@
|
|||
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
|
||||
|
||||
export component Foo inherits Rectangle {
|
||||
Text {
|
||||
font-metrics: 42;
|
||||
// ^error{Cannot assign to output property 'font-metrics'}
|
||||
// ^^error{Cannot convert float to slint::private_api::FontMetrics}
|
||||
|
||||
}
|
||||
|
||||
property <length> font-metrics: 100px;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue