[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ft-devel] Re: Bug with hinting of references to composite glyphs
From: |
Eugeniy Meshcheryakov |
Subject: |
[ft-devel] Re: Bug with hinting of references to composite glyphs |
Date: |
Sat, 24 Jun 2006 22:36:01 +0300 |
User-agent: |
Mutt/1.5.11+cvs20060403 |
24 червня 2006 о 14:48 +0200 Ben Laenen написав(-ла):
> We found an issue with the bytecode interpreter. When you have the
> following glyphs:
>
> * A: base glyph, nothing special
> * B: accent 1
> * C: accent 2
> * D: reference to accent 1 and accent 2
> * E: reference to A and D
>
> the hinting instructions of D aren't executed well. I have a sreenshot
> attached that makes it clearer (the font used for testing can be
> downloaded from
> http://fenix.cmi.ua.ac.be/~p015259/dejavu/DejaVuSans.ttf so you can
> test it out yourself):
I found why this bug occurs. Some funtcions in src/truetype/ttinstr.c
use array countours[] to get number of some last point (last point of
countour or entire glyph). That array contains numbers of points
starting from first point of loaded part of glyph (at least when
processing instructions for composite glyph).
So let's try imagine what happens when IUP is executed on glyph <D>.
First, function Ins_IUP() sets variable point to 0 and then tries to
interpolate all points in contour 0. It looks for last point of that
contour: CUR.pts.contours[contour]. If there was no glyphs loaded before
<D> (and it's components) that will be correct number. But we have glyph
<A> loaded before <D>. So expression returns number of points in contour
plus number of points in <A>. If <A> had enough points IUP can
interpolate all contours instead of just one. If <A> had even more
glyphs, I think that memory corruption is also possible.
Simple patch that fixes this bug is attached
(freetype-more-composite.patch).
For freetype 2.2.1 it is possible that IUP will not work correctly on
composite glyphs due to bug described on
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=374902 . Please see
other attached patch to fix it (freetype-composite.patch).
> PS: please keep us CC'ed, as we're not subscribed to the list
>
--
Eugeniy Meshcheryakov
freetype-more-composite.patch
Description: Text document
freetype-composite.patch
Description: Text document
signature.asc
Description: Digital signature