[Ffmpeg-devel] [PATCH] drawtext.c: 08 fix process measure and cache code

Guillaume POIRIER poirierg
Mon Oct 30 22:23:50 CET 2006


Hi,

On 9/24/06, Michael Niedermayer <michaelni at gmx.at> wrote:
> Hi
>
> On Sun, Sep 10, 2006 at 04:05:49PM -0300, Gustavo Sverzut Barbieri wrote:
> > This fix one of most broken code present in drawtext: measure and
> > cache of glyphs in order to draw them on picture. This also fix
> > background drawing for single-line strings and avoid out-of-buffer
> > drawing.
> >
> > It defines 2 extra functions to help code readability:
> >
> > - get_kerning() given 2 char index (current and previous) get the
> > pixel offset for kerning.
> > - get_offset_based_on_previous(): given characters and context, check
> > if kerning is possible and use get_kerning().
>
> [...]
> >
> > +          /* save position */
> > +          pos[i].x = x + ci->bitmap_left[c];
> > +          pos[i].y = y - ci->bitmap_top[c] + ci->baseline;
> > +
> > +          x += ci->advance[c];
> > +          if (i + 1 < size)
> > +            x += get_offset_based_on_previous(ci, c, text[i + 1]);
> >
> > -      /* save position */
> > -      pos[i].x = x + ci->bitmap_left[c];
> > -      pos[i].y = y - ci->bitmap_top[c] + ci->baseline;
> > -
> > -
> > -      x += ci->advance[c];

Gustavo, if you wish to get your patch applied, you need to resend a
cleanned-up patch.

Guillaume


-- 
With DADVSI (http://en.wikipedia.org/wiki/DADVSI), France finally has
a lead on USA on selling out individuals right to corporations!
Vive la France!




More information about the ffmpeg-devel mailing list