Editor plugin: WIP

This commit is contained in:
Jakub Melka
2023-03-06 16:09:09 +01:00
parent 1e52c0c063
commit 1b6bb6086c
32 changed files with 2243 additions and 311 deletions

View File

@ -749,7 +749,7 @@ void PDFRealizedFontImpl::fillTextSequence(const QByteArray& byteArray, TextSequ
if (glyphIndex)
{
const Glyph& glyph = getGlyph(glyphIndex);
textSequence.items.emplace_back(&glyph.glyph, (*encoding)[static_cast<uint8_t>(byteArray[i])], glyph.advance);
textSequence.items.emplace_back(&glyph.glyph, (*encoding)[static_cast<uint8_t>(byteArray[i])], glyph.advance, static_cast<CID>(byteArray[i]));
}
else
{
@ -757,7 +757,7 @@ void PDFRealizedFontImpl::fillTextSequence(const QByteArray& byteArray, TextSequ
if (glyphWidth > 0)
{
const QPainterPath* nullpath = nullptr;
textSequence.items.emplace_back(nullpath, QChar(), glyphWidth * m_pixelSize * FONT_WIDTH_MULTIPLIER);
textSequence.items.emplace_back(nullpath, QChar(), glyphWidth * m_pixelSize * FONT_WIDTH_MULTIPLIER, static_cast<CID>(byteArray[i]));
}
}
}
@ -784,7 +784,7 @@ void PDFRealizedFontImpl::fillTextSequence(const QByteArray& byteArray, TextSequ
{
QChar character = toUnicode->getToUnicode(cid);
const Glyph& glyph = getGlyph(glyphIndex);
textSequence.items.emplace_back(&glyph.glyph, character, glyph.advance);
textSequence.items.emplace_back(&glyph.glyph, character, glyph.advance, cid);
}
else
{
@ -799,7 +799,7 @@ void PDFRealizedFontImpl::fillTextSequence(const QByteArray& byteArray, TextSequ
// We do not multiply advance with font size and FONT_WIDTH_MULTIPLIER, because in the code,
// "advance" is treated as in font space.
const QPainterPath* nullpath = nullptr;
textSequence.items.emplace_back(nullpath, QChar(), -glyphWidth);
textSequence.items.emplace_back(nullpath, QChar(), -glyphWidth, cid);
}
}
}
@ -2680,7 +2680,7 @@ void PDFRealizedType3FontImpl::fillTextSequence(const QByteArray& byteArray, Tex
if (contentStream)
{
textSequence.items.emplace_back(contentStream, character, width);
textSequence.items.emplace_back(contentStream, character, width, index);
}
else
{