[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: font - dpi settings ignored?

From: James Cloos
Subject: Re: font - dpi settings ignored?
Date: Thu, 26 Jun 2008 11:31:44 -0400
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (gnu/linux)

>>>>> "Handa" == Kenichi Handa <address@hidden> writes:

Handa> But, in his screenshot:

Handa>   http://www.literaturlatenight.de/pic.png

Handa> the rendering is apparently affected.

In that screenshot, the "thin" text has been grid-fit by the font's
bytecode (ie, freetype's bytecode interpreter is on) with freetype's
grayscale mode.  In the other shot it appears that freetype's autofit
module did the hinting, and RGBA is on.

For libXft apps, turning on the X resource:

Xft.rgba: rgb

(or bgr if one's display has the subpixels in that order) will tell
libXft to set the rgba item in the fontconfig pattern.

That can also be set in fonts.conf with a snippet like:

,----[ /etc/fonts/conf.d/10-sub-pixel-rgb.conf ]
| <?xml version="1.0"?>
| <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
| <fontconfig>
| <!--  Enable sub-pixel rendering --> 
|   <match target="font">
|     <edit name="rgba" mode="assign"><const>rgb</const></edit>
|   </match>
| </fontconfig>

So, it seems the original poster needs to turn on rgba mode (I use both;
I have 10-sub-pixel-rgb.conf linked from /etc/fonts/conf.available to
/etc/fonts/conf.d and I have Xft.rgba: rgb in my ~/.Xdefaults) and,
since he obviously prefers the autofitter over the bytecode interpreter,
he should use one or the other of:

,----< turn on light autofitting >
| <match target="font" >
|   <edit mode="assign" name="hintstyle" >
|     <const>hintslight</const>
|   </edit>
| </match>

,----< force the use of freetype's autofit module >
| <match target="font">
|   <edit name="autohint" mode="assign"><bool>true</bool></edit>
| </match>

(The former targets freetype's light autofit mode, where only vertical
fitting is done; that ensures that the font's metrics are left unchanged.)

Some background:

Well instructed ttf fonts typically target a stem width of one pixel for
regular and two or three for bold fonts at typical main text font sizes
at typical screen resolution.  The idea is to generate glyphs with
contrast similar to what one sees with bitmap fonts, but with a bit of
anti-aliasing for the curves and diagonals.  Freetype's autofit module,
like OS X's native font rendering, tends to attempt a somewhat softer
appearance which is more consistent with what the fonts look like when
printed.  Fontconfig, if freetype is compiled with support for its ttf
bytecode interpreter, can support both.

James Cloos <address@hidden>         OpenPGP: 1024D/ED7DAEA6

reply via email to

[Prev in Thread] Current Thread [Next in Thread]