mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-01-29 08:39:41 +01:00
Bugfix with invalid text rendering
This commit is contained in:
parent
bfcc48ff1b
commit
7e953b60e7
@ -1769,7 +1769,6 @@ void PDFPageContentProcessor::drawText(const TextSequence& textSequence)
|
|||||||
QMatrix adjustMatrix(horizontalScaling, 0.0, 0.0, 1.0, 0.0, textRise);
|
QMatrix adjustMatrix(horizontalScaling, 0.0, 0.0, 1.0, 0.0, textRise);
|
||||||
QMatrix textMatrix = m_graphicState.getTextMatrix();
|
QMatrix textMatrix = m_graphicState.getTextMatrix();
|
||||||
|
|
||||||
size_t characterIndex = 0;
|
|
||||||
for (const TextSequenceItem& item : textSequence.items)
|
for (const TextSequenceItem& item : textSequence.items)
|
||||||
{
|
{
|
||||||
PDFReal displacementX = 0.0;
|
PDFReal displacementX = 0.0;
|
||||||
@ -1781,7 +1780,7 @@ void PDFPageContentProcessor::drawText(const TextSequence& textSequence)
|
|||||||
QPointF advance = isHorizontalWritingSystem ? QPointF(item.advance, 0) : QPointF(0, item.advance);
|
QPointF advance = isHorizontalWritingSystem ? QPointF(item.advance, 0) : QPointF(0, item.advance);
|
||||||
|
|
||||||
// First, compute the advance
|
// First, compute the advance
|
||||||
const PDFReal additionalAdvance = (character == QChar(QChar::Space)) ? wordSpacing : characterSpacing;
|
const PDFReal additionalAdvance = (character == QChar(QChar::Space)) ? wordSpacing + characterSpacing : characterSpacing;
|
||||||
if (isHorizontalWritingSystem)
|
if (isHorizontalWritingSystem)
|
||||||
{
|
{
|
||||||
advance.rx() += additionalAdvance;
|
advance.rx() += additionalAdvance;
|
||||||
@ -1806,8 +1805,6 @@ void PDFPageContentProcessor::drawText(const TextSequence& textSequence)
|
|||||||
|
|
||||||
displacementX = advance.x();
|
displacementX = advance.x();
|
||||||
displacementY = advance.y();
|
displacementY = advance.y();
|
||||||
|
|
||||||
++characterIndex;
|
|
||||||
}
|
}
|
||||||
else if (item.isAdvance())
|
else if (item.isAdvance())
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user