Fix bug 75101

This commit is contained in:
Svetlana Kulikova
2025-06-10 20:11:55 +03:00
parent bc34a76127
commit 646f2ca6b1

View File

@ -43,6 +43,7 @@
#include "../lib/xpdf/Stream.h"
#include "../lib/xpdf/PDFDoc.h"
#include "../lib/xpdf/CharCodeToUnicode.h"
#include "../lib/xpdf/TextString.h"
#include "XmlUtils.h"
#include "../../DesktopEditor/graphics/pro/Graphics.h"
@ -724,6 +725,12 @@ namespace PdfReader
oDictItem.free();
oFontDescriptor.dictLookup("FontFamily", &oDictItem);
if (oDictItem.isString())
{
TextString* s = new TextString(oDictItem.getString());
oFontSelect.wsAltName = new std::wstring(NSStringExt::CConverter::GetUnicodeFromUTF32(s->getUnicode(), s->getLength()));
delete s;
}
oDictItem.free();
oFontDescriptor.dictLookup("FontStretch", &oDictItem);
@ -2485,6 +2492,7 @@ namespace PdfReader
unsigned int lUnicode = (unsigned int)wsUnicodeText[0];
long lStyle;
m_pRenderer->get_FontStyle(&lStyle);
m_pFontManager->SetStringGID(FALSE);
m_pFontManager->LoadFontFromFile(sFontPath, 0, dOldSize, 72, 72);
NSFonts::IFontFile* pFontFile = m_pFontManager->GetFile();
@ -2521,6 +2529,7 @@ namespace PdfReader
return;
}
m_pRenderer->put_FontPath(wsFileName);
m_pFontManager->LoadFontFromFile(wsFileName, 0, dOldSize, 72, 72);
bReplace = true;
}
}