Docs: add info about text stroking

This commit is contained in:
Noah Sweilem 2024-04-08 10:20:28 -07:00 committed by Simon Hausmann
parent 15b8e6c9fa
commit e62f75cfd1
2 changed files with 6 additions and 1 deletions

View file

@ -16,6 +16,7 @@ All notable changes to this project are documented in this file.
## Slint Language ## Slint Language
- Text: Added `stroke`, `stroke-width`, and `stroke-style` properties.
- Added `Colors.hsv()` method to create colors in the HSV color space. - Added `Colors.hsv()` method to create colors in the HSV color space.
- Added `to-hsv()` function to color. - Added `to-hsv()` function to color.
- Throw an error when `rgb()` or `argb()` have too many arguments. - Throw an error when `rgb()` or `argb()` have too many arguments.

View file

@ -712,7 +712,8 @@ export component Example inherits Window {
## `Text` ## `Text`
The `Text` element is responsible for rendering text. Besides the `text` property, that specifies which text to render, The `Text` element is responsible for rendering text. Besides the `text` property, that specifies which text to render,
it also allows configuring different visual aspects through the `font-family`, `font-size`, `font-weight` and `color` properties. it also allows configuring different visual aspects through the `font-family`, `font-size`, `font-weight`, `color`, and
`stroke` properties.
The `Text` element can break long text into multiple lines of text. A line feed character (`\n`) in the string of the `text` The `Text` element can break long text into multiple lines of text. A line feed character (`\n`) in the string of the `text`
property will trigger a manual line break. For automatic line breaking you need to set the `wrap` property to a value other than property will trigger a manual line break. For automatic line breaking you need to set the `wrap` property to a value other than
@ -733,6 +734,9 @@ and the text itself.
- **`text`** (_in_ _[string](../syntax/types.md#strings)_): The text rendered. - **`text`** (_in_ _[string](../syntax/types.md#strings)_): The text rendered.
- **`vertical-alignment`** (_in_ _enum [`TextVerticalAlignment`](enums.md#textverticalalignment)_): The vertical alignment of the text. - **`vertical-alignment`** (_in_ _enum [`TextVerticalAlignment`](enums.md#textverticalalignment)_): The vertical alignment of the text.
- **`wrap`** (_in_ _enum [`TextWrap`](enums.md#textwrap)_): The way the text wraps (default value: `no-wrap`). - **`wrap`** (_in_ _enum [`TextWrap`](enums.md#textwrap)_): The way the text wraps (default value: `no-wrap`).
- **`stroke`** (_in_ _brush_): The brush used for the text outline (default value: `transparent`).
- **`stroke-width`** (_in_ _length_): The width of the text outline. If the width is zero, then a hairline stroke (1 physical pixel) will be rendered.
- **`stroke-style`** (_in_ _enum [`TextStrokeStyle`](enums.md#textstrokestyle)_): The style/alignment of the text outline (default value: `outside`).
### Example ### Example