[vlc-commits] freetype: move font defaults
Francois Cartegnie
git at videolan.org
Tue Dec 6 19:52:20 CET 2016
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Dec 6 17:39:56 2016 +0100| [3ec23b32c508581e445fb139e6f3354df7af1188] | committer: Francois Cartegnie
freetype: move font defaults
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3ec23b32c508581e445fb139e6f3354df7af1188
---
modules/text_renderer/freetype/freetype.c | 44 +++++++++++++++----------------
1 file changed, 22 insertions(+), 22 deletions(-)
diff --git a/modules/text_renderer/freetype/freetype.c b/modules/text_renderer/freetype/freetype.c
index ca1f0e8..569a588 100644
--- a/modules/text_renderer/freetype/freetype.c
+++ b/modules/text_renderer/freetype/freetype.c
@@ -939,6 +939,28 @@ static void FillDefaultStyles( filter_t *p_filter )
{
filter_sys_t *p_sys = p_filter->p_sys;
+ /* Set default psz_fontname */
+ if( !p_sys->p_default_style->psz_fontname || !*p_sys->p_default_style->psz_fontname )
+ {
+ free( p_sys->p_default_style->psz_fontname );
+#ifdef HAVE_GET_FONT_BY_FAMILY_NAME
+ p_sys->p_default_style->psz_fontname = strdup( DEFAULT_FAMILY );
+#else
+ p_sys->p_default_style->psz_fontname = File_Select( DEFAULT_FONT_FILE );
+#endif
+ }
+
+ /* set default psz_monofontname */
+ if( !p_sys->p_default_style->psz_monofontname || !*p_sys->p_default_style->psz_monofontname )
+ {
+ free( p_sys->p_default_style->psz_monofontname );
+#ifdef HAVE_GET_FONT_BY_FAMILY_NAME
+ p_sys->p_default_style->psz_monofontname = strdup( DEFAULT_MONOSPACE_FAMILY );
+#else
+ p_sys->p_default_style->psz_monofontname = File_Select( DEFAULT_MONOSPACE_FONT_FILE );
+#endif
+ }
+
UpdateDefaultLiveStyles( p_filter );
p_sys->p_default_style->psz_fontname = var_InheritString( p_filter, "freetype-font" );
@@ -1240,28 +1262,6 @@ static int Create( vlc_object_t *p_this )
p_sys->f_shadow_vector_x = f_shadow_distance * cosf((float)(2. * M_PI) * f_shadow_angle / 360);
p_sys->f_shadow_vector_y = f_shadow_distance * sinf((float)(2. * M_PI) * f_shadow_angle / 360);
- /* Set default psz_fontname */
- if( !p_sys->p_default_style->psz_fontname || !*p_sys->p_default_style->psz_fontname )
- {
- free( p_sys->p_default_style->psz_fontname );
-#ifdef HAVE_GET_FONT_BY_FAMILY_NAME
- p_sys->p_default_style->psz_fontname = strdup( DEFAULT_FAMILY );
-#else
- p_sys->p_default_style->psz_fontname = File_Select( DEFAULT_FONT_FILE );
-#endif
- }
-
- /* set default psz_monofontname */
- if( !p_sys->p_default_style->psz_monofontname || !*p_sys->p_default_style->psz_monofontname )
- {
- free( p_sys->p_default_style->psz_monofontname );
-#ifdef HAVE_GET_FONT_BY_FAMILY_NAME
- p_sys->p_default_style->psz_monofontname = strdup( DEFAULT_MONOSPACE_FAMILY );
-#else
- p_sys->p_default_style->psz_monofontname = File_Select( DEFAULT_MONOSPACE_FONT_FILE );
-#endif
- }
-
if( LoadFontsFromAttachments( p_filter ) == VLC_ENOMEM )
goto error;
More information about the vlc-commits
mailing list