[cairo] Font rendering options
otaylor at redhat.com
Fri Jul 8 07:37:22 PDT 2005
On Thu, 2005-07-07 at 22:26 -0700, Bill Spitzak wrote:
> Owen Taylor wrote:
> > When handling text, there are quite a few relevant options:
> > - Whether we use subpixel antialiasing
> > - The subpixel order for subpixel antialiasing
> "subpixel" is also useful for drawing all other graphics. I think this
> can be done by using a 3x larger CTM in the desired direction, and
> possibly a hint that all widths be multiples of 3.
Seems like an essentially unrelated issue to me.
> > * Application uses the toy API to render to the screen; the user's
> > preferences from the Xft X resources should be picked up.
> > * Application is rendering to the screen via GTK+ and Pango.
> > GTK+ tracks the user's preferences through XSETTINGS to handle
> > dynamic changes. GTK+ wants to pass these options down and
> > override the values from Xft.
> This is bad. The fonts should match whether you are using Pango or not.
> For the same reason, fonts identified by name must be absolutely
> identical no matter what backend is used. Users must be able to take a
> font preference from one program and put it in the other. If you don't
> think this is possible, I recommend the current "toy" interface be
> scrapped and replaced with an easy-to-use wrapper around Pango.
If you want *dynamic* changes as above, then that needs to be done at
the widget toolkit level ... GTK+ needs to know when to redo widget
layout. I don't see trying to push support for dynamic XSETTING changes
down into Cairo ... you need things like X event handling, a main
If you are using Cairo without the necessary infrastructure to do
XSETTINGS handling, then you'll get the font options in effect when
your app started. Which, while not great, isn't the end of the world.
> > * A vector-graphics application wants to render text in a way that
> > will be as independent of zoom factor as possible. It turns off
> > metrics and outline hinting.
> This is wrong. Instead the application wants the metrics and outline
> hinting for a *particular* size. Thus the image will look as good as
> possible at a "default" size, yet scale smoothly.
> This is why I wanted the font hinting to depend only on the font matrix,
> and not the CTM. This also means that a program does not have to keep
> two cairo_t's around to rescale text without the wrapping changing.
> "turning hinting off" is then achieved by setting the CTM very small so
> that the font matrix is very large, beyond the threshold where hinting
> is done.
While I'm a believer in *usually* working with an identity CTM, I really
don't think calling cairo_scale (cr, 1.5) should make all text look
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050708/6d726cfd/attachment.pgp
More information about the cairo