Font cache

This commit is contained in:
Jakub Melka
2019-04-12 19:17:19 +02:00
parent 51b2ccacec
commit 90767ddfa5
10 changed files with 163 additions and 22 deletions

View File

@ -22,8 +22,9 @@
namespace pdf
{
PDFRenderer::PDFRenderer(const PDFDocument* document) :
PDFRenderer::PDFRenderer(const PDFDocument* document, const PDFFontCache* fontCache) :
m_document(document),
m_fontCache(fontCache),
m_features(Antialiasing | TextAntialiasing)
{
Q_ASSERT(document);
@ -54,7 +55,7 @@ QList<PDFRenderError> PDFRenderer::render(QPainter* painter, const QRectF& recta
matrix.translate(rectangle.left(), rectangle.bottom());
matrix.scale(rectangle.width() / mediaBox.width(), -rectangle.height() / mediaBox.height());
PDFPainter processor(painter, m_features, matrix, page, m_document);
PDFPainter processor(painter, m_features, matrix, page, m_document, m_fontCache);
return processor.processContents();
}
@ -72,7 +73,7 @@ QList<PDFRenderError> PDFRenderer::render(QPainter* painter, const QMatrix& matr
const PDFPage* page = catalog->getPage(pageIndex);
Q_ASSERT(page);
PDFPainter processor(painter, m_features, matrix, page, m_document);
PDFPainter processor(painter, m_features, matrix, page, m_document, m_fontCache);
return processor.processContents();
}