[vlc-commits] freetype: in case the provided font name is neither found by name nor by family, let ATS check whether it is a correct PostScript name

Felix Paul Kühne git at videolan.org
Thu May 31 15:12:29 CEST 2012


vlc/vlc-2.0 | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Thu May 31 15:00:39 2012 +0200| [47034c142b21c438d3e5ca85ddf0a06e5d69c63d] | committer: Felix Paul Kühne

freetype: in case the provided font name is neither found by name nor by family, let ATS check whether it is a correct PostScript name

This fixes issues with some Asian fonts as pointed by Naohiro Koriyama
(cherry picked from commit e943ace33cce82c1a59b67000f2fbd99ff54130e)

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

 modules/text_renderer/freetype.c |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/modules/text_renderer/freetype.c b/modules/text_renderer/freetype.c
index b6170aa..6fb54df 100644
--- a/modules/text_renderer/freetype.c
+++ b/modules/text_renderer/freetype.c
@@ -733,9 +733,15 @@ static char* MacLegacy_Select( filter_t *p_filter, const char* psz_fontname,
 
         if ( ats_font_id == 0 || ats_font_id == 0xFFFFFFFFUL )
         {
-            msg_Err( p_filter, "ATS couldn't find either %s nor its family", psz_fontname );
-            CFRelease( cf_fontName );
-            return NULL;
+            msg_Dbg( p_filter, "ATS couldn't find either %s nor its family, checking PS name", psz_fontname );
+            ats_font_id = ATSFontFindFromPostScriptName( cf_fontName, kATSOptionFlagsDefault );
+
+            if ( ats_font_id == 0 || ats_font_id == 0xFFFFFFFFUL )
+            {
+                msg_Err( p_filter, "ATS couldn't find %s (no font name, family or PS name)", psz_fontname );
+                CFRelease( cf_fontName );
+                return NULL;
+            }
         }
     }
     CFRelease( cf_fontName );



More information about the vlc-commits mailing list