mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-07-20 06:24:28 +08:00
Merge remote-tracking branch 'origin/release/v8.1.0' into feature/pdf-shape
# Conflicts: # DesktopEditor/graphics/pro/js/wasm/src/pdfwriter.cpp # PdfFile/PdfReader.cpp # PdfFile/SrcWriter/Document.cpp
This commit is contained in:
@ -1014,16 +1014,12 @@ BYTE* CPdfReader::GetWidgetFonts(int nTypeFonts)
|
||||
}
|
||||
}
|
||||
|
||||
if (!bFullFont || pField->getAcroFormFieldType() == acroFormFieldPushbutton)
|
||||
if (!bFullFont)
|
||||
{
|
||||
oR.free(); oFonts.free(); oFontRef.free();
|
||||
std::string sFontKey;
|
||||
bool bFind = PdfReader::GetFontFromAP(m_pPDFDocument, pField, &oR, &oFonts, &oFontRef, sFontKey);
|
||||
if (bFind && std::find(arrFontsRef.begin(), arrFontsRef.end(), oFontRef.getRefNum()) == arrFontsRef.end() &&
|
||||
(pField->getAcroFormFieldType() == acroFormFieldPushbutton || (nTypeFonts & 2)))
|
||||
{
|
||||
bFindResources = true;
|
||||
}
|
||||
bFindResources = bFind && std::find(arrFontsRef.begin(), arrFontsRef.end(), oFontRef.getRefNum()) == arrFontsRef.end() && (nTypeFonts & 2);
|
||||
}
|
||||
|
||||
std::string sFontName;
|
||||
@ -1046,6 +1042,27 @@ BYTE* CPdfReader::GetWidgetFonts(int nTypeFonts)
|
||||
}
|
||||
}
|
||||
oR.free(); oFonts.free(); oFontRef.free();
|
||||
|
||||
if (pField->getAcroFormFieldType() == acroFormFieldPushbutton)
|
||||
{
|
||||
std::string sFontKey;
|
||||
bool bFind = PdfReader::GetFontFromAP(m_pPDFDocument, pField, &oR, &oFonts, &oFontRef, sFontKey);
|
||||
if (bFind && std::find(arrFontsRef.begin(), arrFontsRef.end(), oFontRef.getRefNum()) == arrFontsRef.end())
|
||||
{
|
||||
bool bBold = false, bItalic = false;
|
||||
wsFileName = PdfReader::GetFontData(m_pPDFDocument, m_pFontManager, m_pFontList, &oFonts, &oFontRef, nTypeFonts, sFontName, sFontName, bBold, bItalic);
|
||||
|
||||
std::wstring wsFontName = UTF8_TO_U(sFontName);
|
||||
if (m_mFonts.find(wsFontName) == m_mFonts.end())
|
||||
{
|
||||
oRes.WriteString(sFontName);
|
||||
nFontsID++;
|
||||
arrFontsRef.push_back(oFontRef.getRefNum());
|
||||
m_mFonts[wsFontName] = wsFileName;
|
||||
}
|
||||
}
|
||||
}
|
||||
oR.free(); oFonts.free(); oFontRef.free();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user