[FFmpeg-devel] [PATCH] vf_drawtext: support to set glyph spacing while drawing text. ./ffmpeg -i input -vf drawtext="glyph_spacing=10:textfile=1.txt:fontfile=demo.ttf" -f flv 1.flv could set glyph spacing 10 pixel.

Moritz Barsnick barsnick at gmx.net
Thu Jul 20 14:59:14 EEST 2017


On Thu, Jul 20, 2017 at 17:46:25 +0800, efren yang wrote:

> Subject: [FFmpeg-devel] [PATCH] vf_drawtext: support to set glyph spacing while drawing text. ./ffmpeg -i input -vf
>        drawtext="glyph_spacing=10:textfile=1.txt:fontfile=demo.ttf" -f flv 1.flv could set glyph spacing 10 pixel.

As Nicolas wrote, this needs to be fixed.

a) Please prefix "libavfilter/vf_drawtext" or "lavfi/vf_drawtext".
b) There needs to be an empty line in the commit message before the
following text, otherwise, everything gets compressed into one line as
above.
c) The example is probably too simple to be worth mentioning.

Please also add the requested documentation of the filter option to
doc/filters.texi.

Your patch is on top of your other patch. Don't do that, the other one
wasn't accepted. Always provide a patch against master HEAD. (You
should locally squash your two commits into one, e.g. on another new
branch, and submit that squashed commit.)

> -    int word_spacing;               ///< word spacing in pixels
> +    int glyph_spacing;               ///< glyph spacing in pixels
                                       ^
Your renaming shifted the whitespace/indentation.

>      {"line_spacing",  "set line spacing in pixels", OFFSET(line_spacing),   AV_OPT_TYPE_INT,    {.i64=0},     INT_MIN,  INT_MAX,FLAGS},
> -    {"word_spacing",  "set word spacing in pixels", OFFSET(word_spacing),   AV_OPT_TYPE_INT,{ .i64 = 0 },     INT_MIN,  INT_MAX,FLAGS },
> +    {"glyph_spacing",  "set glyph spacing in pixels", OFFSET(glyph_spacing),   AV_OPT_TYPE_INT,{ .i64 = 0 },     INT_MIN,  INT_MAX,FLAGS },
                                                                               ^                  ^
You lost alignment of the parameters, and your bracket alignment might
as well correspond to that of the line "line_spacing".

Moritz


More information about the ffmpeg-devel mailing list