With this SVG: ```svg <text text-rendering="auto" fill="#000000" stroke-opacity="0" stroke="#000000" stroke-width="0" stroke-linecap="square" stroke-linejoin="bevel" letter-spacing="0" word-spacing="0" style="inline-size: 84.88;text-align: start; text-align-last: auto;font-family: Noto Sans;font-size: 9; white-space: pre-wrap;"><tspan>Alpha Bravo Charlie Delta Echo</tspan></text> ``` In Krita, the word "Charlie" is soft wrapped onto the second line. However, there is still enough room on the first line to place the word "Charlie" so the soft wrap should only happen after it. (See screenshot.) CSS Text Module Level 3 §4.1.2 (https://www.w3.org/TR/css-text-3/#white-space-phase-2) states: > 4. If there remains any sequence of white space, other space separators, > and/or preserved tabs at the end of a line [...]: > - If `white-space` is set to `normal`, `nowrap`, or `pre-line`, the UA > must hang this sequence (unconditionally). > - If `white-space` is set to `pre-wrap`, the UA must (unconditionally) > hang this sequence, unless the sequence is followed by a forced line > break, in which case it must conditionally hang the sequence instead. > It may also visually collapse the character advance widths of any that > would otherwise overflow. > [...] See also Example 9.
Created attachment 160638 [details] Screenshot
right the fundamental problem is that the white-space doesn't 'hang'.
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/1894
Git commit fe677d9b57085c60f1a1f937bf32a98738ec2df5 by Wolthera van Hövell, on behalf of Wolthera van Hövell tot Westerflier. Committed on 14/08/2023 at 16:34. Pushed by woltherav into branch 'master'. Reimplement !1894, handling the hanging of white-spaces. Original implementation by Alvin Wong, implemented according to css-text-3 section 4.1.2 point 4: https://www.w3.org/TR/css-text-3/#white-space-phase-2 M +31 -0 libs/flake/text/KoCssTextUtils.cpp M +16 -0 libs/flake/text/KoCssTextUtils.h M +33 -8 libs/flake/text/KoSvgTextShape_p_layout.cpp https://invent.kde.org/graphics/krita/-/commit/fe677d9b57085c60f1a1f937bf32a98738ec2df5
Git commit 8a3ed45cd77bd8f134c27739adfb9946f387d59e by Wolthera van Hövell tot Westerflier. Committed on 14/08/2023 at 16:37. Pushed by woltherav into branch 'krita/5.2'. Reimplement !1894, handling the hanging of white-spaces. Original implementation by Alvin Wong, implemented according to css-text-3 section 4.1.2 point 4: https://www.w3.org/TR/css-text-3/#white-space-phase-2 M +31 -0 libs/flake/text/KoCssTextUtils.cpp M +16 -0 libs/flake/text/KoCssTextUtils.h M +33 -8 libs/flake/text/KoSvgTextShape_p_layout.cpp https://invent.kde.org/graphics/krita/-/commit/8a3ed45cd77bd8f134c27739adfb9946f387d59e