summaryrefslogtreecommitdiffstats
path: root/libass
diff options
context:
space:
mode:
authoreugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-05-02 23:32:29 +0000
committereugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-05-02 23:32:29 +0000
commit479b7263863530a4a59056c0240f8c2a8d3e7f7d (patch)
tree32ba933513a995522160d5e54e2bd5b66bb514e5 /libass
parentcbf77e3e9f46757c9a8c5c3e646d71a721ca7494 (diff)
downloadmpv-479b7263863530a4a59056c0240f8c2a8d3e7f7d.tar.bz2
mpv-479b7263863530a4a59056c0240f8c2a8d3e7f7d.tar.xz
Print more info about selected font.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26648 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libass')
-rw-r--r--libass/ass_fontconfig.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/libass/ass_fontconfig.c b/libass/ass_fontconfig.c
index f20f8d816c..c350930449 100644
--- a/libass/ass_fontconfig.c
+++ b/libass/ass_fontconfig.c
@@ -66,9 +66,9 @@ static char* _select_font(fc_instance_t* priv, const char* family, unsigned bold
FcBool rc;
FcResult result;
FcPattern *pat = 0, *rpat;
- int r_index;
+ int r_index, r_slant, r_weight;
FcChar8 *r_family, *r_style, *r_file, *r_fullname;
- FcBool r_outline;
+ FcBool r_outline, r_embolden;
FcCharSet* r_charset;
FcFontSet* fset = 0;
int curf;
@@ -157,6 +157,28 @@ static char* _select_font(fc_instance_t* priv, const char* family, unsigned bold
!(r_fullname && strcasecmp((const char*)r_fullname, family) == 0))
mp_msg(MSGT_ASS, MSGL_WARN, MSGTR_LIBASS_SelectedFontFamilyIsNotTheRequestedOne,
(const char*)(r_family ? r_family : r_fullname), family);
+
+ result = FcPatternGetString(rpat, FC_STYLE, 0, &r_style);
+ if (result != FcResultMatch)
+ r_style = NULL;
+
+ result = FcPatternGetInteger(rpat, FC_SLANT, 0, &r_slant);
+ if (result != FcResultMatch)
+ r_slant = 0;
+
+ result = FcPatternGetInteger(rpat, FC_WEIGHT, 0, &r_weight);
+ if (result != FcResultMatch)
+ r_weight = 0;
+
+ result = FcPatternGetBool(rpat, FC_EMBOLDEN, 0, &r_embolden);
+ if (result != FcResultMatch)
+ r_embolden = 0;
+
+ mp_msg(MSGT_ASS, MSGL_V, "[ass] Font info: family '%s', style '%s', fullname '%s',"
+ " slant %d, weight %d%s\n",
+ (const char*)r_family, (const char*)r_style, (const char*)r_fullname,
+ r_slant, r_weight, r_embolden ? ", embolden" : "");
+
error:
if (pat) FcPatternDestroy(pat);
if (fset) FcFontSetDestroy(fset);