[vlc-commits] freetype: enable outliner at all times

Francois Cartegnie git at videolan.org
Mon Aug 24 22:45:45 CEST 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Aug 24 12:02:37 2015 +0200| [ee39258ee6b7c8699fe4705776b5f624660a5d8b] | committer: Francois Cartegnie

freetype: enable outliner at all times

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

 modules/text_renderer/freetype.c    |   15 +++++----------
 modules/text_renderer/text_layout.c |    4 ++--
 2 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/modules/text_renderer/freetype.c b/modules/text_renderer/freetype.c
index 47268b2..d750806 100644
--- a/modules/text_renderer/freetype.c
+++ b/modules/text_renderer/freetype.c
@@ -1090,8 +1090,7 @@ static int Render( filter_t *p_filter, subpicture_region_t *p_region_out,
  *****************************************************************************/
 static int Init_FT( vlc_object_t *p_this,
                     const char *psz_fontfile,
-                    const int fontindex,
-                    const float f_outline_thickness)
+                    const int fontindex )
 {
     filter_t      *p_filter = (filter_t *)p_this;
     filter_sys_t  *p_sys = p_filter->p_sys;
@@ -1129,13 +1128,9 @@ static int Init_FT( vlc_object_t *p_this,
 
     if( SetFontSize( p_filter, (int) 0 ) != VLC_SUCCESS ) goto error;
 
-    p_sys->p_stroker = NULL;
-    if( f_outline_thickness > .001f )
-    {
-        i_error = FT_Stroker_New( p_sys->p_library, &p_sys->p_stroker );
-        if( i_error )
-            msg_Err( p_filter, "Failed to create stroker for outlining" );
-    }
+    i_error = FT_Stroker_New( p_sys->p_library, &p_sys->p_stroker );
+    if( i_error )
+        msg_Err( p_filter, "Failed to create stroker for outlining" );
 
     return VLC_SUCCESS;
 
@@ -1262,7 +1257,7 @@ static int Create( vlc_object_t *p_this )
     if( !psz_monofontfile )
         psz_monofontfile = File_Select( p_sys->p_default_style->psz_monofontname );
 
-    if( Init_FT( p_this, psz_fontfile, fontindex, f_outline_thickness ) != VLC_SUCCESS )
+    if( Init_FT( p_this, psz_fontfile, fontindex ) != VLC_SUCCESS )
         goto error;
 
     int i_faces_size = 20;
diff --git a/modules/text_renderer/text_layout.c b/modules/text_renderer/text_layout.c
index 1095521..7297562 100644
--- a/modules/text_renderer/text_layout.c
+++ b/modules/text_renderer/text_layout.c
@@ -793,7 +793,7 @@ static int LoadGlyphs( filter_t *p_filter, paragraph_t *p_paragraph,
         else
             p_face = p_run->p_face;
 
-        if( p_sys->p_stroker )
+        if( p_sys->p_stroker && (p_style->i_style_flags & STYLE_OUTLINE) )
         {
             double f_outline_thickness =
                 var_InheritInteger( p_filter, "freetype-outline-thickness" ) / 100.0;
@@ -845,7 +845,7 @@ static int LoadGlyphs( filter_t *p_filter, paragraph_t *p_paragraph,
                 continue;
             }
 
-            if( p_filter->p_sys->p_stroker )
+            if( p_filter->p_sys->p_stroker && (p_style->i_style_flags & STYLE_OUTLINE) )
             {
                 p_bitmaps->p_outline = p_bitmaps->p_glyph;
                 if( FT_Glyph_StrokeBorder( &p_bitmaps->p_outline,



More information about the vlc-commits mailing list