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

tdf#103785: Correctly position vertical glyphs

Change-Id: Ibd0ae230f54ada55a26d24ea865e7b93070ce2a0
üst 087705c7
...@@ -321,12 +321,19 @@ void CairoTextRender::DrawServerFontLayout( const GenericSalLayout& rLayout, con ...@@ -321,12 +321,19 @@ void CairoTextRender::DrawServerFontLayout( const GenericSalLayout& rLayout, con
double ydiff = 0.0; double ydiff = 0.0;
if (nGlyphRotation == 1) if (nGlyphRotation == 1)
{ {
ydiff = font_extents.ascent/nHeight;
xdiff = -font_extents.descent/nHeight;
if (SalLayout::UseCommonLayout()) if (SalLayout::UseCommonLayout())
{ {
ydiff -= font_extents.descent/nHeight; // The y is the origin point position, but Cairo will draw
xdiff = 0; // 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) else if (nGlyphRotation == -1)
......
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