diff options
author | Grigori Goronzy <greg@blackbox> | 2009-07-10 23:55:02 +0200 |
---|---|---|
committer | Grigori Goronzy <greg@blackbox> | 2009-07-11 00:03:56 +0200 |
commit | 613a22ab9b96453c10de6d75b43067652ad6d7db (patch) | |
tree | 76405fc5c113cb602f0778c85413fcb421aa127f /libass/ass_fontconfig.c | |
parent | 9305f3815442f8c0bd735e96832b7f72628bfcad (diff) | |
download | libass-613a22ab9b96453c10de6d75b43067652ad6d7db.tar.bz2 libass-613a22ab9b96453c10de6d75b43067652ad6d7db.tar.xz |
Replace string defines with real strings
Instead of referencing string defines from help_mp.h, use the strings
directly in ass_msg. Consequently, help_mp.h is useless and can
be deleted.
Diffstat (limited to 'libass/ass_fontconfig.c')
-rw-r--r-- | libass/ass_fontconfig.c | 67 |
1 files changed, 32 insertions, 35 deletions
diff --git a/libass/ass_fontconfig.c b/libass/ass_fontconfig.c index 2e6377a..e23c4f2 100644 --- a/libass/ass_fontconfig.c +++ b/libass/ass_fontconfig.c @@ -194,7 +194,8 @@ static char *_select_font(fc_instance_t *priv, const char *family, !(r_family && strcasecmp((const char *) r_family, family) == 0) && !(r_fullname && strcasecmp((const char *) r_fullname, family) == 0)) ass_msg(MSGL_WARN, - MSGTR_LIBASS_SelectedFontFamilyIsNotTheRequestedOne, + "fontconfig: Selected font is not the requested one: " + "'%s' != '%s'", (const char *) (r_fullname ? r_fullname : r_family), family); result = FcPatternGetString(rpat, FC_STYLE, 0, &r_style); @@ -214,8 +215,8 @@ static char *_select_font(fc_instance_t *priv, const char *family, r_embolden = 0; ass_msg(MSGL_V, - "[ass] Font info: family '%s', style '%s', fullname '%s'," - " slant %d, weight %d%s\n", (const char *) r_family, + "Font info: family '%s', style '%s', fullname '%s'," + " slant %d, weight %d%s", (const char *) r_family, (const char *) r_style, (const char *) r_fullname, r_slant, r_weight, r_embolden ? ", embolden" : ""); @@ -258,25 +259,28 @@ char *fontconfig_select(fc_instance_t *priv, const char *family, _select_font(priv, priv->family_default, 0, bold, italic, index, code); if (res) - ass_msg(MSGL_WARN, MSGTR_LIBASS_UsingDefaultFontFamily, - family, bold, italic, res, *index); + ass_msg(MSGL_WARN, "fontconfig_select: Using default font " + "family: (%s, %d, %d) -> %s, %d", + family, bold, italic, res, *index); } if (!res && priv->path_default) { res = priv->path_default; *index = priv->index_default; - ass_msg(MSGL_WARN, MSGTR_LIBASS_UsingDefaultFont, - family, bold, italic, res, *index); + ass_msg(MSGL_WARN, "fontconfig_select: Using default font: " + "(%s, %d, %d) -> %s, %d", family, bold, italic, + res, *index); } if (!res) { res = _select_font(priv, "Arial", 0, bold, italic, index, code); if (res) - ass_msg(MSGL_WARN, MSGTR_LIBASS_UsingArialFontFamily, - family, bold, italic, res, *index); + ass_msg(MSGL_WARN, "fontconfig_select: Using 'Arial' font " + "family: (%s, %d, %d) -> %s, %d", family, bold, italic, + res, *index); } if (res) ass_msg(MSGL_V, - "fontconfig_select: (%s, %d, %d) -> %s, %d\n", family, bold, - italic, res, *index); + "fontconfig_select: (%s, %d, %d) -> %s, %d", family, bold, + italic, res, *index); return res; } @@ -350,11 +354,11 @@ static void process_fontdata(fc_instance_t *priv, ass_library_t *library, res = mkdir(fonts_dir); #endif if (res) { - ass_msg(MSGL_WARN, - MSGTR_LIBASS_FailedToCreateDirectory, fonts_dir); + ass_msg(MSGL_WARN, "Failed to create directory '%s'", + fonts_dir); } } else if (!S_ISDIR(st.st_mode)) { - ass_msg(MSGL_WARN, MSGTR_LIBASS_NotADirectory, fonts_dir); + ass_msg(MSGL_WARN, "Not a directory: '%s'", fonts_dir); } fname = validate_fname((char *) name); @@ -380,7 +384,7 @@ static void process_fontdata(fc_instance_t *priv, ass_library_t *library, rc = FT_New_Memory_Face(ftlibrary, (unsigned char *) data, data_size, face_index, &face); if (rc) { - ass_msg(MSGL_WARN, MSGTR_LIBASS_ErrorOpeningMemoryFont, + ass_msg(MSGL_WARN, "Error opening memory font: %s", name); return; } @@ -390,24 +394,21 @@ static void process_fontdata(fc_instance_t *priv, ass_library_t *library, FcFreeTypeQueryFace(face, (unsigned char *) name, 0, FcConfigGetBlanks(priv->config)); if (!pattern) { - ass_msg(MSGL_WARN, MSGTR_LIBASS_FunctionCallFailed, - "FcFreeTypeQueryFace"); + ass_msg(MSGL_WARN, "%s failed", "FcFreeTypeQueryFace"); FT_Done_Face(face); return; } fset = FcConfigGetFonts(priv->config, FcSetSystem); // somehow it failes when asked for FcSetApplication if (!fset) { - ass_msg(MSGL_WARN, MSGTR_LIBASS_FunctionCallFailed, - "FcConfigGetFonts"); + ass_msg(MSGL_WARN, "%s failed", "FcConfigGetFonts"); FT_Done_Face(face); return; } res = FcFontSetAdd(fset, pattern); if (!res) { - ass_msg(MSGL_WARN, MSGTR_LIBASS_FunctionCallFailed, - "FcFontSetAdd"); + ass_msg(MSGL_WARN, "%s failed", "FcFontSetAdd"); FT_Done_Face(face); return; } @@ -436,7 +437,7 @@ fc_instance_t *fontconfig_init(ass_library_t *library, if (!fc) { ass_msg(MSGL_WARN, - MSGTR_LIBASS_FontconfigDisabledDefaultFontWillBeUsed); + "Fontconfig disabled, only default font will be used."); goto exit; } @@ -453,8 +454,7 @@ fc_instance_t *fontconfig_init(ass_library_t *library, } if (!rc || !priv->config) { - ass_msg(MSGL_FATAL, - MSGTR_LIBASS_FcInitLoadConfigAndFontsFailed); + ass_msg(MSGL_FATAL, "%s failed", "FcInitLoadConfigAndFonts"); goto exit; } @@ -463,10 +463,10 @@ fc_instance_t *fontconfig_init(ass_library_t *library, if (dir) { if (FcDirCacheValid((const FcChar8 *) dir) == FcFalse) { - ass_msg(MSGL_INFO, MSGTR_LIBASS_UpdatingFontCache); + ass_msg(MSGL_INFO, "Updating font cache"); if (FcGetVersion() >= 20390 && FcGetVersion() < 20400) - ass_msg(MSGL_WARN, - MSGTR_LIBASS_BetaVersionsOfFontconfigAreNotSupported); + ass_msg(MSGL_WARN, "Beta versions of fontconfig are not " + "supported. Update before reporting any bugs"); // FontConfig >= 2.4.0 updates cache automatically in FcConfigAppFontAddDir() if (FcGetVersion() < 20390) { FcFontSet *fcs; @@ -475,8 +475,7 @@ fc_instance_t *fontconfig_init(ass_library_t *library, fss = FcStrSetCreate(); rc = FcStrSetAdd(fss, (const FcChar8 *) dir); if (!rc) { - ass_msg(MSGL_WARN, - MSGTR_LIBASS_FcStrSetAddFailed); + ass_msg(MSGL_WARN, "%s failed", "FcStrSetAdd"); goto ErrorFontCache; } @@ -484,14 +483,13 @@ fc_instance_t *fontconfig_init(ass_library_t *library, FcConfigGetBlanks(priv->config), (const FcChar8 *) dir, FcFalse); if (!rc) { - ass_msg(MSGL_WARN, - MSGTR_LIBASS_FcDirScanFailed); + ass_msg(MSGL_WARN, "%s failed", "FcDirScan"); goto ErrorFontCache; } rc = FcDirSave(fcs, fss, (const FcChar8 *) dir); if (!rc) { - ass_msg(MSGL_WARN, MSGTR_LIBASS_FcDirSave); + ass_msg(MSGL_WARN, "%s failed", "FcDirSave"); goto ErrorFontCache; } ErrorFontCache: @@ -501,8 +499,7 @@ fc_instance_t *fontconfig_init(ass_library_t *library, rc = FcConfigAppFontAddDir(priv->config, (const FcChar8 *) dir); if (!rc) { - ass_msg(MSGL_WARN, - MSGTR_LIBASS_FcConfigAppFontAddDirFailed); + ass_msg(MSGL_WARN, "%s failed", "FcConfigAppFontAddDir"); } } @@ -531,7 +528,7 @@ fc_instance_t *fontconfig_init(ass_library_t *library, fc_instance_t *priv; ass_msg(MSGL_WARN, - MSGTR_LIBASS_FontconfigDisabledDefaultFontWillBeUsed); + "Fontconfig disabled, only default font will be used."); priv = calloc(1, sizeof(fc_instance_t)); |