mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Better behaviour when font cant be loaded
This commit is contained in:
@ -1530,11 +1530,21 @@ void PDFPageContentProcessor::operatorTextSetFontAndFontSize(PDFOperandName font
|
|||||||
{
|
{
|
||||||
if (m_fontDictionary->hasKey(fontName.name))
|
if (m_fontDictionary->hasKey(fontName.name))
|
||||||
{
|
{
|
||||||
PDFFontPointer font = PDFFont::createFont(m_fontDictionary->get(fontName.name), m_document);
|
try
|
||||||
|
{
|
||||||
|
PDFFontPointer font = PDFFont::createFont(m_fontDictionary->get(fontName.name), m_document);
|
||||||
|
|
||||||
m_graphicState.setTextFont(qMove(font));
|
m_graphicState.setTextFont(qMove(font));
|
||||||
m_graphicState.setTextFontSize(fontSize);
|
m_graphicState.setTextFontSize(fontSize);
|
||||||
updateGraphicState();
|
updateGraphicState();
|
||||||
|
}
|
||||||
|
catch (PDFParserException)
|
||||||
|
{
|
||||||
|
m_graphicState.setTextFont(nullptr);
|
||||||
|
m_graphicState.setTextFontSize(fontSize);
|
||||||
|
updateGraphicState();
|
||||||
|
throw;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user