diff --git a/frameworks/fontmgr/src/font_manager.cpp b/frameworks/fontmgr/src/font_manager.cpp index 5c18a5f36c698660d8d98f630d6ab6730f181c17..16fd87ad20407faa42cfffebfcc232cbbcfa4902 100644 --- a/frameworks/fontmgr/src/font_manager.cpp +++ b/frameworks/fontmgr/src/font_manager.cpp @@ -76,6 +76,13 @@ int32_t FontManager::InstallFont(const int32_t &fd) FontConfig fontConfig(FONT_CONFIG_FILE); for (const auto &fullName : fullNameVector) { std::string path = fontConfig.GetFontFileByName(fullName); + if (!path.empty() && !FileUtils::CheckPathExist(path)) { + if (!fontConfig.DeleteFontRecord(path)) { + FONT_LOGE("update install_fontconfig fail"); + return ERR_INSTALL_FAIL; + } + break; + } if (!path.empty()) { FONT_LOGI("Font already installed"); return ERR_INSTALLED_ALRADY;