[cairo] Text scaling and hinting
otaylor at redhat.com
Wed May 4 19:50:16 PDT 2005
On Thu, 2005-05-05 at 13:53 +1200, Robert O'Callahan wrote:
> On Wed, 2005-05-04 at 21:14 -0400, Carl Worth wrote:
> > On Thu, 05 May 2005 10:00:28 +1200, Robert O'Callahan wrote:
> > > I think I can work around the current Cairo API. String drawing would
> > > fix all the glyph positions based on a cairo_scaled_font_t chosen to be
> > > the definitive metrics for the font, and then call cairo_show_glyphs.
> > If I'm understanding you correctly, that sounds like it's exactly the
> > recommended way of using the API.
> Yeah, but I'll be using the metrics for a single cairo_scaled_font_t to
> place all glyphs even when I may be drawing with a different CTM to the
> one the cairo_scaled_font_t was created with ... i.e., I'm drawing
> glyphs whose extents may only be hazily related to the extents I used
> for layout.
For proper screen display of text, there is no getting around doing
layout for the particular pixel grid you are going to display on.
That is, you must not "use using the metrics for a single
cairo_scaled_font_t to place all glyphs even when [you] may be drawing
with a different CTM to the one the cairo_scaled_font_t was created
> [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.
You could use PangoFT2 with cairo using the techniques you can find in
gnome-print-pango.c, and if you followed that exactly, you'd have
no hinting of metrics (or glyphs), which would be OK for animation,
though very poor for running text.
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
-------------- 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/20050504/1e5d8182/attachment.pgp
More information about the cairo