# HG changeset patch # User eugeni # Date 1214232412 0 # Node ID a0e00d065593736e036774af47029ad8e649a581 # Parent bafda9ff02211f98ac86ff2e6d917c808333ce91 Reindent. diff -r bafda9ff0221 -r a0e00d065593 libass/ass_fontconfig.c --- a/libass/ass_fontconfig.c Mon Jun 23 14:46:50 2008 +0000 +++ b/libass/ass_fontconfig.c Mon Jun 23 14:46:52 2008 +0000 @@ -424,46 +424,47 @@ process_fontdata(priv, library, ftlibrary, i); if (dir) { - if (FcDirCacheValid((const FcChar8 *)dir) == FcFalse) - { - mp_msg(MSGT_ASS, MSGL_INFO, MSGTR_LIBASS_UpdatingFontCache); - if (FcGetVersion() >= 20390 && FcGetVersion() < 20400) - mp_msg(MSGT_ASS, MSGL_WARN, - MSGTR_LIBASS_BetaVersionsOfFontconfigAreNotSupported); - // FontConfig >= 2.4.0 updates cache automatically in FcConfigAppFontAddDir() - if (FcGetVersion() < 20390) { - FcFontSet* fcs; - FcStrSet* fss; - fcs = FcFontSetCreate(); - fss = FcStrSetCreate(); - rc = FcStrSetAdd(fss, (const FcChar8*)dir); - if (!rc) { - mp_msg(MSGT_ASS, MSGL_WARN, MSGTR_LIBASS_FcStrSetAddFailed); - goto ErrorFontCache; + if (FcDirCacheValid((const FcChar8 *)dir) == FcFalse) + { + mp_msg(MSGT_ASS, MSGL_INFO, MSGTR_LIBASS_UpdatingFontCache); + if (FcGetVersion() >= 20390 && FcGetVersion() < 20400) + mp_msg(MSGT_ASS, MSGL_WARN, + MSGTR_LIBASS_BetaVersionsOfFontconfigAreNotSupported); + // FontConfig >= 2.4.0 updates cache automatically in FcConfigAppFontAddDir() + if (FcGetVersion() < 20390) { + FcFontSet* fcs; + FcStrSet* fss; + fcs = FcFontSetCreate(); + fss = FcStrSetCreate(); + rc = FcStrSetAdd(fss, (const FcChar8*)dir); + if (!rc) { + mp_msg(MSGT_ASS, MSGL_WARN, MSGTR_LIBASS_FcStrSetAddFailed); + 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); - 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 = FcConfigAppFontAddDir(priv->config, (const FcChar8*)dir); + if (!rc) { + mp_msg(MSGT_ASS, MSGL_WARN, MSGTR_LIBASS_FcConfigAppFontAddDirFailed); } } - 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->path_default = path ? strdup(path) : 0; priv->index_default = 0;