mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-03 18:29:09 +00:00

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
13 lines
450 B
Text
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;
|
|
}
|