This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Ugly text font aliasing on non white background. How to fix?

Tags: None
(comma "," separated)
User avatar
silvermoon
Registered Member
Posts
41
Karma
0
I write text on non white rectangles like this -

https://ibb.co/iJoXo0

Image

And the font edges are not smooth.
The font thinks its on white background and does sub pixel hinting accordingly (using gray color).

How to make it smooth and sharp ?


KUBUNTU 18.04
ahabgreybeard
Registered Member
Posts
1269
Karma
11
OS
It's not that "it thinks it's on a white background", it's just what it does for antialiasing and that works best on a white background because black or dark text on a white background is the most common use of text, historically. Also, whatever colour text you use will fade to greyish and less opaque at the edges as part of the process, which works fine for dark text on a pale background. Anyway, it's a nuisance and always has been.

I deal with this by always making black text on a white background then inverting that to produce white text on a black background and then using the result as a transparency mask on a colour layer to give coloured text. The layer under that can be any colour you like as a background 'paper'. This also means that the colour layer that the transparency is applied to can be any colour or pattern so you can have tartan text or multi-coloured speckled text or anything you care to try out.

Note that this will not make the text 'sharp', there will always be a faded edge and it does look better the bigger the font is.

Image
User avatar
Deevad
Registered Member
Posts
451
Karma
1
OS
Hi silvermoon, It was this bug: https://bugs.kde.org/show_bug.cgi?id=344386 . If you use an old Krita version you might still experience it. In newer version (4.1.x) the text tool vector object sometimes adds this type of grey outline; but it is easy to edit with the vector colors tools in tool options.

(note: For a workaround, put the layer with text in "screen" blending mode; white anti-aliasing will be perfect )


mvowada
Registered Member
Posts
322
Karma
1
Hi,
with 4.2.0 pre-alpha appimage on Ubuntu 14.04, it seems I can still reproduce this issue:
  1. "Dejavu Sans", white fill color, set the size to 11px (jagged dark edges appear)
  2. increasing the font size by 1 to 12px makes the issue disappear.
(the font size threshold may varies depending on the font used)
User avatar
Deevad
Registered Member
Posts
451
Karma
1
OS
Yes @mvowada, I can reproduce. Your steps and setup is good to reproduce it and it deserves a bug-report in its own.
Something I noticed in 4.x, it's easier to workaround as you can add a 0px outline to the vector object. It fixes it, here is a gif example:

Image


mvowada
Registered Member
Posts
322
Karma
1
Deevad wrote:you can add a 0px outline to the vector object. It fixes it

Thanks, it works well as a workaround. I've noticed that it makes the ugly edges disappearing here also setting the stroke to "No fill" (which is the same :).

(I've opened a bug report here: https://bugs.kde.org/show_bug.cgi?id=399830)
User avatar
Deevad
Registered Member
Posts
451
Karma
1
OS
Thanks for opening the bug report, I confirmed it! o)


mvowada
Registered Member
Posts
322
Karma
1
Thanks to silvermoon too
User avatar
silvermoon
Registered Member
Posts
41
Karma
0
Deevad wrote:Yes @mvowada, I can reproduce. Your steps and setup is good to reproduce it and it deserves a bug-report in its own.
Something I noticed in 4.x, it's easier to workaround as you can add a 0px outline to the vector object. It fixes it, here is a gif example:

Image



What is that button you are clicking on the top toolbar on the right of the color selection bits ?
I am using Krita 4.0.1 but can't see that button.

Here is my toolbar
https://imgur.com/a/b41vv8P

Image


KUBUNTU 18.04
User avatar
silvermoon
Registered Member
Posts
41
Karma
0
Deevad wrote:Yes @mvowada, I can reproduce. Your steps and setup is good to reproduce it and it deserves a bug-report in its own.
Something I noticed in 4.x, it's easier to workaround as you can add a 0px outline to the vector object. It fixes it, here is a gif example:


I just now upgraded Krita to 4.1.5 but still can't see that extra button visible on your toolbar.

Okay its Select Options Tool > Tool Options.

How did you get that button on the toolbar ?
I do Settings > Configure Toolbars, but cannot find the button for it.


KUBUNTU 18.04
mvowada
Registered Member
Posts
322
Karma
1
silvermoon wrote:How did you get that button on the toolbar ?

"Settings > Configure Krita... > General > Tools" and choose open in toolbar instead of docker.
User avatar
silvermoon
Registered Member
Posts
41
Karma
0
mvowada wrote:
silvermoon wrote:How did you get that button on the toolbar ?

"Settings > Configure Krita... > General > Tools" and choose open in toolbar instead of docker.


thanks got it.


KUBUNTU 18.04


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]