diff --git a/DesktopEditor/fontengine/ApplicationFontsWorker.cpp b/DesktopEditor/fontengine/ApplicationFontsWorker.cpp index 3d1baddc8b..816c424f01 100644 --- a/DesktopEditor/fontengine/ApplicationFontsWorker.cpp +++ b/DesktopEditor/fontengine/ApplicationFontsWorker.cpp @@ -837,53 +837,63 @@ public: CSymbolSimpleChecker2 oAllChecker(arSymbolsAll, nMaxSymbol); std::map mapFontsPriorityStandard; - mapFontsPriorityStandard.insert(std::pair(L"ASCW3", 1)); - mapFontsPriorityStandard.insert(std::pair(L"Arial", 2)); - mapFontsPriorityStandard.insert(std::pair(L"Times New Roman", 3)); - mapFontsPriorityStandard.insert(std::pair(L"Tahoma", 4)); - mapFontsPriorityStandard.insert(std::pair(L"Cambria", 5)); - mapFontsPriorityStandard.insert(std::pair(L"Calibri", 6)); - mapFontsPriorityStandard.insert(std::pair(L"Verdana", 7)); - mapFontsPriorityStandard.insert(std::pair(L"Georgia", 8)); - mapFontsPriorityStandard.insert(std::pair(L"Open Sans", 9)); - mapFontsPriorityStandard.insert(std::pair(L"Liberation Sans", 10)); - mapFontsPriorityStandard.insert(std::pair(L"Helvetica", 11)); - mapFontsPriorityStandard.insert(std::pair(L"Nimbus Sans L", 12)); - mapFontsPriorityStandard.insert(std::pair(L"DejaVu Sans", 13)); - mapFontsPriorityStandard.insert(std::pair(L"Liberation Serif", 14)); - mapFontsPriorityStandard.insert(std::pair(L"Trebuchet MS", 15)); - mapFontsPriorityStandard.insert(std::pair(L"Courier New", 16)); - mapFontsPriorityStandard.insert(std::pair(L"Carlito", 17)); - mapFontsPriorityStandard.insert(std::pair(L"Segoe UI", 18)); - mapFontsPriorityStandard.insert(std::pair(L"SimSun", 19)); - mapFontsPriorityStandard.insert(std::pair(L"MS Gothic", 20)); - mapFontsPriorityStandard.insert(std::pair(L"Nirmala UI", 21)); - mapFontsPriorityStandard.insert(std::pair(L"Batang", 22)); - mapFontsPriorityStandard.insert(std::pair(L"MS Mincho", 23)); - mapFontsPriorityStandard.insert(std::pair(L"Wingdings", 24)); - mapFontsPriorityStandard.insert(std::pair(L"Microsoft JhengHei", 25)); - mapFontsPriorityStandard.insert(std::pair(L"Microsoft JhengHei UI", 26)); - mapFontsPriorityStandard.insert(std::pair(L"Microsoft YaHei", 27)); - mapFontsPriorityStandard.insert(std::pair(L"PMingLiU", 28)); - mapFontsPriorityStandard.insert(std::pair(L"MingLiU", 29)); - mapFontsPriorityStandard.insert(std::pair(L"DFKai-SB", 30)); - mapFontsPriorityStandard.insert(std::pair(L"FangSong", 31)); - mapFontsPriorityStandard.insert(std::pair(L"KaiTi", 32)); - mapFontsPriorityStandard.insert(std::pair(L"SimKai", 33)); - mapFontsPriorityStandard.insert(std::pair(L"SimHei", 34)); - mapFontsPriorityStandard.insert(std::pair(L"Meiryo", 35)); + int nCurrentPriority = 1; + + #define SET_FONT_PRIORITY(fontName) mapFontsPriorityStandard.insert(std::pair(fontName, nCurrentPriority++)) + + SET_FONT_PRIORITY(L"ASCW3"); + SET_FONT_PRIORITY(L"Arial"); + SET_FONT_PRIORITY(L"Times New Roman"); + SET_FONT_PRIORITY(L"Tahoma"); + SET_FONT_PRIORITY(L"Cambria"); + SET_FONT_PRIORITY(L"Calibri"); + SET_FONT_PRIORITY(L"Verdana"); + SET_FONT_PRIORITY(L"Georgia"); + SET_FONT_PRIORITY(L"Open Sans"); + SET_FONT_PRIORITY(L"Liberation Sans"); + SET_FONT_PRIORITY(L"Helvetica"); + SET_FONT_PRIORITY(L"Nimbus Sans L"); + SET_FONT_PRIORITY(L"DejaVu Sans"); + SET_FONT_PRIORITY(L"Liberation Serif"); + SET_FONT_PRIORITY(L"Trebuchet MS"); + SET_FONT_PRIORITY(L"Courier New"); + SET_FONT_PRIORITY(L"Carlito"); + SET_FONT_PRIORITY(L"Segoe UI"); + SET_FONT_PRIORITY(L"SimSun"); + SET_FONT_PRIORITY(L"MS Gothic"); + SET_FONT_PRIORITY(L"Nirmala UI"); + SET_FONT_PRIORITY(L"Batang"); + SET_FONT_PRIORITY(L"MS Mincho"); + SET_FONT_PRIORITY(L"Wingdings"); + SET_FONT_PRIORITY(L"Microsoft JhengHei"); + SET_FONT_PRIORITY(L"Microsoft JhengHei UI"); + SET_FONT_PRIORITY(L"Microsoft YaHei"); + SET_FONT_PRIORITY(L"PMingLiU"); + SET_FONT_PRIORITY(L"MingLiU"); + SET_FONT_PRIORITY(L"DFKai-SB"); + SET_FONT_PRIORITY(L"FangSong"); + SET_FONT_PRIORITY(L"KaiTi"); + SET_FONT_PRIORITY(L"SimKai"); + SET_FONT_PRIORITY(L"SimHei"); + SET_FONT_PRIORITY(L"Meiryo"); #ifdef _MAC - mapFontsPriorityStandard.insert(std::pair(L"PingFang SC", 36)); - mapFontsPriorityStandard.insert(std::pair(L"PingFang TC", 37)); - mapFontsPriorityStandard.insert(std::pair(L"PingFang HK", 38)); + SET_FONT_PRIORITY(L"PingFang SC"); + SET_FONT_PRIORITY(L"PingFang TC"); + SET_FONT_PRIORITY(L"PingFang HK"); - mapFontsPriorityStandard.insert(std::pair(L"Heiti SC", 39)); - mapFontsPriorityStandard.insert(std::pair(L"Heiti TC", 40)); - mapFontsPriorityStandard.insert(std::pair(L"Songti SC", 41)); - mapFontsPriorityStandard.insert(std::pair(L"Songti TC", 42)); + SET_FONT_PRIORITY(L"Heiti SC"); + SET_FONT_PRIORITY(L"Heiti TC"); + SET_FONT_PRIORITY(L"Songti SC"); + SET_FONT_PRIORITY(L"Songti TC"); #endif + SET_FONT_PRIORITY(L"Malgun Gothic"); + SET_FONT_PRIORITY(L"Nanum Gothic"); + SET_FONT_PRIORITY(L"NanumGothic"); + SET_FONT_PRIORITY(L"Noto Sans KR"); + SET_FONT_PRIORITY(L"TakaoGothic"); + NSFonts::CApplicationFontsSymbols oApplicationChecker; // приоритеты шрифтов. по имени (все стили) diff --git a/DesktopEditor/fontengine/ApplicationFontsWorker.h b/DesktopEditor/fontengine/ApplicationFontsWorker.h index 2d5951cc85..4c509b1820 100644 --- a/DesktopEditor/fontengine/ApplicationFontsWorker.h +++ b/DesktopEditor/fontengine/ApplicationFontsWorker.h @@ -36,7 +36,7 @@ #include #include "../graphics/pro/Fonts.h" -#define ONLYOFFICE_FONTS_VERSION 14 +#define ONLYOFFICE_FONTS_VERSION 15 #define ONLYOFFICE_ALL_FONTS_VERSION 2 class CApplicationFontsWorkerBreaker