doctrenderer может работать с десктопным AllFonts.js

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@65735 954022d7-b5bf-4e40-9824-e11837661b57
This commit is contained in:
Oleg.Korshul
2015-11-12 08:22:48 +00:00
committed by Alexander Trofimov
parent 530e2c4a7a
commit 967f1042f4
2 changed files with 13 additions and 2 deletions

View File

@ -356,14 +356,25 @@ void _GetFontArrayBuffer(const v8::FunctionCallbackInfo<v8::Value>& args)
// по идее файлы могут совпадать по имени, но лежать в разных директориях.
// и поэтому в AllFonts.js надо бы писать пути полные.
// пока оставим по-старому
std::wstring sFind = to_cstring(args[0]);
bool bIsFullFilePath = (std::wstring::npos != sFind.find('\\') || std::wstring::npos != sFind.find('/'));
if (bIsFullFilePath)
{
std::wstring sFind = to_cstring(args[0]);
bIsFullFilePath = NSFile::CFileBinary::Exists(sFind);
}
if (!bIsFullFilePath)
{
std::map<std::wstring, std::wstring>::iterator pair = pNative->m_map_fonts.find(sFind);
if (pair != pNative->m_map_fonts.end())
strDir = pair->second;
else
strDir = pNative->m_sDefaultFont;
}
else
{
strDir = sFind;
}
pNative->getFileData(strDir, pData, len);