Kaydet (Commit) fb72ec9b authored tarafından Khaled Hosny's avatar Khaled Hosny

tdf#113428: Fix glyph positions in PDF export

Not sure what is going on, but PDF export is the only place we call
GetNextGlyphs() with nLen > 1 and it seems I broke something here in
b894104a. Instead of trying to figure out
what the old code was trying to do, lets just calculate glyph positions
for the extra glyphs as GetNextGlyphs() does for the first one, making
PDF export closer to how the rendering on screen works.

Change-Id: I3f516e954ccfbe38abcf6985efe3bb1f998e967f
Reviewed-on: https://gerrit.libreoffice.org/44514Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarKhaled Hosny <khaledhosny@eglug.org>
üst b5b78703
......@@ -6773,16 +6773,22 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const OUString& rText, bool
for( int i = 0; i < nGlyphs; i++ )
{
// tdf#113428: calculate the position of the next glyphs the same
// way GetNextGlyphs() would do if we asked for a single glyph at
// time.
if (i > 0)
{
Point aPos = pGlyphs[i]->maLinearPos;
aPos.X() /= rLayout.GetUnitsPerPixel();
aPos.Y() /= rLayout.GetUnitsPerPixel();
aGNGlyphPos = rLayout.GetDrawPosition(aPos);
}
aGlyphs.emplace_back( aGNGlyphPos,
pGlyphWidths[i],
pGlyphs[i]->maGlyphId,
pMappedFontObjects[i],
pMappedGlyphs[i],
pGlyphs[i]->IsVertical() );
if( bVertical )
aGNGlyphPos.Y() += pGlyphs[i]->mnNewWidth/rLayout.GetUnitsPerPixel();
else
aGNGlyphPos.X() += pGlyphs[i]->mnNewWidth/rLayout.GetUnitsPerPixel();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment