diff --git a/PdfFile/SrcReader/RendererOutputDev.cpp b/PdfFile/SrcReader/RendererOutputDev.cpp index c7dec068fe..48fe5b3524 100644 --- a/PdfFile/SrcReader/RendererOutputDev.cpp +++ b/PdfFile/SrcReader/RendererOutputDev.cpp @@ -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; } }