Bug 438900 - Text DPI issue on KDE Plasma
Summary: Text DPI issue on KDE Plasma
Status: RESOLVED INTENTIONAL
Alias: None
Product: krita
Classification: Applications
Component: Tool/Text (other bugs)
Version First Reported In: git master (please specify the git hash!)
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Dmitry Kazakov
URL:
Keywords: regression, release_blocker
Depends on:
Blocks:
 
Reported: 2021-06-19 08:01 UTC by Know Zero
Modified: 2021-07-09 05:17 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Know Zero 2021-06-19 08:01:50 UTC
SUMMARY
When you open an krita 4.4.x file in Krita 5 on KDE Plasma 5, it seems to open the files fine. But when you save the files, the font size changes without the user knowing.

The merge request mentions the DPI setting, but most users wouldn't know it exists and would simply find it broken. Not to mention, that setting doesn't work on KDE Plasma for 5.0 saved files. (it works for 4.4.x files in 5.0, but the moment you save them, it won't work anymore)

This doesn't seem to be a problem on Windows or Ubuntu Unity (when testing on VM as the text loaded fine as far as I saw without any changes)

Also a minor issue to note: The tooltip on the DPI gives different messages depending if you hover over the label or the textbox.

STEPS TO REPRODUCE
1. Save a file in Krita 4.4.x while using KDE Plasma 5
2. Open it in Krita 5 and save the file as a new file, then close and reopen it. The fonts are wrong.(you can also just edit the text on the spot and font will change)
3. Change the DPI setting and try again

OBSERVED RESULT
Wrong font size

EXPECTED RESULT
Right font size

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
OpenSuse Leap 15.2 KDE 5.22 (QT 5.15) and Kubuntu 20.04 LTS via VM. X11 sessions for both.

This also happens via the nightly appimage versions (4c233e3).


ADDITIONAL INFORMATION
This is probably related to the fix for Bug 404011.
Comment 1 keyth_qcfx2 2021-06-30 08:04:57 UTC
I am on windows and I have the same issue with Krita 4.4.5 to older krita versions of about a year ago.
Comment 2 Dmitry Kazakov 2021-07-08 10:32:43 UTC
Well, all Krita 4.x versions had a problem with font size. They used display DPI for font rendering, so the font size saved into the file depended on the computer that was used for creating this document.

In Krita 5 I have fixed this problem. On loading it converts the font size into the correct value and saves into the document. Opening this document on any PC with Krita 5.x will show the correct font size whatever the display resolution used.

Sadly, versions of Krita 4.x don't know about this fix, so they will show the document differently after it is saved using Krita 5.

So the solution is: don't open the .kra files with text created with Krita 5 in older versions of Krita :(
Comment 3 Know Zero 2021-07-09 04:22:09 UTC
(In reply to Dmitry Kazakov from comment #2)
> Well, all Krita 4.x versions had a problem with font size. They used display
> DPI for font rendering, so the font size saved into the file depended on the
> computer that was used for creating this document.
> 
> In Krita 5 I have fixed this problem. On loading it converts the font size
> into the correct value and saves into the document. Opening this document on
> any PC with Krita 5.x will show the correct font size whatever the display
> resolution used.
> 
> Sadly, versions of Krita 4.x don't know about this fix, so they will show
> the document differently after it is saved using Krita 5.
> 
> So the solution is: don't open the .kra files with text created with Krita 5
> in older versions of Krita :(

But what about the documents created with Krita 4? When people open them, the font will seem fine in Krita 5. But when they edit the font or save the document and re-open them later, they will find the font size changed without them knowing that it did.

So at the very least, there should be some sort of warning if you open a Krita 4 document with Text shapes in them that explains the issue and what to do (Cause people will not even understand WHY that is the case or what was the original font size to begin with). Or is it possible to keep the Krita 4 sizes in Krita 5 as long as the original document was made in Krita 4 with the option of converting to Krita 5?

For myself I just made a python plugin that divides the font by 0.75 on all fonts and rebuilds them. So 10pt becomes 13.33333pt, but that isn't something most average people will know. There will be a ton of complaints how their documents fonts broke.

Not to mention, what purpose does the high DPI workaround serve if it doesn't work on Krita 5 documents? Maybe an extra checkbox to enable it for Krita 5 documents? And the warning can point to this setting?
Comment 4 Know Zero 2021-07-09 04:29:21 UTC
(In reply to Dmitry Kazakov from comment #2)
> Well, all Krita 4.x versions had a problem with font size.

To correct my last statement a bit, probably a checkbox for Krita 5 would be confusing for new documents. So probably this setting would have to be for individual documents or all documents originally made in Krita 4.
Comment 5 keyth_qcfx2 2021-07-09 05:17:21 UTC
I am not overly stressed about my older files as I was forced to rebuild my files and I can do so again.

but moving forward with things right does interest me deeply as I don't want to be constantly remaking stuff. as long as Krita 5 holds up with Krita 5 files I guess I am cool.

thank you for the Fix.