rpms/vlc/devel vlc-1.0-bugfix-bp-font_family.patch,1.1,1.2

NicolasChauvet kwizart at rpmfusion.org
Tue Jul 28 16:10:46 CEST 2009


Author: kwizart

Update of /cvs/free/rpms/vlc/devel
In directory se02.es.rpmfusion.net:/tmp/cvs-serv4114

Modified Files:
	vlc-1.0-bugfix-bp-font_family.patch 
Log Message:
Update font_family


vlc-1.0-bugfix-bp-font_family.patch:

Index: vlc-1.0-bugfix-bp-font_family.patch
===================================================================
RCS file: /cvs/free/rpms/vlc/devel/vlc-1.0-bugfix-bp-font_family.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- vlc-1.0-bugfix-bp-font_family.patch	28 Jul 2009 13:46:03 -0000	1.1
+++ vlc-1.0-bugfix-bp-font_family.patch	28 Jul 2009 14:10:45 -0000	1.2
@@ -1,5 +1,5 @@
 diff --git a/modules/misc/freetype.c b/modules/misc/freetype.c
-index 7e45866..0dc3143 100644
+index 7e45866..a0c3a93 100644
 --- a/modules/misc/freetype.c
 +++ b/modules/misc/freetype.c
 @@ -70,6 +70,8 @@
@@ -45,7 +45,7 @@
  
      /* Allocate structure */
      p_filter->p_sys = p_sys = malloc( sizeof( filter_sys_t ) );
-@@ -297,52 +311,77 @@ static int Create( vlc_object_t *p_this )
+@@ -297,52 +311,88 @@ static int Create( vlc_object_t *p_this )
      p_sys->i_font_size = 0;
      p_sys->i_display_height = 0;
  
@@ -71,6 +71,16 @@
 -    var_Get( p_filter, "freetype-font", &val );
 -    psz_fontfile = val.psz_string;
 -    if( !psz_fontfile || !*psz_fontfile )
+-    {
+-        free( psz_fontfile );
+-        psz_fontfile = (char *)malloc( PATH_MAX + 1 );
+-        if( !psz_fontfile )
+-            goto error;
+-#ifdef WIN32
+-        GetWindowsDirectory( psz_fontfile, PATH_MAX + 1 );
+-        strcat( psz_fontfile, "\\fonts\\arial.ttf" );
+-#elif defined(__APPLE__)
+-        strcpy( psz_fontfile, DEFAULT_FONT );
 +
 +    psz_fontfamily = var_CreateGetString( p_filter, "freetype-font" );
 +    p_sys->i_default_font_size = var_CreateGetInteger( p_filter, "freetype-fontsize" );
@@ -82,16 +92,7 @@
 +
 +    fontindex=0;
 +    if( !psz_fontfamily || !*psz_fontfamily )
-     {
--        free( psz_fontfile );
--        psz_fontfile = (char *)malloc( PATH_MAX + 1 );
--        if( !psz_fontfile )
--            goto error;
--#ifdef WIN32
--        GetWindowsDirectory( psz_fontfile, PATH_MAX + 1 );
--        strcat( psz_fontfile, "\\fonts\\arial.ttf" );
--#elif defined(__APPLE__)
--        strcpy( psz_fontfile, DEFAULT_FONT );
++    {
 +#ifdef HAVE_FONTCONFIG
 +        free( psz_fontfamily);
 +        psz_fontfamily=strdup( DEFAULT_FONT );
@@ -130,13 +131,24 @@
 +    FcDefaultSubstitute( fontpattern );
 +
 +    fontmatch = FcFontMatch( NULL, fontpattern, &fontresult );
++    if( fontresult == FcResultNoMatch )
++    {
++        free( psz_fontsize );
++        FcPatternDestroy( fontpattern );
++        FcPatternDestroy( fontmatch );
++        goto error;
++    }
 +
 +    FcPatternGetString( fontmatch, FC_FILE, 0, (FcChar8 **)&psz_fontfile);
 +    FcPatternGetInteger( fontmatch, FC_INDEX, 0, &fontindex );
++    free( psz_fontsize );
 +    if( !psz_fontfile )
++    {
++        FcPatternDestroy( fontpattern );
++        FcPatternDestroy( fontmatch );
 +        goto error;
++    }
 +    msg_Dbg( p_filter, "Using %s as font from file %s", psz_fontfamily, psz_fontfile);
-+    free( psz_fontsize );
 +#else
 +    psz_fontfile = psz_fontfamily;
 +#endif
@@ -155,7 +167,7 @@
      if( i_error == FT_Err_Unknown_File_Format )
      {
          msg_Err( p_filter, "file %s have unknown format", psz_fontfile );
-@@ -369,11 +408,8 @@ static int Create( vlc_object_t *p_this )
+@@ -369,11 +419,8 @@ static int Create( vlc_object_t *p_this )
  
      p_sys->i_use_kerning = FT_HAS_KERNING( p_sys->p_face );
  
@@ -167,7 +179,7 @@
  
      p_sys->pp_font_attachments = NULL;
      p_sys->i_font_attachments = 0;
-@@ -381,10 +417,13 @@ static int Create( vlc_object_t *p_this )
+@@ -381,10 +428,13 @@ static int Create( vlc_object_t *p_this )
      p_filter->pf_render_text = RenderText;
  #ifdef HAVE_FONTCONFIG
      p_filter->pf_render_html = RenderHtml;



More information about the rpmfusion-commits mailing list