[vlc-commits] commit: freetype: Try to use non-bitmap fonts first and fallback to bitmap ones ( 김정은 )

git at videolan.org git at videolan.org
Sun May 30 01:14:22 CEST 2010


vlc/vlc-1.1 | branch: master | 김정은 <sunqueen at paran.com> | Sat May 29 20:08:18 2010 +0300| [50b2a3bb51899b3de2fc5c2273e04d0443d0226c] | committer: Jean-Baptiste Kempf 

freetype: Try to use non-bitmap fonts first and fallback to bitmap ones

Signed-off-by: Ilkka Ollakka <ileoo at videolan.org>
(commited with --author, no git-format patch was send to vlc-devel even if requested)
(cherry picked from commit 6650cb888870a57b45165635a486d36d9afbcf87)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/misc/freetype.c |   26 +++++++++++++++++---------
 1 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/modules/misc/freetype.c b/modules/misc/freetype.c
index 50dcb55..e83e721 100644
--- a/modules/misc/freetype.c
+++ b/modules/misc/freetype.c
@@ -1242,12 +1242,16 @@ static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out,
         }
         p_line->p_glyph_pos[ i ].x = i_pen_x;
         p_line->p_glyph_pos[ i ].y = i_pen_y;
-        i_error = FT_Load_Glyph( face, i_glyph_index, FT_LOAD_DEFAULT );
+        i_error = FT_Load_Glyph( face, i_glyph_index, FT_LOAD_NO_BITMAP | FT_LOAD_DEFAULT );
         if( i_error )
         {
-            msg_Err( p_filter, "unable to render text FT_Load_Glyph returned"
-                               " %d", i_error );
-            goto error;
+	        i_error = FT_Load_Glyph( face, i_glyph_index, FT_LOAD_DEFAULT );
+	        if( i_error )
+	        {
+	            msg_Err( p_filter, "unable to render text FT_Load_Glyph returned"
+	                               " %d", i_error );
+	            goto error;
+	        }
         }
         i_error = FT_Get_Glyph( glyph, &tmp_glyph );
         if( i_error )
@@ -1528,13 +1532,17 @@ static int RenderTag( filter_t *p_filter, FT_Face p_face, int i_font_color,
         p_line->p_glyph_pos[ i ].x = *pi_pen_x;
         p_line->p_glyph_pos[ i ].y = i_pen_y;
 
-        i_error = FT_Load_Glyph( p_face, i_glyph_index, FT_LOAD_DEFAULT );
+        i_error = FT_Load_Glyph( p_face, i_glyph_index, FT_LOAD_NO_BITMAP | FT_LOAD_DEFAULT );
         if( i_error )
         {
-            msg_Err( p_filter,
-                   "unable to render text FT_Load_Glyph returned %d", i_error );
-            p_line->pp_glyphs[ i ] = NULL;
-            return VLC_EGENERIC;
+	        i_error = FT_Load_Glyph( p_face, i_glyph_index, FT_LOAD_DEFAULT );
+	        if( i_error )
+	        {
+	            msg_Err( p_filter,
+	                   "unable to render text FT_Load_Glyph returned %d", i_error );
+	            p_line->pp_glyphs[ i ] = NULL;
+	            return VLC_EGENERIC;
+	        }
         }
 
         /* Do synthetic styling now that Freetype supports it;



More information about the vlc-commits mailing list