Bug 409243

Summary: Krita 4.2.2 Text Tool Font Bug
Product: [Applications] krita Reporter: kaisaki1342
Component: Tool/TextAssignee: Dmitry Kazakov <dimula73>
Status: RESOLVED FIXED    
Severity: normal CC: ahab.greybeard, halla
Priority: NOR Keywords: regression
Version: unspecified   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:

Description kaisaki1342 2019-06-27 12:18:52 UTC
SUMMARY
VERSION 4.2.2 [Newest as of 6/27/2019] 

Text tool font bug. 
If everything is erase the text on the text box and then type again the text font on the canvas reset to default system font[MS Shell] 
while the one on text box does not change.

STEPS TO REPRODUCE
1. Add text 
2. Edit / erase all the test
3. type again and save
3.1 or save then type again and save

https://youtu.be/2-e1SbDk_yc

OBSERVED RESULT
Font on canvas defaults to system font
Font on text input box does not change

EXPECTED RESULT
Font on the canvas matches that of the input box, Should not change. 



SOFTWARE/OS VERSIONS
Windows: Win 10 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Ahab Greybeard 2019-06-28 08:14:54 UTC
I can confirm this with appimage testing from 4.2.2 onwards to the latest nightly build.

In 4.1.7 and 4.2.1, when the last text character is deleted, the font, size and colour are 'reset' and these changes are shown in the text editing window.
In my case, the font is reset to Sans Serif (which is not my default system font).

For 4.2.2 onwards, the font reset happens but is not indicated in the text editing window, the stated font stays the same but text is then saved as Sans Serif on the canvas - hence the bug report.

Staying in the text editing window, the stated font can be then changed to another font and this change will work when saved.

Also, the size reset is not indicated which results in an unexpected size change on saving.
Comment 2 Halla Rempt 2019-06-28 10:29:29 UTC
Dmitry, this is probably caused by your commit:

commit 4664bf09c2991c70cc240e6d3428c7b92cd61d62 (refs/imerge/master/manual/0-41)
Author: Dmitry Kazakov <dimula73@gmail.com>
Date:   Thu Jun 13 15:37:51 2019 +0300

    Make sure the text style is not reset when we remove the last character
    
    Just set default document style to the lastly used font
    
    BUG:408441

Can you take a look?
Comment 3 Dmitry Kazakov 2019-08-05 17:32:59 UTC
Git commit 3540f1ae199ff88f56b1df56f2b5a4b9111f6f75 by Dmitry Kazakov.
Committed on 05/08/2019 at 17:32.
Pushed by dkazakov into branch 'master'.

Properly fix font resetting when all the text in the editor removed

When removing the last block of the text, we should make sure that the
cursor has the format set (it is automatically reset to the default).

M  +36   -7    plugins/tools/svgtexttool/SvgTextEditor.cpp
M  +2    -0    plugins/tools/svgtexttool/SvgTextEditor.h

https://invent.kde.org/kde/krita/commit/3540f1ae199ff88f56b1df56f2b5a4b9111f6f75
Comment 4 Dmitry Kazakov 2019-08-14 16:41:49 UTC
Git commit ca4e1fef54ee7e7db15e1f60007771336b536c02 by Dmitry Kazakov.
Committed on 14/08/2019 at 16:21.
Pushed by dkazakov into branch 'krita/4.2'.

Properly fix font resetting when all the text in the editor removed

When removing the last block of the text, we should make sure that the
cursor has the format set (it is automatically reset to the default).

M  +36   -7    plugins/tools/svgtexttool/SvgTextEditor.cpp
M  +2    -0    plugins/tools/svgtexttool/SvgTextEditor.h

https://invent.kde.org/kde/krita/commit/ca4e1fef54ee7e7db15e1f60007771336b536c02