[Libreoffice-bugs] [Bug 81484] Draw pdf import: bold font shown as "outline", if Chinese (CJK?) font is applied

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Sat Jun 26 15:12:39 UTC 2021


https://bugs.documentfoundation.org/show_bug.cgi?id=81484

--- Comment #23 from Kevin Suo <suokunlong at 126.com> ---
After some debugging in gdb, I find that the related code seems to be in:
sdext/source/pdfimport/tree/pdfiprocessor.cxx

where the line:
> aChangedFont.isOutline = ( (rGC.TextRenderMode == 1) || (rGC. TextRenderMode == 2) );
seems to be wrong.

I am not sure what TextRenderMode == 1 and TextRenderMode == 2 means, but:

when I set this line to:
> aChangedFont.isOutline = ( rGC.TextRenderMode == 2 );
then the imported font is shown as "outline" effect

and when I set this line to:
> aChangedFont.isOutline = ( rGC.TextRenderMode == 1 );
then the outline effect is gone, but the font is not shown as bold.

As a result, I guess:
rGC.TextRenderMode == 1 means the font weight should be outlined, and
rGC.TextRenderMode == 2 means the font render should be "bold".

So, if
aChangedFont.isOutline = ( rGC.TextRenderMode == 2 )
then because the font is bold thus it evaluates to true, thus the outline
effect is wrongly set.
The correct code is to use mode 2 as outline, while separately add lines to
test if it is bold and set font weight accordingly.

Could someone have a look? It is out of my ability to fix this.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20210626/e6b4865f/attachment.htm>


More information about the Libreoffice-bugs mailing list