diff options
author | Flex Liu <winddss@gmail.com> | 2012-10-26 15:18:35 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-10-26 15:20:54 +0100 |
commit | b6aa58c4d8af8b960b085646d97f73c912503a96 (patch) | |
tree | c8048bbef5c590f753e6065e18be5014b48fddf2 /canvas/source | |
parent | 9ffc1f4e03d1477eaa29873267161e7697c55d3f (diff) |
Resolves: fdo#47432 Improve the "faux bold" in cairo canvas
The "faux bold" make the bold font in Asian ugly & unacceptable,
Adjust & improve the "faux bold" to make the bold font better.
Change-Id: I2e02156ffc30629476b80134ffb0b50e793f7ead
Diffstat (limited to 'canvas/source')
-rw-r--r-- | canvas/source/cairo/cairo_textlayout.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/canvas/source/cairo/cairo_textlayout.cxx b/canvas/source/cairo/cairo_textlayout.cxx index 383b0ffe3fbc..6fa55629da5f 100644 --- a/canvas/source/cairo/cairo_textlayout.cxx +++ b/canvas/source/cairo/cairo_textlayout.cxx @@ -609,14 +609,15 @@ namespace cairocanvas 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()); } |