Re: patch for check glyphs overlapping
Chris Wilson <[email protected]>
| Newsgroups | gmane.comp.lib.cairo |
|---|---|
| Message-ID | <[email protected]> |
On Tue, 13 Mar 2012 15:53:31 +0000, "Henry (Yu) Song - SISA" <[email protected]> wrote: > It seems to me that checking overlapping in cairo-scaled-font.c is not correct. Here is patch > > Date: Mon Mar 12 09:49:38 2012 -0700 > > checkut overlap in cairo-scaled-font.c > > diff --git a/src/cairo-scaled-font.c b/src/cairo-scaled-font.c > index 062e895..e32e975 100644 > --- a/src/cairo-scaled-font.c > +++ b/src/cairo-scaled-font.c > @@ -2102,10 +2102,16 @@ _range_contains_glyph (const cairo_box_t *extents, > cairo_fixed_t right, > cairo_fixed_t bottom) > { > - return right > extents->p1.x && > - left < extents->p2.x && > - bottom > extents->p1.y && > - top < extents->p2.y; > + return right < extents->p2.x && > + left > extents->p1.x && > + top > extents->p1.y && > + bottom < extents->p2.y; That turns it into a query as to whether the next glyph is wholly contained within the bbox of the proceeding glyphs. Whereas what we need to detect is if any pixel of this glyph overdraws any pixel of another glyph. -Chris -- Chris Wilson, Intel Open Source Technology Centre -- cairo mailing list [email protected] http://lists.cairographics.org/mailman/listinfo/cairo