slint/internal/compiler/tests/syntax/elements/text.slint
Simon Hausmann 0b028bfb6f
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
2024-10-05 17:00:46 +02:00

13 lines
450 B
Text

// 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;
}