You are not logged in.

#1 2013-02-23 20:15:49

mfriley
Member
Registered: 2013-02-23
Posts: 5

[SOLVED] Font Hinting Issues (Openbox + GTK)

Hello, I'm a rather new Arch user, and for the most part, it's been a very smooth ride; aside from this issue, everything just works and performs greatly, but I've been having a very weird issue with configuring my font rendering.

I'm used to Xfce as my go-to DE, but I recently switched to Openbox and my own bundle of programs, so I had to configure my fonts manually; no big deal. But when I tried to use my configuration:

http://i.imgur.com/cn6Elv0.png

On the left is the default Openbox right-click menu, and the fonts are tweaked exactly to my tastes, but on the right is an Xfce Terminal window with the fonts fully hinted. It's the same with nearly every other GTK+ application, like Emacs, GIMP and PCManFM, with the sole exception of Firefox, which also follows my configuration properly. Even stranger is that uglier solutions like using the autohinter seem to work fine. My GTK+ programs seem to be averse to my one specific configuration, and frankly, it's driving me insane.

My configuration is as follows:

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
  <match target="font">
    <edit name="antialias" mode="assign"><bool>true</bool></edit>
    <edit name="autohint" mode="assign"><bool>false</bool></edit>
    <edit name="hinting" mode="assign"><bool>true</bool></edit>
    <edit name="hintstyle" mode="assign"><const>hintslight</const></edit>
    <edit name="lcdfilter" mode="assign"><const>lcddefault</const></edit>
    <edit name="rgba" mode="assign"><const>rgb</const></edit>
  </match>
</fontconfig>

I've left all of the files in /etc/fonts untouched. Am I doing something wrong here? I've never had to bother with font configuration before, so I wouldn't be surprised if I'm overlooking something painfully obvious.



-- mod edit: read the Forum Etiquette and only post thumbnails http://wiki.archlinux.org/index.php/For … s_and_Code [jwr] --

Last edited by mfriley (2013-02-24 04:23:53)

Offline

#2 2013-02-23 22:17:34

mariusmeyer
Member
From: Norway
Registered: 2009-04-25
Posts: 244

Re: [SOLVED] Font Hinting Issues (Openbox + GTK)

Read the Font Configuration wiki entry, and check what

xrdb -query

outputs. Your GTK settings or theme may enforce other font configs via xrdb.

Offline

#3 2013-02-23 22:40:35

mfriley
Member
Registered: 2013-02-23
Posts: 5

Re: [SOLVED] Font Hinting Issues (Openbox + GTK)

mariusmeyer wrote:

Read the Font Configuration wiki entry, and check what

xrdb -query

outputs. Your GTK settings or theme may enforce other font configs via xrdb.

No dice... xrdb doesn't provide any output.

Offline

#4 2013-02-24 00:45:29

mariusmeyer
Member
From: Norway
Registered: 2009-04-25
Posts: 244

Re: [SOLVED] Font Hinting Issues (Openbox + GTK)

How do you set your gtk theme?

Offline

#5 2013-02-24 01:19:33

mfriley
Member
Registered: 2013-02-23
Posts: 5

Re: [SOLVED] Font Hinting Issues (Openbox + GTK)

mariusmeyer wrote:

How do you set your gtk theme?

With lxappearance. It lets me change the engine and icon themes, but won't let me adjust the font hinting.
I'm at my wit's end here. I've completely reinstalled Arch from scratch, set everything up from the base, and GTK+ applications still don't use proper font hinting. I installed the Ubuntu patches from the AUR, and while they improved the rendering of compliant applications, it still did nothing to fix my problem; I also installed Infinality's patches, and while they do manage to force slight hinting globally, they also mangle fonts like DejaVu Sans, regardless of hinting style, and look nothing like the nice default rendering.

Offline

#6 2013-02-24 03:38:05

AurosGamma
Member
From: San Cristobal,Venezuela
Registered: 2011-02-22
Posts: 132

Re: [SOLVED] Font Hinting Issues (Openbox + GTK)

Yo have to edit ( or create ) two files, '~/.Xdefaults' and '~/.config/fontconfig/fonts.conf'

~/.Xdefaults

Xft.autohint: 0
Xft.antialias: 1
Xft.hinting: true
Xft.hintstyle: hintslight
Xft.dpi: 96
Xft.rgba: rgb
Xft.lcdfilter: lcddefault

and

~/.config/fontconfig/fonts.conf

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
 <match target="font">
  
  <edit mode="assign" name="rgba">
   <const>rgb</const>
  </edit>

  <edit mode="assign" name="hinting">
   <bool>true</bool>
  </edit>

  <edit mode="assign" name="hintstyle">
   <const>hintslight</const>
  </edit>

  <edit mode="assign" name="antialias">
   <bool>true</bool>
  </edit>

  <edit mode="assign" name="lcdfilter">
    <const>lcddefault</const>
  </edit>
 
 </match>
</fontconfig>

Let me know if it works for you.
Best regards.

Last edited by AurosGamma (2013-02-24 03:38:55)

Offline

#7 2013-02-24 04:27:49

mfriley
Member
Registered: 2013-02-23
Posts: 5

Re: [SOLVED] Font Hinting Issues (Openbox + GTK)

AurosGamma, you're my hero. Everything works perfectly now with zero fuss.

Sorry for what was probably a stupid question; I initially tried to place the .Xdefaults entry in .Xresources, and didn't know they were distinct. Thanks a ton for the help!

Offline

#8 2013-02-24 04:52:35

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] Font Hinting Issues (Openbox + GTK)

If you put things in .Xresources, you need to merge them on start of X with

$ xrdb -merge $HOME/.Xresources 

Also when you change anything in that file, it needs to be remerged.

Offline

Board footer

Powered by FluxBB