vcl: adjust cairo text renderer for vertical writing

, remove extra matrix translation and use the positions
from Harfbuzz more directly.

Change-Id: I2eb337b7f3bd70f4726f56d85a38f4a1f0931155
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115018
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Mark Hung <marklh9@gmail.com>
This commit is contained in:
Mark Hung
2021-05-05 16:06:54 +02:00
parent dd0d0b44fd
commit 6c9948d80a
-16
View File
@@ -249,22 +249,6 @@ void CairoTextRender::DrawTextLayout(const GenericSalLayout& rLayout, const SalG
cairo_matrix_init_identity(&em_square);
cairo_set_matrix(cr, &em_square);
//gives the same positions as pre-cairo conversion, but I don't
//like them
double xdiff = 0.0;
double ydiff = 0.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);
double nDescender = std::fmax(aExt.height + aExt.y_bearing, 0);
ydiff = (aExt.x_advance - nDescender) / nHeight;
xdiff = -font_extents.descent/nHeight;
cairo_matrix_translate(&m, xdiff, ydiff);
}
if (rFont.NeedsArtificialItalic())