From b202e36d98089b2d55387bb42a3d6e0426b3d082 Mon Sep 17 00:00:00 2001 From: 15690690116 Date: Wed, 6 Aug 2025 14:14:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=89=E8=A3=85=E9=80=BB=E8=BE=91=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 15690690116 --- frameworks/fontmgr/src/font_manager.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/frameworks/fontmgr/src/font_manager.cpp b/frameworks/fontmgr/src/font_manager.cpp index 5c18a5f..16fd87a 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; -- Gitee