[FFmpeg-devel] [PATCH] vf_drawtext: drop text wrapping feature

Michael Niedermayer michaelni at gmx.at
Wed Sep 21 16:45:25 CEST 2011


On Wed, Sep 21, 2011 at 11:17:42AM +0200, Stefano Sabatini wrote:
> On date Tuesday 2011-09-20 23:30:42 +0200, Michael Niedermayer encoded:
> > On Tue, Sep 20, 2011 at 08:30:39PM +0200, Stefano Sabatini wrote:
> > > Or in other word, do not go to the next line when the text cannot be
> > > rendered within the frame.
> > > 
> > > The rationale is that wrapping is hard to manage, as it depends on the
> > > position of the text, thus making hard/impossible to compute the size
> > > occupied by the rendered text, and makes the filter behavior
> > > unpredictible with moving text (implemented in a pending patch).
> > > ---
> > >  libavfilter/vf_drawtext.c |    6 ------
> > >  1 files changed, 0 insertions(+), 6 deletions(-)
> > > 
> > > diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
> > > index fbb1e53..d7447c2 100644
> > > --- a/libavfilter/vf_drawtext.c
> > > +++ b/libavfilter/vf_drawtext.c
> > > @@ -655,12 +655,6 @@ static int draw_text(AVFilterContext *ctx, AVFilterBufferRef *picref,
> > >              x += delta.x >> 6;
> > >          }
> > >  
> > > -        if (x + glyph->bbox.xMax >= width) {
> > > -            max_text_line_w = FFMAX(max_text_line_w, x - dtext->x);
> > > -            y += max_text_line_h;
> > > -            x = dtext->x;
> > > -        }
> > 
> > This could be made conditional on a user set flag
> 
> That was my first implementation, then I realized that this option
> clashes with parametric x/y evaluation, and drawbox is not supposed to
> be a word processor so I don't want to add too much complexity for
> dealing with that case.
> 
> I could add a wrapline option, which disables x and y evaluation (so
> basically x and y are evaluated only during the configuration stage
> when wrapline=1), that would be a bit clumsy, but I can implement this
> behavior if you think it is worth to do so.

I dont know, iam no "user" of this code. Its a question the users
should awnser. Iam fine with anything our users are fine with here

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

There seems to be only one solution to NIH syndrom, ... a shooting squad
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110921/baa1f1a6/attachment.asc>


More information about the ffmpeg-devel mailing list