1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-25 17:58:27 +00:00

Reindent.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27127 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
eugeni 2008-06-23 14:46:52 +00:00
parent 839c865ad8
commit a2bd32e4de

View File

@ -424,46 +424,47 @@ fc_instance_t* fontconfig_init(ass_library_t* library, FT_Library ftlibrary, con
process_fontdata(priv, library, ftlibrary, i); process_fontdata(priv, library, ftlibrary, i);
if (dir) { if (dir) {
if (FcDirCacheValid((const FcChar8 *)dir) == FcFalse) if (FcDirCacheValid((const FcChar8 *)dir) == FcFalse)
{ {
mp_msg(MSGT_ASS, MSGL_INFO, MSGTR_LIBASS_UpdatingFontCache); mp_msg(MSGT_ASS, MSGL_INFO, MSGTR_LIBASS_UpdatingFontCache);
if (FcGetVersion() >= 20390 && FcGetVersion() < 20400) if (FcGetVersion() >= 20390 && FcGetVersion() < 20400)
mp_msg(MSGT_ASS, MSGL_WARN, mp_msg(MSGT_ASS, MSGL_WARN,
MSGTR_LIBASS_BetaVersionsOfFontconfigAreNotSupported); MSGTR_LIBASS_BetaVersionsOfFontconfigAreNotSupported);
// FontConfig >= 2.4.0 updates cache automatically in FcConfigAppFontAddDir() // FontConfig >= 2.4.0 updates cache automatically in FcConfigAppFontAddDir()
if (FcGetVersion() < 20390) { if (FcGetVersion() < 20390) {
FcFontSet* fcs; FcFontSet* fcs;
FcStrSet* fss; FcStrSet* fss;
fcs = FcFontSetCreate(); fcs = FcFontSetCreate();
fss = FcStrSetCreate(); fss = FcStrSetCreate();
rc = FcStrSetAdd(fss, (const FcChar8*)dir); rc = FcStrSetAdd(fss, (const FcChar8*)dir);
if (!rc) { if (!rc) {
mp_msg(MSGT_ASS, MSGL_WARN, MSGTR_LIBASS_FcStrSetAddFailed); mp_msg(MSGT_ASS, MSGL_WARN, MSGTR_LIBASS_FcStrSetAddFailed);
goto ErrorFontCache; goto ErrorFontCache;
}
rc = FcDirScan(fcs, fss, NULL, FcConfigGetBlanks(priv->config),
(const FcChar8 *)dir, FcFalse);
if (!rc) {
mp_msg(MSGT_ASS, MSGL_WARN, MSGTR_LIBASS_FcDirScanFailed);
goto ErrorFontCache;
}
rc = FcDirSave(fcs, fss, (const FcChar8 *)dir);
if (!rc) {
mp_msg(MSGT_ASS, MSGL_WARN, MSGTR_LIBASS_FcDirSave);
goto ErrorFontCache;
}
ErrorFontCache:
;
}
} }
rc = FcDirScan(fcs, fss, NULL, FcConfigGetBlanks(priv->config), (const FcChar8 *)dir, FcFalse); rc = FcConfigAppFontAddDir(priv->config, (const FcChar8*)dir);
if (!rc) { if (!rc) {
mp_msg(MSGT_ASS, MSGL_WARN, MSGTR_LIBASS_FcDirScanFailed); mp_msg(MSGT_ASS, MSGL_WARN, MSGTR_LIBASS_FcConfigAppFontAddDirFailed);
goto ErrorFontCache;
}
rc = FcDirSave(fcs, fss, (const FcChar8 *)dir);
if (!rc) {
mp_msg(MSGT_ASS, MSGL_WARN, MSGTR_LIBASS_FcDirSave);
goto ErrorFontCache;
}
ErrorFontCache:
;
} }
} }
rc = FcConfigAppFontAddDir(priv->config, (const FcChar8*)dir);
if (!rc) {
mp_msg(MSGT_ASS, MSGL_WARN, MSGTR_LIBASS_FcConfigAppFontAddDirFailed);
}
}
priv->family_default = family ? strdup(family) : 0; priv->family_default = family ? strdup(family) : 0;
priv->path_default = path ? strdup(path) : 0; priv->path_default = path ? strdup(path) : 0;
priv->index_default = 0; priv->index_default = 0;