mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-07-19 04:36:10 +08:00
Create test GetEmbeddedFont
This commit is contained in:
@ -751,36 +751,7 @@ std::wstring CPdfReader::GetInfo()
|
||||
std::wstring CPdfReader::GetFontPath(const std::wstring& wsFontName, bool bSave)
|
||||
{
|
||||
std::map<std::wstring, std::wstring>::const_iterator oIter = m_mFonts.find(wsFontName);
|
||||
if (oIter == m_mFonts.end())
|
||||
return std::wstring();
|
||||
|
||||
if (!bSave)
|
||||
return oIter->second;
|
||||
|
||||
NSFonts::IFontsMemoryStorage* pMemoryStorage = NSFonts::NSApplicationFontStream::GetGlobalMemoryStorage();
|
||||
if (pMemoryStorage)
|
||||
{
|
||||
NSFonts::IFontStream* pStream = pMemoryStorage->Get(oIter->second);
|
||||
if (pStream)
|
||||
{
|
||||
BYTE* pData = NULL;
|
||||
LONG lLength = 0;
|
||||
pStream->GetMemory(pData, lLength);
|
||||
if (pData)
|
||||
{
|
||||
NSFile::CFileBinary oFile;
|
||||
std::wstring sFilePath = oFile.CreateTempFileWithUniqueName(m_wsTempFolder, L"EF");
|
||||
if (oFile.WriteFile(pData, lLength))
|
||||
{
|
||||
oFile.CloseFile();
|
||||
return sFilePath;
|
||||
}
|
||||
oFile.CloseFile();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return std::wstring();
|
||||
return oIter == m_mFonts.end() ? std::wstring() : oIter->second;
|
||||
}
|
||||
void getBookmarks(PDFDoc* pdfDoc, OutlineItem* pOutlineItem, NSWasm::CData& out, int level)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user