bohoomil / fontconfig-ultimate

freetype2-infinality run-time settings => infinality compatible fontconfig => infinality-bundle
454 stars 38 forks source link

WebKit browsers (Chromium, Opera) won't use freetype2 run-time settings with the new Infinality patch #124

Closed bohoomil closed 8 years ago

bohoomil commented 8 years ago

The problem was originally reported by Perfect Gentleman and SpaceCadet on Arch Linux forum:

I'm experiencing the same with Google Chrome. On web pages it seems to ignore my infinality settings completely. Strangely enough, the differences are visible in the Chrome UI itself (menus, bookmarks, tab titles).

I tested it first by trying out the various INFINALITY_FT presets, and later by setting the variables manually and explicitly setting INFINALITY_FT_BRIGHTNESS="-100" to make my fonts super bold [edited to add: just so I would notice whether it changes anything, not because I like my fonts that way], and none of it made any change to how the fonts were rendered on web pages in Chrome, while on Firefox it made a very noticeable difference.

I reproduced the problem and here are the screenshots:

chromium_ultimate3

chromium_testing_old_inf_patch

goddesse commented 8 years ago

@bohoomil and @mviikki16. Looking at the SKIA code, it doesn't call the plain FT_Init_FreeType function, but rather the custom FT_New_Library and then FT_Add_Default_Modules. I wonder if the ennvars were initialized there too with ftinf_env() WebKit would start working with Infinality settings again.

mviikki16 commented 8 years ago

Indeed, ftinf_env must be called for Infinality to be active, a call at the end of FT_New_Library should solve the issue. It is also possible to update ftinf_env to skip multiple initialisations (in cases where it gets called more than once) but beside the little wasted computation that's far less of a problem than when no call to it is done at all.

mviikki16 commented 8 years ago

Here's a small and quick update to latest patch version (inf_patch_all.txt) to add the reading of settings also from FT_New_Library and skip multiple calls of ftinf_env.

inf_upd.txt

mviikki16 commented 8 years ago

and this is a bit of cleanup for redundant code.

inf_clnup.txt

perfect7gentleman commented 8 years ago

how should these patches be applied ?

bohoomil commented 8 years ago

@mviikki16 Thank you very much!

@perfect7gentleman I'll prepare the patches soon, please wait a little bit.