[vlc-commits] Added an option to force bold font by default.

Laurent Aimar git at videolan.org
Sat Jun 25 21:05:00 CEST 2011


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sat Jun 25 21:04:25 2011 +0200| [9acd8e268e93f351e0fd790d3cc2da6a4de6679b] | committer: Laurent Aimar

Added an option to force bold font by default.

Some people find it more readable.

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

 modules/misc/text_renderer/freetype.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/modules/misc/text_renderer/freetype.c b/modules/misc/text_renderer/freetype.c
index 767f94d..5eac887 100644
--- a/modules/misc/text_renderer/freetype.c
+++ b/modules/misc/text_renderer/freetype.c
@@ -121,6 +121,7 @@ static void Destroy( vlc_object_t * );
 #define FONTSIZER_LONGTEXT N_("This is the relative default size of the " \
     "fonts that will be rendered on the video. If absolute font size is set, "\
     "relative size will be overridden." )
+#define BOLD_TEXT N_("Force bold")
 
 #define BG_OPACITY_TEXT N_("Background opacity")
 #define BG_COLOR_TEXT N_("Background color")
@@ -191,6 +192,9 @@ vlc_module_begin ()
         change_integer_list( pi_color_values, ppsz_color_descriptions )
         change_safe()
 
+    add_bool( "freetype-bold", false, BOLD_TEXT, "", false )
+        change_safe()
+
     add_integer_with_range( "freetype-background-opacity", 0, 0, 255,
                             BG_OPACITY_TEXT, "", false )
         change_safe()
@@ -285,6 +289,7 @@ struct filter_sys_t
     uint8_t        i_font_opacity;
     int            i_font_color;
     int            i_font_size;
+    bool           b_font_bold;
 
     uint8_t        i_background_opacity;
     int            i_background_color;
@@ -1470,6 +1475,8 @@ static int ProcessNodes( filter_t *p_filter,
                        0x00ffffff );
     }
 #endif
+    if( p_sys->b_font_bold )
+        i_style_flags |= STYLE_BOLD;
 
     if( rv != VLC_SUCCESS )
         return rv;
@@ -2348,6 +2355,8 @@ static int RenderCommon( filter_t *p_filter, subpicture_region_t *p_region_out,
                                    (p_sys->i_font_color & 0xffffff) |
                                    ((p_sys->i_font_opacity & 0xff) << 24),
                                    0x00ffffff, 0);
+        if( p_sys->b_font_bold )
+            p_style->i_style_flags |= STYLE_BOLD;
 
         i_text_length = SetupText( p_filter,
                                    psz_text,
@@ -2475,6 +2484,7 @@ static int Create( vlc_object_t *p_this )
     p_sys->i_font_opacity = __MAX( __MIN( p_sys->i_font_opacity, 255 ), 0 );
     p_sys->i_font_color = var_InheritInteger( p_filter, "freetype-color" );
     p_sys->i_font_color = __MAX( __MIN( p_sys->i_font_color , 0xFFFFFF ), 0 );
+    p_sys->b_font_bold = var_InheritBool( p_filter, "freetype-bold" );
 
     p_sys->i_background_opacity = var_InheritInteger( p_filter,"freetype-background-opacity" );;
     p_sys->i_background_opacity = __MAX( __MIN( p_sys->i_background_opacity, 255 ), 0 );



More information about the vlc-commits mailing list