Commit 2e5b3f77 authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander Trofimov

fonts application use (2x faster)

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@60501 954022d7-b5bf-4e40-9824-e11837661b57
parent 80212532
......@@ -314,9 +314,9 @@ namespace NSCommon
}
};
void SaveAllFontsJS(CFontList& fonts, std::wstring strFile, std::wstring strFolderThumbnails = L"")
void SaveAllFontsJS(CApplicationFonts& applicationFonts, std::wstring strFile, std::wstring strFolderThumbnails = L"")
{
CArray<CFontInfo*>* pList = fonts.GetFonts();
CArray<CFontInfo*>* pList = applicationFonts.GetList()->GetFonts();
int nCount = pList->GetCount();
// сначала строим массив всех файлов шрифтов
......@@ -430,12 +430,9 @@ namespace NSCommon
}
// -------------------------------------------
CApplicationFonts oApplicationFonts;
oApplicationFonts.InitializeFromFolder(L"C:/Windows/Fonts");
CFontManager* pManager = oApplicationFonts.GenerateFontManager();
CFontManager* pManager = applicationFonts.GenerateFontManager();
CFontsCache* pCache = new CFontsCache();
pCache->SetStreams(oApplicationFonts.GetStreams());
pCache->SetStreams(applicationFonts.GetStreams());
pManager->SetOwnerCache(pCache);
if (L"" != strFolderThumbnails)
......@@ -611,7 +608,7 @@ namespace NSCommon
{
BYTE* pData = NULL;
LONG lLen = 0;
fonts.ToBuffer(&pData, &lLen);
applicationFonts.GetList()->ToBuffer(&pData, &lLen);
char* cData64 = NULL;
int nData64Dst = 0;
......@@ -648,10 +645,10 @@ int wmain(int argc, wchar_t** argv)
wcout << "]";
#endif
CFontList oList;
oList.LoadFromFolder(L"C:/Windows/Fonts");
CApplicationFonts oApplicationF;
oApplicationF.InitializeFromFolder(L"C:/Windows/Fonts");
NSCommon::SaveAllFontsJS(oList, L"D:/AllFonts.js", L"D:/");
NSCommon::SaveAllFontsJS(oApplicationF, L"D:/AllFonts.js", L"D:/");
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment