[cairo] shaking fonts
DTurner at nds.com
Tue May 25 09:13:21 PDT 2004
> On Mon, 24 May 2004 13:52:54 +0200,
> =?iso-8859-1?Q?=D8yvind_Kol=E5s?= wrote:
> > contains a video of interactivly scaling the vertical axis of
> > the http://cairographics.org/samples/text.html snippet,
> > the font seems to pulsate between differnt pt sizes.
> > I assume this to be a known issue, this video just illustrates
> > the artifacts.
> Yes, this is the kind of thing you get with font hinting. It
> looks great
> for static rendering, but causes lots of jumpiness when animating.
"Hinting" is a way of adjusting the glyph outline to the _final_
device pixel grid, i.e. after all transforms have been applied. It
then distorts the vector to sort of align them to the pixel grid.
These distortions are generally bounded to -1/2..1/2 pixel positions.
The video shows that the hinting is not applied to the final vectorial
outline, so little distorsions in (font-specific ?) space
are scaled tremendously to device space.
this is not correct behaviour. Certain programs like Acrobat Reader
are capable of displaying good hinted text at any scale/transform with
correct device-independent layout. However, implementing such behaviour
certainly isn't trivial.
It seems that the Cairo rendering pipeline doesn't correctly handle
glyph vectors. I'd suggest to completely disallow hinting until the code
Now, you know why MacOS X doesn't hint fonts by default :-)
Hope this helps,
- David Turner
- The FreeType Project (www.freetype.org)
> If you talk to fontconfig/freetype directly with
> cairo_ft_font_create or
> cairo_ft_font_create_for_face then you should have the ability to turn
> font hinting off.
> There are different theories on whether or not it's a good
> idea to allow
> this kind of control with cairo_select_font. I'm not entirely
> sure which
> camp I fall in, but I'd like to see more serious use of cairo on
> multiple platforms before deciding.
> cairo mailing list
> cairo at cairographics.org
More information about the cairo