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:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user