[MPlayer-cvslog] r19068 - trunk/libass/ass_fontconfig.c

eugeni subversion at mplayerhq.hu
Thu Jul 13 20:49:06 CEST 2006


Author: eugeni
Date: Thu Jul 13 20:49:06 2006
New Revision: 19068

Modified:
   trunk/libass/ass_fontconfig.c

Log:
Use FcPatternAdd-Type instead of FcNameParse. The latter, as it turns out, requires escaping of some characters ('-', maybe more).


Modified: trunk/libass/ass_fontconfig.c
==============================================================================
--- trunk/libass/ass_fontconfig.c	(original)
+++ trunk/libass/ass_fontconfig.c	Thu Jul 13 20:49:06 2006
@@ -43,16 +43,18 @@
 	int val_i;
 	FcChar8* val_s;
 	FcBool val_b;
-	char buf[2000];
 	
 	*index = 0;
 
-	snprintf(buf, 2000, "%s:outline=True:slant=%u:weight=%u", family, italic, bold);
-
-	pat = FcNameParse((const FcChar8*)buf);
+	pat = FcPatternCreate();
 	if (!pat)
 		return 0;
 	
+	FcPatternAddString(pat, FC_FAMILY, (const FcChar8*)family);
+	FcPatternAddBool(pat, FC_OUTLINE, FcTrue);
+	FcPatternAddInteger(pat, FC_SLANT, italic);
+	FcPatternAddInteger(pat, FC_WEIGHT, bold);
+
 	FcDefaultSubstitute(pat);
 	
 	rc = FcConfigSubstitute(priv->config, pat, FcMatchPattern);



More information about the MPlayer-cvslog mailing list