mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-05-22 05:44:15 +02:00
Fix display of type 3 fonts
This commit is contained in:
parent
17d32fd0b8
commit
aa36af6587
@ -2999,14 +2999,15 @@ void PDFPageContentProcessor::drawText(const TextSequence& textSequence)
|
||||
|
||||
PDFPageContentProcessorStateGuard guard(this);
|
||||
|
||||
QMatrix invertedFontMatrix = fontMatrix.inverted();
|
||||
PDFObject resources = parentFont->getResources();
|
||||
if (!resources.isNull())
|
||||
{
|
||||
initDictionaries(resources);
|
||||
}
|
||||
|
||||
QMatrix fontAdjustedMatrix = invertedFontMatrix * adjustMatrix;
|
||||
QMatrix scaleMatrix(fontSize, 0.0, 0.0, fontSize, 0.0, 0.0);
|
||||
adjustMatrix = scaleMatrix * adjustMatrix;
|
||||
QMatrix fontAdjustedMatrix = fontMatrix * adjustMatrix;
|
||||
|
||||
for (const TextSequenceItem& item : textSequence.items)
|
||||
{
|
||||
|
@ -468,7 +468,7 @@ PDFLexicalAnalyzer::Token PDFLexicalAnalyzer::fetch()
|
||||
void PDFLexicalAnalyzer::seek(PDFInteger offset)
|
||||
{
|
||||
const PDFInteger limit = std::distance(m_begin, m_end);
|
||||
if (offset >= 0 && offset < limit)
|
||||
if (offset >= 0 && offset <= limit)
|
||||
{
|
||||
m_current = std::next(m_begin, offset);
|
||||
}
|
||||
@ -545,7 +545,7 @@ PDFInteger PDFLexicalAnalyzer::findSubstring(const char* str, PDFInteger positio
|
||||
const PDFInteger substringLength = qstrlen(str);
|
||||
const PDFInteger startPos = position;
|
||||
const PDFInteger endPos = length - substringLength;
|
||||
for (PDFInteger i = startPos; i < endPos; ++i)
|
||||
for (PDFInteger i = startPos; i <= endPos; ++i)
|
||||
{
|
||||
Q_ASSERT(std::distance(m_begin + i + substringLength - 1, m_end) >= 0);
|
||||
if (memcmp(m_begin + i, str, substringLength) == 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user