all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: James Cloos <cloos@jhcloos.com>
To: Kenichi Handa <handa@m17n.org>
Cc: emacs-devel@gnu.org
Subject: Re: font - dpi settings ignored?
Date: Thu, 26 Jun 2008 11:31:44 -0400	[thread overview]
Message-ID: <m3k5gcus94.fsf@lugabout.jhcloos.org> (raw)
In-Reply-To: <E1KBqjW-0005w0-Vt@etlken.m17n.org> (Kenichi Handa's message of "Thu, 26 Jun 2008 21:37:50 +0900")

>>>>> "Handa" == Kenichi Handa <handa@m17n.org> 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.

-JimC
-- 
James Cloos <cloos@jhcloos.com>         OpenPGP: 1024D/ED7DAEA6




  reply	other threads:[~2008-06-26 15:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-24  5:41 font - dpi settings ignored? henry atting
2008-06-24  6:34 ` henry atting
2008-06-24 19:05   ` henry atting
2008-06-25 12:29   ` Kenichi Handa
2008-06-25 14:09     ` henry atting
2008-06-25 16:15       ` James Cloos
2008-06-26 12:37         ` Kenichi Handa
2008-06-26 15:31           ` James Cloos [this message]
2008-06-26 15:58           ` henry atting
2008-06-26 16:07             ` David Kastrup

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3k5gcus94.fsf@lugabout.jhcloos.org \
    --to=cloos@jhcloos.com \
    --cc=emacs-devel@gnu.org \
    --cc=handa@m17n.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.