[cairo] Text scaling and hinting

Robert O'Callahan rocallahan at novell.com
Wed May 4 23:32:12 PDT 2005


On Wed, 2005-05-04 at 22:50 -0400, Owen Taylor wrote:
> On Thu, 2005-05-05 at 13:53 +1200, Robert O'Callahan wrote:
> > [OK, I'm lying. In this first iteration I'm using Pango-Xft so I'm not
> > even using any cairo_scaled_font_t. But hopefully Owen will release some
> > sort of Pango-Cairo integration to solve this :-).]
> 
> I'm not quite sure how you are using PangoXft with cairo.

It's a total hack. I rely on Xft for metrics and font configuration,
assuming that Xft gives me the metrics for an identity CTM. When the
time comes to draw text, I get the glyph data from Pango, get a
cairo_font_face_t via
cairo_ft_font_face_create_for_pattern(PANGO_FC_FONT(PangoFont*)->font_pattern),
set the size to the FC_PIXEL_SIZE, and draw away. I mainly did it this
way because it's a very small change to blizzard's Pango-Xft code.

It works fine with trivial transformations. I haven't tried anything
else yet because I need to work on SVG integration.
http://weblogs.mozillazine.org/roc/archives/2005/05/cairo_progress.html

> I'll look at doing a Pango-1.9.0 once we get cairo-0.5.0 out the door.
> Doing it before some API stability on the cairo front would be a a 
> bad idea.

Sure. This is just a temporary thing so I can make progress on other
fronts.

Rob




More information about the cairo mailing list