[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:03:11 CEST 2012


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Thu May 31 15:00:39 2012 +0200| [e943ace33cce82c1a59b67000f2fbd99ff54130e] | 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

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

 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 660d492..f4d9579 100644
--- a/modules/text_renderer/freetype.c
+++ b/modules/text_renderer/freetype.c
@@ -734,9 +734,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