[vlc-commits] freetype: don't load default font in Open()

Francois Cartegnie git at videolan.org
Wed Aug 26 10:45:53 CEST 2020


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Aug 25 16:43:59 2020 +0200| [e5d580fb2a5a47c338e6bd0a52ec085e6281636a] | committer: Francois Cartegnie

freetype: don't load default font in Open()

Size if never valid without target region (16x16), so
that face is unusable.

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

 modules/text_renderer/freetype/freetype.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/modules/text_renderer/freetype/freetype.c b/modules/text_renderer/freetype/freetype.c
index 5326f3467c..88d07e18bd 100644
--- a/modules/text_renderer/freetype/freetype.c
+++ b/modules/text_renderer/freetype/freetype.c
@@ -1185,6 +1185,7 @@ static int Render( filter_t *p_filter, subpicture_region_t *p_region_out,
             msg_Err( p_filter, "Render(): Error loading default face" );
             return VLC_EGENERIC;
         }
+        p_sys->i_font_default_size = i_font_default_size;
     }
 
     layout_text_block_t text_block = { 0 };
@@ -1435,14 +1436,6 @@ static int Create( vlc_object_t *p_this )
     if( LoadFontsFromAttachments( p_filter ) == VLC_ENOMEM )
         goto error;
 
-    p_sys->p_faceid = SelectAndLoadFace( p_filter, p_sys->p_default_style, ' ' );
-    if( !p_sys->p_faceid )
-    {
-        msg_Err( p_filter, "Error loading default face %s",
-                 p_sys->p_default_style->psz_fontname );
-        goto error;
-    }
-
     p_filter->pf_render = Render;
 
     return VLC_SUCCESS;



More information about the vlc-commits mailing list