Mailing List Archive

Subpixel Hinting in GTK-applications
Hello everybody. In my Gentoo system (I have also tried Gentoo 2012
livedvd) GTK-applications (for example: mousepad, gedit, leafpad,
Firefox, Chromium and all the websites opened in these two browsers)
do not use Subpixel Hinting. I have tried setting Subpixel Hinting
settings via KDE systemsettings, eselect fontconfig (enable
sub-pixel-rgb), .Xresources (Xft.rgba: rgb), xfce4-settings-manager
and mate settings manager. I have tried KDE, Xfce, Mate, pure Openbox.
Profiles: desktop or desktop/kde. If I change hinting style
(slight/medium/full) fonts in GTK-applications change, but it seems
like they ignore subpixel hinting settings. I have tried fonts:
Tahoma, Arial, Lucida Sans (for websites), DejaVuSans, LiberationSans
(for desktop applications). In KDE-applications everything is fine:
subpixel hinting is used, Konqueror displays fonts on websites
normally. Can you please help me? I am in desperation.
Re: Subpixel Hinting in GTK-applications [ In reply to ]
Hi!

On Tue, Jul 15, 2014 at 01:45:55PM +0400, Сергей wrote:
> Hello everybody. In my Gentoo system (I have also tried Gentoo 2012
> livedvd) GTK-applications (for example: mousepad, gedit, leafpad,
> Firefox, Chromium and all the websites opened in these two browsers)
> do not use Subpixel Hinting.

I'm not a guru of font configuration, but I believe subpixel hinting works
on my system (at least in Firefox), so here is my config:

[ebuild R ] www-client/firefox-24.6.0 USE="alsa dbus jit libnotify minimal system-cairo system-icu system-jpeg -bindist -custom-cflags -custom-optimization -debug -gstreamer (-pgo) -pulseaudio (-selinux) -startup-notification -system-sqlite {-test} -wifi" LINGUAS="ru -af -ak -ar -as -ast -be -bg -bn_BD -bn_IN -br -bs -ca -cs -csb -cy -da -de -el -en_GB -en_ZA -eo -es_AR -es_CL -es_ES -es_MX -et -eu -fa -fi -fr -fy_NL -ga_IE -gd -gl -gu_IN -he -hi_IN -hr -hu -hy_AM -id -is -it -ja -kk -km -kn -ko -ku -lg -lt -lv -mai -mk -ml -mr -nb_NO -nl -nn_NO -nso -or -pa_IN -pl -pt_BR -pt_PT -rm -ro -si -sk -sl -son -sq -sr -sv_SE -ta -ta_LK -te -th -tr -uk -vi -zh_CN -zh_TW -zu" 0 kB

# eselect fontconfig list
Available fontconfig .conf files (* is enabled):
[1] 10-autohint.conf
[2] 10-no-sub-pixel.conf
[3] 10-scale-bitmap-fonts.conf *
[4] 10-sub-pixel-bgr.conf
[5] 10-sub-pixel-rgb.conf *
[6] 10-sub-pixel-vbgr.conf
[7] 10-sub-pixel-vrgb.conf
[8] 10-unhinted.conf *
[9] 11-lcdfilter-default.conf *
[10] 11-lcdfilter-legacy.conf
[11] 11-lcdfilter-light.conf
[12] 20-unhint-small-dejavu-sans.conf *
[13] 20-unhint-small-dejavu-sans-mono.conf *
[14] 20-unhint-small-dejavu-serif.conf *
[15] 20-unhint-small-vera.conf *
[16] 25-unhint-nonlatin.conf
…

Plus /etc/fonts/local.conf:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!-- 3 options affect how fonts will looks like:
- antialiasing (enabled by default)
- sub-pixel rendering (eselect fontconfig enable/disable 10-no-sub-pixel.conf)
- hinting (disabled by default)
-->
<match target="font">
<edit mode="assign" name="hinting">
<bool>true</bool>
</edit>
</match>
<match target="font">
<edit mode="assign" name="hintstyle">
<const>hintfull</const>
</edit>
</match>
<!-- MacOSX's fonts looks ugly when hinting enabled -->
<match target="font">
<test name="family">
<string>Helvetica</string>
</test>
<edit name="hinting">
<bool>false</bool>
</edit>
</match>
<match target="font">
<test name="family">
<string>Helvetica Neue</string>
</test>
<edit name="hinting">
<bool>false</bool>
</edit>
</match>
<match target="font">
<test name="family">
<string>Monaco</string>
</test>
<edit name="hinting">
<bool>false</bool>
</edit>
</match>
…
</fontconfig>

--
WBR, Alex.
Re: Subpixel Hinting in GTK-applications [ In reply to ]
Hello! Thank you for your config. I tried it, but still got no result:
it seems to me, problem is in the GTK itself, not in fontconfig...
Re: Subpixel Hinting in GTK-applications [ In reply to ]
I found out that in Calculate Linux (based on Gentoo) fonts are ok in
GTK-apps. But Calculate guys do not say how they got such result (they
say, it was too long ago for them to remember). These magic changes
are somewhere in Calculate templates
(/var/lib/layman/calculate/profiles/templates). I looked at these
templates (man:
http://www.calculate-linux.org/main/en/calculate_utilities_templates),
but could not find anything useful.
Re: Subpixel Hinting in GTK-applications [ In reply to ]
On Wed, Jul 16, 2014 at 10:00:50AM +0400, Сергей wrote:
> Hello! Thank you for your config. I tried it, but still got no result:
> it seems to me, problem is in the GTK itself, not in fontconfig...
>

I'm not too sure if this will help, but have you tried the infinality
patches? I use it with good results on my system, not sure if it'll
help your situation. Worth a shot though.

http://wiki.gentoo.org/wiki/Fontconfig#Infinality

--
Dan Oriani
redchops.com
(Website perpetually under construction)
Re: Subpixel Hinting in GTK-applications [ In reply to ]
I have tried infinality for sure, but I don't remember, what was the
result xD Will try again soon, thank you.
Re: Subpixel Hinting in GTK-applications [ In reply to ]
Hi!

On Thu, Jul 17, 2014 at 05:29:38PM +0400, Сергей wrote:
> Here are these Calculate templates. Inside I found some files to be
> replaces in /etc/fonts, but they do not help, so I looked for "rgb",
> "subpixel", "fonts" inside all the files, but found nothing! Panic!

If font configuration is same but it doesn't work - maybe problem is in
different USE-flags. Also, I think you may have issues because of caching -
play with `fc-cache` and config files (not with hinting, try to change
something else, just to make sure your changes apply and you see the
difference).

--
WBR, Alex.
Re: Subpixel Hinting in GTK-applications [ In reply to ]
Now I have no access to my local computer, but when I return I will
look at package.use and package.keywords in calculate.
And fc-cache also, thanks.
I also found out that SystemRescueCd is not affected by this problem.
Will try and ask it's developers.
Re: Subpixel Hinting in GTK-applications [ In reply to ]
Hello everybody. I found out that Infinality really helps. I only
needed to emerge freetype with infinality USE-flag (even without
configuring Infinality) and GTK-applications began obeying my settings
(at least in Xfce4). Seems like there is a bug in freetype? I don't
know. However, it would be interesting to know how this can be fixed
without Infinality.

2014-07-17 17:51 GMT+04:00 Сергей <protserovsd@gmail.com>:
> Now I have no access to my local computer, but when I return I will
> look at package.use and package.keywords in calculate.
> And fc-cache also, thanks.
> I also found out that SystemRescueCd is not affected by this problem.
> Will try and ask it's developers.