mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-07-20 01:04:34 +08:00
новая версия
git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@61555 954022d7-b5bf-4e40-9824-e11837661b57
This commit is contained in:
committed by
Alexander Trofimov
parent
2ebe97014c
commit
e7a531cdfa
@ -1258,13 +1258,36 @@ void CFontList::LoadFromArrayFiles(CArray<std::wstring>& oArray)
|
||||
pParams[2].tag = FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY;
|
||||
pParams[2].data = NULL;
|
||||
pParams[3].tag = FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY;
|
||||
pParams[3].data = NULL;
|
||||
|
||||
pParams[3].data = NULL;
|
||||
|
||||
// определяем размер буфера, чтобы не выделять много кусков, а обойтись одним
|
||||
int nMaxFontSize = 0;
|
||||
for (int nIndex = 0; nIndex < nCount; ++nIndex)
|
||||
{
|
||||
NSFile::CFileBinary oFile;
|
||||
if (oFile.OpenFile(oArray[nIndex]))
|
||||
{
|
||||
int nSizeTmp = (int)oFile.GetFileSize();
|
||||
if (nSizeTmp > 100000000)
|
||||
{
|
||||
// такие огромные шрифты не учитываем
|
||||
oArray.RemoveAt(nIndex);
|
||||
nIndex--;
|
||||
nCount--;
|
||||
}
|
||||
|
||||
if (nMaxFontSize < nSizeTmp)
|
||||
nMaxFontSize = nSizeTmp;
|
||||
}
|
||||
}
|
||||
|
||||
BYTE* pDataFontFile = new BYTE[nMaxFontSize];
|
||||
|
||||
for (int nIndex = 0; nIndex < nCount; ++nIndex)
|
||||
{
|
||||
// open file
|
||||
CFontStream oStream;
|
||||
if (!oStream.CreateFromFile(oArray[nIndex]))
|
||||
if (!oStream.CreateFromFile(oArray[nIndex], pDataFontFile))
|
||||
continue;
|
||||
|
||||
FT_Open_Args oOpenArgs;
|
||||
@ -1464,6 +1487,8 @@ void CFontList::LoadFromArrayFiles(CArray<std::wstring>& oArray)
|
||||
FT_Done_Face( pFace );
|
||||
}
|
||||
}
|
||||
|
||||
RELEASEARRAYOBJECTS(pDataFontFile);
|
||||
|
||||
::free( pParams );
|
||||
FT_Done_FreeType(pLibrary);
|
||||
|
||||
Reference in New Issue
Block a user