Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Chrome 72.0.3626.109 font rendering fix
$ radiff2 -b64 -p -O -n chrome_bkp chrome_patched
0x04b5cf8a 0f86b1 => b80001 0x04b5cf8a
0x04b5cf8f 00b80001000048898568ffffff31c048898578ffffff => 48898568ffffffb80300000048898578ffffff909090 0x04b5cf8f
@pandasauce

This comment has been minimized.

Copy link
Owner Author

commented Feb 23, 2019

Chrome 72.0.2626.119

$ radiff2 chrome_bkp chrome_patched 
0x04b5cc8a 0f86b1 => b80001 0x04b5cc8a
0x04b5cc8f 00b80001000048898568ffffff31c048898578ffffff => 48898568ffffffb80300000048898578ffffff909090 0x04b5cc8f
@pandasauce

This comment has been minimized.

Copy link
Owner Author

commented Mar 13, 2019

Chrome 73.0.3683.75-1

loc 488985: cc95 = e34d; e34d - 0b = e342

$ radiff2 chrome_bkp chrome
0x0497e342 0f86af => b80001 0x0497e342
0x0497e347 00b80001000048898568ffffff31c048898578ffffff => 48898568ffffffb80300000048898578ffffff909090 0x0497e347
@pandasauce

This comment has been minimized.

Copy link
Owner Author

commented Mar 25, 2019

73.0.3683.86-1

$ radiff2 chrome_bkp chrome
0x04982102 0f86af => b80001 0x04982102
0x04982107 00b80001000048898568ffffff31c048898578ffffff => 48898568ffffffb80300000048898578ffffff909090 0x04982107
@freefreeno

This comment has been minimized.

Copy link

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

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

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
@pandasauce

This comment has been minimized.

Copy link
Owner Author

commented Apr 9, 2019

73.0.3683.103-1

$ radiff2 chrome_bkp chrome
0x04982ba2 0f86af => b80001 0x04982ba2
0x04982ba7 00b80001000048898568ffffff31c048898578ffffff => 48898568ffffffb80300000048898578ffffff909090 0x04982ba7
@AnwarShah

This comment has been minimized.

Copy link

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

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

commented May 1, 2019

74.0.3729.131

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.

$ radiff2 chrome_bkp chrome
0x049e617a 0f86af000000 => 909090909090 0x049e617a
0x049e618e 48894580 => 90909090 0x049e618e
@AnwarShah

This comment has been minimized.

Copy link

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

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

commented May 16, 2019

74.0.3729.157

0x049e691a 0f86af000000 => 909090909090 0x049e691a
0x049e692e 48894580 => 90909090 0x049e692e
$ radiff2 slack.bak slack
0x045ef797 ed => f6 0x045ef797
0x045ef7a6 b5014531f6 => bd00010000 0x045ef7a6
0x045ef7b2 4531ed => 909090 0x045ef7b2
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.