## From: Nobuto MURATA <nobuto@ubuntu.com>
## Description: improve "faux bold" on Impress presentation
##  cherry-picked from upstream 3.6 branch and refreshed to apply
##  into 3.5.x.
##  The "faux bold" make the bold font in Asian ugly & unacceptable,
##  Adjust & improve the "faux bold" to make the bold font better.
## Bug: https://bugs.freedesktop.org/show_bug.cgi?id=47432
## Bug-Ubuntu: https://launchpad.net/bugs/585910
## Origin: upstream, http://cgit.freedesktop.org/libreoffice/core/commit/?id=cad7a5814775adf458f8a490700fa5ef6b8f8638&g=libreoffice-3-6
## Forwarded: not-needed
--- a/canvas/source/cairo/cairo_textlayout.cxx
+++ b/canvas/source/cairo/cairo_textlayout.cxx
@@ -606,12 +606,13 @@
             //faux bold
             if (rSysFontData.bFakeBold) {
                 double bold_dx = 0.5 * sqrt( 0.7 * aFont.GetHeight() );
-                int total_steps = 2 * ((int) (bold_dx + 0.5));
+                int total_steps = 1 * ((int) (bold_dx + 0.5));
 
                 // loop to draw the text for every half pixel of displacement
                 for (int nSteps = 0; nSteps < total_steps; nSteps++) {
                     for(int nGlyphIdx = 0; nGlyphIdx < (int) cairo_glyphs.size(); nGlyphIdx++) {
-                        cairo_glyphs[nGlyphIdx].x += bold_dx * nSteps / total_steps;
+                        cairo_glyphs[nGlyphIdx].x += (bold_dx * nSteps / total_steps) / 4;
+                        cairo_glyphs[nGlyphIdx].y += (bold_dx * nSteps / total_steps) / 4;
                     }
                     cairo_show_glyphs(pSCairo.get(), &cairo_glyphs[0], cairo_glyphs.size());
                 }
