Jump to content

Changing SK_GAMMA_CONTRAST without recompiling Chromium


Recommended Posts

Posted (edited)

So the year is 2023 and MS Edge still seems to be the only Chromium-based browser that follows Windows settings for font-rendering and so those damned thin fonts are easily avoided.

There's hardcoded SK_GAMMA_CONTRAST value in the source code here, so as the workaround for other browsers, especially closed-source ones or even stock *Chromium, I wonder if there's a trick to find this value in its massive binary and change it according to the user preference. If I read this right, it seems there are two occurrences of this particular value, in /third_party/skia/src/core/SkScalerContext.cpp and /third_party/skia/src/text/gpu/DistanceFieldAdjustTable.cpp.

Maybe it would be easier with debugging symbols, but I doubt they're published anywhere.

I'm aware extension can change the text after it's rendered, but I'd prefer if it was rendered with set parameter from the start, this should also work for browser's GUI.

[*] Takes a decent PC, disk space and time to figure out and compile this monster from source code.

Edit: I haven't scanned for unique occurrences of 0.5 yet, will attempt later.

Edited by UCyborg
  • 3 weeks later...

  • 3 weeks later...
Posted (edited)
On 10/20/2023 at 1:12 AM, UCyborg said:

Edit: I haven't scanned for unique occurrences of 0.5 yet, will attempt later.

Over 90 occurrences on each scan, one searching for float representation of 0.5, one for double representation. Looking for a needle in a haystack.

On 11/5/2023 at 7:41 PM, Cocodile said:

And I tend to think those thin fonts are Windows 10 issue, I don't see them "thin" with Vista.

Windows version doesn't matter. Yes, they are thin on Vista and you not seeing it doesn't change that fact. We might interpretate "thin" differently, but either way, they're also like that In Firefox based browsers when explicitly selecting Skia backend, which is fortunately not default. Though the alternatives for Direct2D backend on Windows versions before 7 still suck in my eyes, Not a problem for me since I'm on 10 anyway and downgrading to anything older than that would bring more problems than it would solve.

I use Chrome Super Font Enhancer on non-Edge Chromium browsers, the picture on that page demonstrates the difference. The default font rendering hurts my eyes with prolonged reading.

Edited by UCyborg

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...