[FFmpeg-devel] [PATCH] libavfilter: increase vf_drawtext line height

Михаил Муковников yndi at me.com
Wed Oct 1 16:07:02 CEST 2014


It’s a common practice to add some space between lines (typically 0.2 * font-height) as it dramatically increases readability. In my opinion, the default behaviour increasing the height just by max_glyph_h is not a very good one.

diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
index 4fbb6c0..9d68a27 100644
--- a/libavfilter/vf_drawtext.c
+++ b/libavfilter/vf_drawtext.c
@@ -1232,7 +1232,7 @@ static int draw_text(AVFilterContext *ctx, AVFrame *frame,
         if (is_newline(code)) {

             max_text_line_w = FFMAX(max_text_line_w, x);
-            y += s->max_glyph_h;
+            y += s->max_glyph_h * 1.2;
             x = 0;
             continue;
         }



More information about the ffmpeg-devel mailing list