[cairo] Userfont hinting

Peter Clifton pcjc2 at cam.ac.uk
Fri May 9 04:55:59 PDT 2008


On Thu, 2008-05-08 at 17:46 +0100, Peter Clifton wrote:
> On Thu, 2008-05-08 at 17:13 -0400, Behdad Esfahbod wrote:
[...]

> > So yeah, look for user-fonts merging tomorrow.
> 
> Will do.
> 
> >From the above description, I guess the proposed changes won't affect
> the aliasing I was seeing at certain sizes. Did you see those yourself,
> or did I mess up my re-base?

I instrumented the bounds returned from the analysis surface:

diff --git a/src/cairo-user-font.c b/src/cairo-user-font.c
index 83b8a3d..c5c8dbc 100644
--- a/src/cairo-user-font.c
+++ b/src/cairo-user-font.c
@@ -120,6 +120,8 @@ _cairo_user_scaled_glyph_init (void                  *abstra
 
            _cairo_box_to_doubles (&bbox, &x1, &y1, &x2, &y2);
 
+            printf ("Glyph bounding box; %f, %f %f, %f\n", x1, y1, x2, y2);
+
            extents.x_bearing = x1;
            extents.y_bearing = y1;
            extents.width     = x2 - x1;

And found my good / bad lines of glyphs were giving this output:

(Where font is requested at size 20, and then 200)

Glyph bounding box; 0.000000, -1.000000 1.000000, 0.000000
Glyph bounding box; 0.000000, -1.000000 1.000000, 0.000000
Glyph bounding box; 0.000000, -1.000000 1.000000, 0.000000
Glyph bounding box; 0.000000, -1.000000 1.000000, 0.000000
Glyph bounding box; 0.000000, -0.101562 0.101562, 0.000000
Glyph bounding box; 0.000000, -0.101562 0.101562, 0.000000
Glyph bounding box; 0.000000, -0.101562 0.101562, 0.000000
Glyph bounding box; 0.000000, -0.101562 0.101562, 0.000000

It would appear that there is some numerical precision issue, since my
glyph (which just displays a 19x19 pixel box each time) has relatively
smaller feature size than would perhaps be expected of the size 200
font.

Could the meta-surface / analysis surface be using fixed point with an
inappropriate precision?

Best regards,
-- 
Peter Clifton

Electrical Engineering Division,
Engineering Department,
University of Cambridge,
9, JJ Thomson Avenue,
Cambridge
CB3 0FA

Tel: +44 (0)7729 980173 - (No signal in the lab!)



More information about the cairo mailing list