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

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19068 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
eugeni 2006-07-13 18:49:06 +00:00
parent 32492483c0
commit 8e9ac90c48
1 changed files with 6 additions and 4 deletions

View File

@ -43,16 +43,18 @@ static char* _select_font(fc_instance_t* priv, const char* family, unsigned bold
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);