Bug 47432 - Impress renders all bold Chinese fonts incorrectly .
Summary: Impress renders all bold Chinese fonts incorrectly .
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
3.5.1 release
Hardware: All All
: high critical
Assignee: Flex Liu
URL:
Whiteboard: target:3.7.0 target:3.6.4
Keywords:
: 34675 47509 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-03-17 03:42 UTC by alex
Modified: 2013-01-17 22:50 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
editing mode (24.17 KB, image/png)
2012-03-17 03:42 UTC, alex
Details
Presentation (21.94 KB, image/png)
2012-03-17 03:43 UTC, alex
Details
Improve the faux bold in cairo canvas, to make the bold font better. (1.61 KB, patch)
2012-10-19 06:06 UTC, Flex Liu
Details
without the patch (30.48 KB, image/png)
2012-10-19 06:14 UTC, Flex Liu
Details
with the patch (30.77 KB, image/png)
2012-10-19 06:15 UTC, Flex Liu
Details
with the patch (30.77 KB, image/png)
2012-10-19 06:19 UTC, Flex Liu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description alex 2012-03-17 03:42:35 UTC
Created attachment 58589 [details]
editing mode

Problem description: 

Steps to reproduce:
1. Create a new presentation in Impress
2. Type in a Chinese character.
3. Bold the Chinese character.
4. F5(presentation)

Current behavior:
The bold Chinese character is not the same as it shows in editing mode.

Expected behavior:
It should be the same as what it looks like in editing mode.

Platform (if different from the browser): 
 Ubuntu 10.04.4 LTS
Comment 1 alex 2012-03-17 03:43:05 UTC
Created attachment 58590 [details]
Presentation
Comment 2 alex 2012-03-19 15:11:47 UTC
*** Bug 47509 has been marked as a duplicate of this bug. ***
Comment 3 Flex Liu 2012-10-18 05:38:09 UTC
Yes, I reproduce the issue in master still.

I find the problem should be located in file:
/core/canvas/source/cairo/cairo_textlayout.cxx:608

            //faux bold
            if (rSysFontData.bFakeBold) {
                double bold_dx = 0.5 * sqrt( 0.7 * aFont.GetHeight() );
                int total_steps = 2 * ((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_show_glyphs(pSCairo.get(), &cairo_glyphs[0], cairo_glyphs.size());
                }   
                OSL_TRACE(":cairocanvas::TextLayout::draw(S,O,p,v,r): FAKEBOLD - dx:%d", (int) bold_dx);
            }   

yes, that's cause the bold in Asian font so ugly.
Comment 4 Flex Liu 2012-10-19 06:06:05 UTC
Created attachment 68779 [details]
Improve the faux bold in cairo canvas, to make the bold font better.

Simple patch to adjust & improve the "faux bold" in cairo canvas.
Comment 5 Flex Liu 2012-10-19 06:14:14 UTC
Created attachment 68780 [details]
without the patch
Comment 6 Flex Liu 2012-10-19 06:15:08 UTC
Created attachment 68781 [details]
with the patch
Comment 7 Flex Liu 2012-10-19 06:19:12 UTC
Created attachment 68782 [details]
with the patch

Sorry for above...
Comment 8 Not Assigned 2012-10-26 14:24:37 UTC
Flex Liu committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=b6aa58c4d8af8b960b085646d97f73c912503a96

Resolves: fdo#47432 Improve the "faux bold" in cairo canvas



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 9 Jan Holesovsky 2012-11-09 12:46:18 UTC
*** Bug 34675 has been marked as a duplicate of this bug. ***
Comment 10 Not Assigned 2012-11-09 12:53:00 UTC
Flex Liu committed a patch related to this issue.
It has been pushed to "libreoffice-3-6":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=cad7a5814775adf458f8a490700fa5ef6b8f8638&g=libreoffice-3-6

Resolves: fdo#47432 Improve the "faux bold" in cairo canvas


It will be available in LibreOffice 3.6.4.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.