diff options
| author | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2025-09-04 14:26:38 +0200 |
|---|---|---|
| committer | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2025-09-05 18:38:17 +0200 |
| commit | 815cd44fbb6497a0551a24578ad9a63bfce8531a (patch) | |
| tree | 87c88ec5e0d633a4ca789a772710e578e53f0025 | |
| parent | fbd10cac80ffa1d59b58f553926d39e3c89aaa48 (diff) | |
Doc: Add some notes about PathText usage in Quick Shapes
Note the expected fill rule, as defined by TrueType, and explain that
if the stroked outline looks bad, it's the font's fault.
Pick-to: 6.10
Change-Id: I8c4c7d319c96d2514c3b11f27a7e85b7c408a79d
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
| -rw-r--r-- | examples/quick/quickshapes/shapes/text.qml | 1 | ||||
| -rw-r--r-- | src/quick/util/qquickpath.cpp | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/examples/quick/quickshapes/shapes/text.qml b/examples/quick/quickshapes/shapes/text.qml index 8a105fb254..da19fc8f7d 100644 --- a/examples/quick/quickshapes/shapes/text.qml +++ b/examples/quick/quickshapes/shapes/text.qml @@ -19,6 +19,7 @@ Rectangle { strokeColor: "black" strokeWidth: 1 fillColor: "black" + fillRule: ShapePath.WindingFill PathText { x: 0 diff --git a/src/quick/util/qquickpath.cpp b/src/quick/util/qquickpath.cpp index bc7b6eeb7b..8843dc9f39 100644 --- a/src/quick/util/qquickpath.cpp +++ b/src/quick/util/qquickpath.cpp @@ -3113,6 +3113,13 @@ void QQuickPathMultiline::addToPath(QPainterPath &path, const QQuickPathData &) baseline will be translated to the x and y coordinates, and the outlines from the font will be added to the path accordingly. + When used to render texts in a Shape item, note the following: + \list + \li For correct fill, the ShapePath's fillRule should be set to ShapePath.WindingFill. + \li Not all fonts provide a nice outline suitable for stroking. If you want a stroked + outline and are getting unsatisfactory results, try a different font. + \endlist + \qml PathText { x: 0 |
