[vlc-commits] Added (back?) support for automatic font size when using a style in freetype.

Laurent Aimar git at videolan.org
Wed Oct 5 23:17:40 CEST 2011


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Wed Oct  5 23:15:44 2011 +0200| [9d0665c00dd49f8591d76af7bb1f37501a6905f0] | committer: Laurent Aimar

Added (back?) support for automatic font size when using a style in freetype.

It closes the other half of #5375.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9d0665c00dd49f8591d76af7bb1f37501a6905f0
---

 modules/text_renderer/freetype.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/modules/text_renderer/freetype.c b/modules/text_renderer/freetype.c
index aadb9c5..069e01d 100644
--- a/modules/text_renderer/freetype.c
+++ b/modules/text_renderer/freetype.c
@@ -1453,7 +1453,8 @@ static int ProcessNodes( filter_t *p_filter,
     {
         rv = PushFont( &p_fonts,
                p_font_style->psz_fontname,
-               p_font_style->i_font_size,
+               p_font_style->i_font_size > 0 ? p_font_style->i_font_size
+                                             : p_sys->i_font_size,
                (p_font_style->i_font_color & 0xffffff) |
                    ((p_font_style->i_font_alpha & 0xff) << 24),
                (p_font_style->i_karaoke_background_color & 0xffffff) |
@@ -2349,7 +2350,8 @@ static int RenderCommon( filter_t *p_filter, subpicture_region_t *p_region_out,
         text_style_t *p_style;
         if( p_region_in->p_style )
             p_style = CreateStyle( p_region_in->p_style->psz_fontname,
-                                   p_region_in->p_style->i_font_size,
+                                   p_region_in->p_style->i_font_size > 0 ? p_region_in->p_style->i_font_size
+                                                                         : p_sys->i_font_size,
                                    (p_region_in->p_style->i_font_color & 0xffffff) |
                                    ((p_region_in->p_style->i_font_alpha & 0xff) << 24),
                                    0x00ffffff,



More information about the vlc-commits mailing list