mirror of
				https://github.com/JakubMelka/PDF4QT.git
				synced 2025-06-05 21:59:17 +02:00 
			
		
		
		
	Fix display of type 3 fonts
This commit is contained in:
		| @@ -2999,14 +2999,15 @@ void PDFPageContentProcessor::drawText(const TextSequence& textSequence) | |||||||
|  |  | ||||||
|             PDFPageContentProcessorStateGuard guard(this); |             PDFPageContentProcessorStateGuard guard(this); | ||||||
|  |  | ||||||
|             QMatrix invertedFontMatrix = fontMatrix.inverted(); |  | ||||||
|             PDFObject resources = parentFont->getResources(); |             PDFObject resources = parentFont->getResources(); | ||||||
|             if (!resources.isNull()) |             if (!resources.isNull()) | ||||||
|             { |             { | ||||||
|                 initDictionaries(resources); |                 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) |             for (const TextSequenceItem& item : textSequence.items) | ||||||
|             { |             { | ||||||
|   | |||||||
| @@ -468,7 +468,7 @@ PDFLexicalAnalyzer::Token PDFLexicalAnalyzer::fetch() | |||||||
| void PDFLexicalAnalyzer::seek(PDFInteger offset) | void PDFLexicalAnalyzer::seek(PDFInteger offset) | ||||||
| { | { | ||||||
|     const PDFInteger limit = std::distance(m_begin, m_end); |     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); |         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 substringLength = qstrlen(str); | ||||||
|     const PDFInteger startPos = position; |     const PDFInteger startPos = position; | ||||||
|     const PDFInteger endPos = length - substringLength; |     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); |         Q_ASSERT(std::distance(m_begin + i + substringLength - 1, m_end) >= 0); | ||||||
|         if (memcmp(m_begin + i, str, substringLength) == 0) |         if (memcmp(m_begin + i, str, substringLength) == 0) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user