[cairo] Userfont hinting
Behdad Esfahbod
behdad at behdad.org
Sat May 10 06:01:13 PDT 2008
Ok, try what I pushed now. I modified your source and it works
correctly for whatever I tested from 10^-29 to 10^+29. Test case
attached. I may clean it up and add to the test suite if you don't
mind.
behdad
On Sat, 2008-05-10 at 01:33 +0100, Peter Clifton wrote:
> On Fri, 2008-05-09 at 13:58 +0200, Behdad Esfahbod wrote:
> > On Fri, 2008-05-09 at 12:55 +0100, Peter Clifton wrote:
> > >
> > > Could the meta-surface / analysis surface be using fixed point with an
> > > inappropriate precision?
> >
> > Possible. analysis-surface does use the fixed box model. I'm finishing
> > the patch split. Will look into this after.
>
> Might be the wrong thing, but this patch fixes it for me:
>
>
> diff --git a/src/cairo-user-font.c b/src/cairo-user-font.c
> index 6422d1b..b006b43 100644
> --- a/src/cairo-user-font.c
> +++ b/src/cairo-user-font.c
> @@ -119,12 +119,12 @@ _cairo_user_scaled_glyph_init (void *abstract_font,
> cairo_surface_t *analysis_surface = _cairo_analysis_surface_create (null_surface, -1, -1);
> cairo_surface_destroy (null_surface);
>
> - _cairo_analysis_surface_set_ctm (analysis_surface, &scaled_font->base.scale_inverse);
> status = _cairo_meta_surface_replay (meta_surface, analysis_surface);
> _cairo_analysis_surface_get_bounding_box (analysis_surface, &bbox);
> cairo_surface_destroy (analysis_surface);
>
> _cairo_box_to_doubles (&bbox, &x1, &y1, &x2, &y2);
> + _cairo_matrix_transform_bounding_box (&scaled_font->base.scale_inverse, &x1, &y1, &x2, &y2, NULL);
>
> extents.x_bearing = x1;
> extents.y_bearing = y1;
>
>
>
--
behdad
http://behdad.org/
"Those who would give up Essential Liberty to purchase a little
Temporary Safety, deserve neither Liberty nor Safety."
-- Benjamin Franklin, 1759
-------------- next part --------------
A non-text attachment was scrubbed...
Name: userfont.c
Type: text/x-csrc
Size: 4379 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20080510/de3c3b3b/attachment.c
More information about the cairo
mailing list