Bug 420471 - SVG Text tool loses whitespace when the run of similarly-formatted text is only whitespace
Summary: SVG Text tool loses whitespace when the run of similarly-formatted text is on...
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Tool/Text (show other bugs)
Version: 4.2.9
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-23 17:06 UTC by Chris Morgan
Modified: 2023-08-08 19:13 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Morgan 2020-04-23 17:06:21 UTC
SUMMARY
SVG Text tool loses whitespace when the run of similarly-formatted text is only whitespace

STEPS TO REPRODUCE
1. Open the SVG Text tool and end up in the Edit Text window.
2. Enter two words, separated by a space.
3. Make the first word bold.
4. Make the second word bold.
5. Switch to the SVG Source tab.
6. Switch back to the Rich text tab.

Alternatively for steps 2–5, go to the SVG Source tab and paste one of these sets of markup:

    <text><tspan x="0"><tspan style="font-weight:600">one</tspan> <tspan style="font-weight:600">two</tspan></text>

    <text>one<tspan style="fill:red"> </tspan>two</text>

OBSERVED RESULT
The space is lost.

EXPECTED RESULT
The space should be preserved.

SOFTWARE/OS VERSIONS
Windows 10.0.19041, 64-bit

ADDITIONAL INFORMATION
I tried to work around this by using a non-breaking space, adding xml:space="preserve", wrapping the text node in <tspan>, with or without formatting. None of these worked; all that works is putting the space in with another run of formatted text.
Comment 1 Ahab Greybeard 2020-04-24 11:17:53 UTC
I've noticed that multiple spaces, entered in the text editor or the SVG editor are converted to single spaces after saving and reopening.
Comment 2 Alvin Wong 2023-08-08 19:13:33 UTC
Fixed by https://invent.kde.org/graphics/krita/-/merge_requests/1885