For bug 68629

This commit is contained in:
Svetlana Kulikova
2024-06-14 11:15:33 +03:00
parent b63ff91ce4
commit 79c7fced0a
4 changed files with 61 additions and 25 deletions

View File

@ -886,13 +886,12 @@ HRESULT CPdfFile::put_FontName(const std::wstring& wsName)
{
if (!m_pInternal->pWriter)
return S_FALSE;
std::wstring wsFontName = wsName;
if (m_pInternal->pEditor && wsFontName.find(L"Embedded: ") == 0)
if (m_pInternal->pEditor && wsName.find(L"Embedded: ") == 0)
{
wsFontName.erase(0, 10);
std::wstring sSub = wsName.substr(0, 10);
bool bBold = false, bItalic = false;
std::wstring wsFontPath;
if (m_pInternal->pEditor->IsBase14(wsFontName, bBold, bItalic, wsFontPath) && (bBold || bItalic))
if (m_pInternal->pEditor->IsBase14(sSub, bBold, bItalic, wsFontPath) && (bBold || bItalic))
{
LONG lStyle = 0;
if (bBold)
@ -901,9 +900,9 @@ HRESULT CPdfFile::put_FontName(const std::wstring& wsName)
lStyle |= 2;
put_FontStyle(lStyle);
}
m_pInternal->pWriter->AddFont(wsFontName, bBold, bItalic, wsFontPath, 0);
m_pInternal->pWriter->AddFont(wsName, bBold, bItalic, wsFontPath, 0);
}
return m_pInternal->pWriter->put_FontName(wsFontName);
return m_pInternal->pWriter->put_FontName(wsName);
}
HRESULT CPdfFile::get_FontPath(std::wstring* wsPath)
{