summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Hung <marklh9@gmail.com>2021-05-03 06:51:50 +0800
committerMark Hung <marklh9@gmail.com>2021-05-05 16:06:54 +0200
commit6c9948d80aaa1d4827ccf741d900093abe7a973e (patch)
tree8decfdfd712df32544d4bbe14ef43fa59b555f79
parentdd0d0b44fd1c6c0292d7b2eb3f5cf2baa21e4481 (diff)
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>
-rw-r--r--vcl/unx/generic/gdi/cairotextrender.cxx16
1 files changed, 0 insertions, 16 deletions
diff --git a/vcl/unx/generic/gdi/cairotextrender.cxx b/vcl/unx/generic/gdi/cairotextrender.cxx
index 9cd6afaf7e53..b121f0f1b9d1 100644
--- a/vcl/unx/generic/gdi/cairotextrender.cxx
+++ b/vcl/unx/generic/gdi/cairotextrender.cxx
@@ -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())