Created attachment 143040 [details] the icon SUMMARY Weird word wrap in desktop icon label STEPS TO REPRODUCE I have a desktop shortcut for GNU TeXmacs. The label below its icon has a weird word wrap. OBSERVED RESULT Word wrap breaks "TeXmacs" into "Te" and "Xmacs". (see the attachment) EXPECTED RESULT The word should not be broken. SOFTWARE/OS VERSIONS Linux/KDE Plasma: (available in About System) KDE Plasma Version: 5.23.1 KDE Frameworks Version: 5.87.0 Qt Version: 5.15.2 ADDITIONAL INFORMATION none
How should it be displayed instead, given the horizontal space limitations depicted in your screenshot?
Created attachment 143356 [details] comparison
(In reply to Nate Graham from comment #1) > How should it be displayed instead, given the horizontal space limitations > depicted in your screenshot? I've added a new screenshot. As you can see in the new screenshot, compared to the text "Studio Code" , the shorter text "TeXmacs" obviously does not need a word break. It was fine before I updated the OS (Archlinux) in October 31st.
Oh, I know what caused this: it was the new code to try to word-wrap lines at CamelCase characters. Evidently it doesn't try to wrap at whitespace first, as it probably should. See https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/554 and https://invent.kde.org/frameworks/kcoreaddons/-/merge_requests/132 Ivan, can you take a look?
What can I say, huh... The app name is a quite unusual mix of upper and lowercase letters. I can't think of any good solution to make it work for everyone. I could suggest renaming your shortcut to just "TeXmacs" (without GNU prefix to make it fit in one line), or reverting my patch for everyone. We _could_ use some heuristics like whitelist dictionary, or not breaking on short subwords (e.g. 3 letters or less). Not idea how much better would that be in practice.
Is there any way we can have it prefer whitespace wrap when both whitespace and camelcase wrap possibilities exist? I.e., we do: GNU TeXmacs instead of: GNU Te Xmacs
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kcoreaddons/-/merge_requests/402
Git commit d012be6e990bc8728ed0cfca2a77f6fcc0b8357b by ivan tkachenko. Committed on 28/11/2023 at 23:51. Pushed by ratijas into branch 'master'. KStringHandler: Don't insert ZWSP between camelCase sub-words if string has whitespaces Fixes application names like "GNU TeXmacs" which could have inappropriately wrap in the middle of a stylized word. Amends 98f5abc533c95e815742de4fe532b2920c5f6982 M +9 -0 autotests/kstringhandlertest.cpp M +17 -2 src/lib/text/kstringhandler.cpp https://invent.kde.org/frameworks/kcoreaddons/-/commit/d012be6e990bc8728ed0cfca2a77f6fcc0b8357b