Bug 429351 - Copy and paste in editor is losing kerning property
Summary: Copy and paste in editor is losing kerning property
Status: REPORTED
Alias: None
Product: krita
Classification: Applications
Component: Tool/Text (other bugs)
Version First Reported In: 5.0.0
Platform: Appimage Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2020-11-19 15:46 UTC by Awakening
Modified: 2022-08-01 13:47 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Awakening 2020-11-19 15:46:27 UTC
SUMMARY
Kerning property is not carried over, the copy will have kerning enabled regardless of previous setting and GUI toggle will show it disabled.

STEPS TO REPRODUCE
1. Pick a font with kerning support (e.g. Noto Sans)
1. Create a "Placeholder Text" object
2. Disable kerning (via GUI toggle, or by saving the text and reopening the editor if on 4.4.1)
3. Select and copy "Placeholder Text"
4. Paste it on new line
5. Compare "Text" between two lines

OBSERVED RESULT
Pasted text have kerning enabled.

EXPECTED RESULT
Pasted text have kerning disabled.

SOFTWARE/OS VERSIONS
Linux: 5.9.8-arch1-1 
KDE Plasma Version: 5.20.3
KDE Frameworks Version: 5.75.0
Qt Version: 5.15.1

ADDITIONAL INFORMATION
Can be reproduced on 4.4.1, but requires some extra steps due to invalid kerning property handling and lack of GUI toggle, git hashes which fixes that and add the toggle:
- on master: f837e086a5a4fbcff48b15e044e1684912fa2524
- on krita/4.3: 885641566f182ce316b068bb6d4b015cb0c2a55c

GUI toggle not being active is caused by `QTextCharFormat::fontKerning()` in `SvgTextEditor::checkFormat()` reporting `false`, despite copy having kerning enabled.

The copy seems to be using HTML under the hood, and `QTextDocument::toHtml()` doesn't convert kerning.
Comment 1 wolthera 2021-09-08 08:24:02 UTC
I cannot reproduce this anymore in 5.0 beta, is this still relevant?
Comment 2 Awakening 2021-09-09 06:54:30 UTC
Can still reproduce in 5.0.0-beta1 AppImage and current master (b058b377aff035d156e13996b4ffa6f29a5bda9f, 5.15.2 host Qt)
Comment 3 Bug Janitor Service 2021-09-10 04:36:14 UTC
Thanks for your comment!

Automatically switching the status of this bug to REPORTED so that the KDE team
knows that the bug is ready to get confirmed.

In the future you may also do this yourself when providing needed information.