https://bugs.documentfoundation.org/show_bug.cgi?id=166339

            Bug ID: 166339
           Summary: Skia renderer is not applying gamma correction on text
           Product: LibreOffice
           Version: 25.2.2.2 release
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: minor
          Priority: medium
         Component: graphics stack
          Assignee: [email protected]
          Reporter: [email protected]

Created attachment 200518
  --> https://bugs.documentfoundation.org/attachment.cgi?id=200518&action=edit
Text in Writer with Skia-backend enabled

Using the Skia-backend on Windows and X11, text is rendered too bold on white
backgrounds and too light on dark backgrounds. There is also colour bleeding if
you choose colours with a low brightness contrast, like pure green and pure
red. Similar to this bug report:
https://github.com/AvaloniaUI/Avalonia/issues/5282
There are also pronounced colour fringes from the Cleartype-like rendering.

I suspect, the Skia renderer is not applying correct gamma blending, i.e. is
doing the linear blending in the sRGB colour-space. The sRGB colour-space has a
gamma function on its values, e.g. RGB 128,128,128 is *not* neutral grey, but
darker.

Some background reading about gamma correct font rendering:
> https://www.puredevsoftware.com/blog/2019/01/22/sub-pixel-gamma-correct-font-rendering/
> https://freetype.org/freetype2/docs/hinting/text-rendering-general.html
> https://blog.johnnovak.net/2016/09/21/what-every-coder-should-know-about-gamma/

Windows is using a gamma of 1.9 internally for font rendering with Cleartype,
one could change these settings with Cleartype-Tuner, but it has become merely
disfunctional.
> https://learn.microsoft.com/de-de/dotnet/desktop/wpf/advanced/cleartype-registry-settings?view=netframeworkdesktop-4.8

Qt, starting at some point in the version 5 life-cycle, is also using 1.9:
> https://mail.kde.org/pipermail/kde/2017-December/028694.html

Chromium used hard-coded values for its different platforms, but a large patch
from Microsoft changed that on Windows, modern Edge is using that for some time
now:
> https://developer.chrome.com/blog/better-text-rendering-in-chromium-based-browsers-on-windows

I couldn't find the lines in the codebase that handle the text rendering, I
would appreciate any help to find them, so I can understand what's going on.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to