summaryrefslogtreecommitdiffstats
path: root/vcl/unx/generic/gdi/cairotextrender.cxx
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2016-11-23 23:28:53 +0200
committerKhaled Hosny <khaledhosny@eglug.org>2016-11-26 05:58:33 +0000
commit47ea13ef8dc8ab9aeded6121845e3ebd1d28b292 (patch)
treee1fef0a1fd6a908d9ea8556f25aeb12e9d265635 /vcl/unx/generic/gdi/cairotextrender.cxx
parentmark VclPtr::Create as SAL_WARN_UNUSED_RESULT (diff)
downloadcore-47ea13ef8dc8ab9aeded6121845e3ebd1d28b292.tar.gz
core-47ea13ef8dc8ab9aeded6121845e3ebd1d28b292.zip
Kill the old Unix layout engines
Change-Id: I9e1667faf9644dfab025c82cb11a6490d1e8f998 Reviewed-on: https://gerrit.libreoffice.org/31221 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
Diffstat (limited to 'vcl/unx/generic/gdi/cairotextrender.cxx')
-rw-r--r--vcl/unx/generic/gdi/cairotextrender.cxx42
1 files changed, 9 insertions, 33 deletions
diff --git a/vcl/unx/generic/gdi/cairotextrender.cxx b/vcl/unx/generic/gdi/cairotextrender.cxx
index 289a066cf878..69e07a0c00c9 100644
--- a/vcl/unx/generic/gdi/cairotextrender.cxx
+++ b/vcl/unx/generic/gdi/cairotextrender.cxx
@@ -185,9 +185,6 @@ void CairoTextRender::DrawServerFontLayout( const GenericSalLayout& rLayout, con
case GF_ROTL: // left
glyph_extrarotation.push_back(1);
break;
- case GF_ROTR: // right
- glyph_extrarotation.push_back(-1);
- break;
default:
glyph_extrarotation.push_back(0);
break;
@@ -293,35 +290,17 @@ void CairoTextRender::DrawServerFontLayout( const GenericSalLayout& rLayout, con
//like them
double xdiff = 0.0;
double ydiff = 0.0;
- if (nGlyphRotation == 1)
+ if (nGlyphRotation)
{
- if (SalLayout::UseCommonLayout())
- {
- // 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;
- }
- else
- {
- ydiff = font_extents.ascent/nHeight;
- }
+ // 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;
}
- else if (nGlyphRotation == -1)
- {
- cairo_text_extents_t text_extents;
- cairo_glyph_extents(cr, &cairo_glyphs[nStartIndex], nLen,
- &text_extents);
-
- xdiff = -text_extents.x_advance/nHeight;
- //to restore an apparent bug in the original X11 impl, replace
- //nHeight with nWidth below
- xdiff += font_extents.descent/nHeight;
- }
cairo_matrix_translate(&m, xdiff, ydiff);
}
@@ -506,10 +485,7 @@ SalLayout* CairoTextRender::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackL
if( mpFreetypeFont[ nFallbackLevel ]
&& !(rArgs.mnFlags & SalLayoutFlags::DisableGlyphProcessing) )
{
- if (SalLayout::UseCommonLayout())
- pLayout = new CommonSalLayout(*mpFreetypeFont[nFallbackLevel]);
- else
- pLayout = new ServerFontLayout( *mpFreetypeFont[ nFallbackLevel ] );
+ pLayout = new CommonSalLayout(*mpFreetypeFont[nFallbackLevel]);
}
return pLayout;