Commit ee39258e authored by Francois Cartegnie's avatar Francois Cartegnie

freetype: enable outliner at all times

parent 353812ff
...@@ -1090,8 +1090,7 @@ static int Render( filter_t *p_filter, subpicture_region_t *p_region_out, ...@@ -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, static int Init_FT( vlc_object_t *p_this,
const char *psz_fontfile, const char *psz_fontfile,
const int fontindex, const int fontindex )
const float f_outline_thickness)
{ {
filter_t *p_filter = (filter_t *)p_this; filter_t *p_filter = (filter_t *)p_this;
filter_sys_t *p_sys = p_filter->p_sys; filter_sys_t *p_sys = p_filter->p_sys;
...@@ -1129,13 +1128,9 @@ static int Init_FT( vlc_object_t *p_this, ...@@ -1129,13 +1128,9 @@ static int Init_FT( vlc_object_t *p_this,
if( SetFontSize( p_filter, (int) 0 ) != VLC_SUCCESS ) goto error; if( SetFontSize( p_filter, (int) 0 ) != VLC_SUCCESS ) goto error;
p_sys->p_stroker = NULL; i_error = FT_Stroker_New( p_sys->p_library, &p_sys->p_stroker );
if( f_outline_thickness > .001f ) 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; return VLC_SUCCESS;
...@@ -1262,7 +1257,7 @@ static int Create( vlc_object_t *p_this ) ...@@ -1262,7 +1257,7 @@ static int Create( vlc_object_t *p_this )
if( !psz_monofontfile ) if( !psz_monofontfile )
psz_monofontfile = File_Select( p_sys->p_default_style->psz_monofontname ); 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; goto error;
int i_faces_size = 20; int i_faces_size = 20;
......
...@@ -793,7 +793,7 @@ static int LoadGlyphs( filter_t *p_filter, paragraph_t *p_paragraph, ...@@ -793,7 +793,7 @@ static int LoadGlyphs( filter_t *p_filter, paragraph_t *p_paragraph,
else else
p_face = p_run->p_face; 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 = double f_outline_thickness =
var_InheritInteger( p_filter, "freetype-outline-thickness" ) / 100.0; var_InheritInteger( p_filter, "freetype-outline-thickness" ) / 100.0;
...@@ -845,7 +845,7 @@ static int LoadGlyphs( filter_t *p_filter, paragraph_t *p_paragraph, ...@@ -845,7 +845,7 @@ static int LoadGlyphs( filter_t *p_filter, paragraph_t *p_paragraph,
continue; 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; p_bitmaps->p_outline = p_bitmaps->p_glyph;
if( FT_Glyph_StrokeBorder( &p_bitmaps->p_outline, if( FT_Glyph_StrokeBorder( &p_bitmaps->p_outline,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment