Update python.cpp

This commit is contained in:
恍兮惚兮 2024-03-13 11:30:21 +08:00
parent 1af117fea5
commit f9c203a816

View File

@ -84,14 +84,11 @@ std::unordered_map<std::wstring, std::wstring> loadfontfiles() {
auto lpLogfonts = std::make_unique<LOGFONTW[]>(dwFontsLoaded);
DWORD cbBuffer = dwFontsLoaded * sizeof(LOGFONTW);
if (!GetFontResourceInfo(fontfile.c_str(), &cbBuffer, lpLogfonts.get(), QFR_LOGFONT)) {
auto succ=GetFontResourceInfo(fontfile.c_str(), &cbBuffer, lpLogfonts.get(), QFR_LOGFONT);
RemoveFontResourceExW(fontfile.c_str(), FR_PRIVATE, 0);
continue;
}
if (!succ)continue;
for (int k = 0; k < dwFontsLoaded; k++)
fntss[i].insert(std::make_pair(lpLogfonts[k].lfFaceName, fontfile));
RemoveFontResourceExW(fontfile.c_str(), FR_PRIVATE, 0);
}
};
for (int i = 0; i < LOADFONTTHREADNUM; i++) {