vcl/unx/generic/gdi/cairotextrender.cxx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)
New commits: commit ff08ee6ab2e11360f9260462b15f5ca133007101 Author: Khaled Hosny <khaledho...@eglug.org> Date: Tue Nov 15 21:47:39 2016 +0200 tdf#103785: Correctly position vertical glyphs Change-Id: Ibd0ae230f54ada55a26d24ea865e7b93070ce2a0 diff --git a/vcl/unx/generic/gdi/cairotextrender.cxx b/vcl/unx/generic/gdi/cairotextrender.cxx index 5d550a4..574f985 100644 --- a/vcl/unx/generic/gdi/cairotextrender.cxx +++ b/vcl/unx/generic/gdi/cairotextrender.cxx @@ -321,12 +321,19 @@ void CairoTextRender::DrawServerFontLayout( const GenericSalLayout& rLayout, con double ydiff = 0.0; if (nGlyphRotation == 1) { - ydiff = font_extents.ascent/nHeight; - xdiff = -font_extents.descent/nHeight; if (SalLayout::UseCommonLayout()) { - ydiff -= font_extents.descent/nHeight; - xdiff = 0; + // The y is the origin point position, but Cairo will draw + // the glyph *above* that point, we need to move it down to + // the glyphâs baseline. + cairo_text_extents_t aExt; + cairo_glyph_extents(cr, &cairo_glyphs[nStartIndex], nLen, &aExt); + cairo_glyphs[nStartIndex].y += aExt.x_advance - aExt.height - aExt.y_bearing; + } + else + { + ydiff = font_extents.ascent/nHeight; + xdiff = -font_extents.descent/nHeight; } } else if (nGlyphRotation == -1)
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits