Created attachment 140733 [details] An example of blurred vs. pixel-perfect (although with kerning issues) bitmap font rendering. Left is Krita 4.4.3, right is Krita 4.3.0. SUMMARY In Krita 4.3.0, the text tool rendered bitmap fonts pixel-perfect, which is great for pixel art. (There were kerning issues though, which got fixed when the pixel-perfect rendering broke.) In Krita 4.4.3, though, it's not pixel-aligned, which makes it look awful at small sizes. STEPS TO REPRODUCE 1. Make a piece of text with the text tool. 2. Set it to a bitmap font, e.g. Terminus or Fixed. OBSERVED RESULT The text is blurry. EXPECTED RESULT The text is pixel-perfect. SOFTWARE/OS VERSIONS Linux/KDE Plasma: Kubuntu 20.10 (available in About System) KDE Plasma Version: 5.19.5 KDE Frameworks Version: 5.74.0 Qt Version: 5.14.2 ADDITIONAL INFORMATION I tried the nightly build last night (e89467b) and it was still happening there.
Okay, here's an update: it turns out that if you copy and paste an SVG text object from Inkscape, it'll actually be perfectly sharp – and it's still editable with the text tool, and /stays/ pixel-sharp! Very odd. This is the Inkscape-made text's source: <text fill="#ffffff" stroke-opacity="0" stroke="#000000" stroke-width="0" stroke-linecap="square" stroke-linejoin="bevel" font-family="Terminus" font-size="9" font-size-adjust="1" font-stretch="normal" kerning="0" letter-spacing="0" word-spacing="0"><tspan x="0">Copied from Inkscape</tspan></text> And this is the native text tool text's source: <text fill="#ffffff" stroke-opacity="0" stroke="#000000" stroke-width="0" stroke-linecap="square" stroke-linejoin="bevel" font-family="Terminus" font-size="9" font-size-adjust="1" font-stretch="normal" letter-spacing="0" word-spacing="0"><tspan x="0">Native</tspan><tspan x="0" dy="12">text tool</tspan></text> But pasting the Inkscape-made one's source into the native text tool one's source doesn't make it sharp. It stays blurry and misaligned.
Created attachment 141368 [details] Inkscape-made text vs. native text tool Nearest-neighbor upscaled 4x to show detail.
Oh, I forgot to mention -- this is with Krita 5.0.0-prealpha (git e89467b) same as before. But it also happens on the latest nightly, 5.1.0-prealpha (git c34330b). -- Frost
Can you please please attach that font to this report?
Sure! It's Terminus, I think it's from the Ubuntu xfonts-terminus package... and there seems to be a lot of them (one for each size), so I hope I have the right one.
Created attachment 141378 [details] Terminus 12pt
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.
Update: Apparently with Krita 5, the copy-from-Inkscape workaround broke! And all the text in our previous documents /disappeared/. (The objects are still there, but won't display.)
(In reply to forestbeasts from comment #8) > And all the text in our previous documents /disappeared/. (The objects are still there, but won't display.) Okay, apparently the text straight-up disappearing was a system configuration issue, never mind about that. Now that that's resolved, some of the (workaround-pasted) text is still sharp and some is blurry, which is odd.
I think I found the bug!! The issue is that the view box for the text SVG objects is specified in pt, so the font isn't an exact number of pixels tall. Unzipping the .kra file and editing the layer SVG to use px makes it pixel-perfect! ...except then Krita then converts this back to a pt size and adds a matrix transform to compensate, for some reason. But it's still pixel-sharp after that. (Is there a reason the SVG units have to be in pt instead of px? It might be easier to just do everything in px.)
Created attachment 147831 [details] Krita 5.0.2 text units demo A demo of the different units to use for text. Bitmap font in pt, bitmap font in px (although Krita reconverted it to pt, it added a matrix transform to compensate), non-bitmap font in px (same), non-bitmap font in pt.
Now that I think of it, I'm actually surprised that bitmap fonts "work" -- they aren't supported by Qt itself...
Okay, sometime between Krita 5.0.2 and 5.0.8, this broke again, blurring fonts in existing documents. I'm not sure exactly what changed here, don't have the energy to go digging at the moment. Haven't tried making a new document and repeating the "unzip, mess with SVG, rezip" dance just yet, because it's a pain in the tail... -- Frost