Skip to content

Instantly share code, notes, and snippets.

@pandasauce pandasauce/radiff2.log
Last active Aug 4, 2019

Embed
What would you like to do?
Chrome 75.0.3770.142 font rendering fix
# 75.0.3770.142
0x04b58615 7626 => 9090 0x04b58615
0x04b5861d 31c0488945 => 9090909090 0x04b5861d
Due to a beautiful bug in Chromium, it turns out you don't need this binary patch and can **enable** subpixel positioning by asking Chrome **to disable it**: https://bugs.chromium.org/p/chromium/issues/detail?id=824153#c39
Needless to say, I won't be maintaining this gist any longer.
@freefreeno

This comment has been minimized.

Copy link

freefreeno commented Mar 26, 2019

How do try this out ? I am a KDE Plasma user and I read your article. i have the fonts from my Windows machine already installed and working but like you I use chrome a lot so I would like to give this a shot. I also have font cache scaling turned on in flags.

@megapro17

This comment has been minimized.

Copy link

megapro17 commented Mar 28, 2019

How do try this out ? I am a KDE Plasma user and I read your article. i have the fonts from my Windows machine already installed and working but like you I use chrome a lot so I would like to give this a shot. I also have font cache scaling turned on in flags.

Just install windows loool

@pandasauce

This comment has been minimized.

Copy link
Owner Author

pandasauce commented Mar 31, 2019

How do try this out ? I am a KDE Plasma user and I read your article. i have the fonts from my Windows machine already installed and working but like you I use chrome a lot so I would like to give this a shot. I also have font cache scaling turned on in flags.

Currently this requires manually patching your Chrome binary for every release. Once the source patch is merged, this is how it will work out of the box when fontconfig is set to full hinting. Note that it requires a build of freetype with subpixel rendering enabled, which is not the default on some distros. I do the patching with radare2.

  1. Open the binary in write mode r2 -w chrome
  2. Seek to the address specified, i.e. 0x04982102: s 0x04982102
  3. Write the bytes specified, i.e. b80001: wx b80001
  4. Repeat for every offset listed
@AnwarShah

This comment has been minimized.

Copy link

AnwarShah commented Apr 23, 2019

Hi, If I want to make it force hintslight instead of hintfull, what do I need to do?

@pandasauce

This comment has been minimized.

Copy link
Owner Author

pandasauce commented Apr 29, 2019

@AnwarShah, reverse engineer the binary and come up with your own binary patch :)

They changed enough things in v74 to make the binary very different from v72 and v73, so my full hinting patch will take a few nights of reversing too.

@pandasauce

This comment has been minimized.

Copy link
Owner Author

pandasauce commented May 1, 2019

This will no longer force full hinting, it just removes the line that would otherwise disable hinting for subpixel positioning. The reason is I switched to using full hinting by default system-wide.

@AnwarShah

This comment has been minimized.

Copy link

AnwarShah commented May 2, 2019

So, I can use this to use slight hinting system-wide and force chrome to use hinting for subpixel positioning, right?

@pandasauce

This comment has been minimized.

Copy link
Owner Author

pandasauce commented May 2, 2019

@AnwarShah, subpixel positioning is different from hinting. They are two different concepts. This binary patch forces params.subpixel_positioning = true similar to how this patch will do it once merged. As of v74, it does not force any hinting settings.

@pandasauce

This comment has been minimized.

Copy link
Owner Author

pandasauce commented Aug 1, 2019

Due to a beautiful bug in Chromium, it turns out you don't need this binary patch and can enable subpixel positioning by asking Chrome to disable it: https://bugs.chromium.org/p/chromium/issues/detail?id=824153#c39

Needless to say, I won't be maintaining this gist any longer.

@AnwarShah

This comment has been minimized.

Copy link

AnwarShah commented Aug 2, 2019

Due to a beautiful bug in Chromium, it turns out you don't need this binary patch and can enable subpixel positioning by asking Chrome to disable it: https://bugs.chromium.org/p/chromium/issues/detail?id=824153#c39

Needless to say, I won't be maintaining this gist any longer.

User need to re-compile though, right? Is there any flag ?

@pandasauce

This comment has been minimized.

Copy link
Owner Author

pandasauce commented Aug 2, 2019

@AnwarShah, no. Just add --disable-font-subpixel-positioning as a command line argument when launching Chrome. It will do the exact opposite to what it says and enable subpixel positioning unconditionally.

@AnwarShah

This comment has been minimized.

Copy link

AnwarShah commented Aug 2, 2019

@pandasauce That's awesome actually. I'm immediately seeing much improvement on brave browser which is chromium based. The texts are much sharper. Thanks!

@pandasauce

This comment has been minimized.

Copy link
Owner Author

pandasauce commented Aug 3, 2019

Glad you like it. Something that is implied, but maybe I should point it out: this trick applies to all Chromium-based desktop applications too, i.e. Spotify and Slack.

@AnwarShah

This comment has been minimized.

Copy link

AnwarShah commented Aug 4, 2019

Yeah. I knew it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.