Bug Hunting Session
Bug 115321 - Vertical Japanese text lines with emphasis mark above in odt exported to PDF is shown a quarter font height lower than the normal lines, and no emphasis mark is shown
Summary: Vertical Japanese text lines with emphasis mark above in odt exported to PDF ...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
6.1.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: CJK CJK-Japanese
  Show dependency treegraph
 
Reported: 2018-01-31 01:18 UTC by himajin100000
Modified: 2019-11-16 03:41 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
odt file to be exported (5.50 MB, application/vnd.oasis.opendocument.text)
2018-01-31 01:20 UTC, himajin100000
Details
result (23.63 KB, application/pdf)
2018-01-31 01:20 UTC, himajin100000
Details

Note You need to log in before you can comment on or make changes to this bug.
Description himajin100000 2018-01-31 01:18:43 UTC
Description:
Open the attached odt
Export To PDF(the result is attached)

the attached pdf is exported version of the attached odt but uncompressed by:
qpdf --stream-data=uncompress in.pdf out.pdf

all the characters in the odt is in 20pt

When you open that pdf in text editor(Of course you can open it in hex editor, if you don't mind unreadability from not caring newlines),

you will see the following lines
BT
1 0 0 1 575.3 824.1 Tm /F1 20 Tf<01>Tj
1 0 0 1 575.3 804.1 Tm<02>Tj
1 0 0 1 575.3 784.1 Tm<03>Tj
1 0 0 1 575.3 764.1 Tm<04>Tj
1 0 0 1 575.3 744.1 Tm<05>Tj
1 0 0 1 575.3 724 Tm<06>Tj
1 0 0 1 575.3 704 Tm<07>Tj
1 0 0 1 575.3 684 Tm<08>Tj
1 0 0 1 575.3 663.9 Tm<09>Tj
ET

and

BT
1 0 0 1 550.3 819.1 Tm /F1 20 Tf<01>Tj
1 0 0 1 550.3 799.1 Tm<02>Tj
1 0 0 1 550.3 779.1 Tm<03>Tj
1 0 0 1 550.3 759.1 Tm<04>Tj
1 0 0 1 550.3 739 Tm<05>Tj
1 0 0 1 550.3 719 Tm<06>Tj
1 0 0 1 550.3 698.9 Tm<07>Tj
1 0 0 1 550.3 678.9 Tm<08>Tj
1 0 0 1 550.3 658.9 Tm<09>Tj
ET

so the differences in y-value of the matching positions in two lines are

824.1 - 819.1 = 5
804.1 - 799.1 = 5
784.1 - 779.1 = 5

all the same: 5 , *which should be 0 instead.*

emphasis mark is seemingly not exported to PDF

Differences between the adjacent characters in the same line, such as 824.1 - 804.1 were the same as the font size: 20

these relationship did not change when I set 12pt for the characters.

differences in matching positions was all 3, and the differences in the same line were the font size:12

from I've seen, I guess this is coming from this thing-y.
https://opengrok.libreoffice.org/xref/core/vcl/source/outdev/font.cxx?r=55f07d4d#1094

Expected result should have emphasis mark on the right side of the characters instead of top side. But possibly export to pdf does not consider this, and emphasis marks to be shown were somehow clipped?

Steps to Reproduce:
Open the attached odt
Export To PDF
see description

Actual Results:  
see description

Expected Results:
see description


Reproducible: Always


User Profile Reset: No



Additional Info:


User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0
Comment 1 himajin100000 2018-01-31 01:20:15 UTC
Created attachment 139455 [details]
odt file to be exported
Comment 2 himajin100000 2018-01-31 01:20:42 UTC
Created attachment 139456 [details]
result
Comment 3 Buovjaga 2018-02-20 09:45:42 UTC
Repro

Arch Linux 64-bit
Version: 6.1.0.0.alpha0+
Build ID: c902cbc7dc5294ab721a9aef3a152aa243d00011
CPU threads: 8; OS: Linux 4.15; UI render: default; VCL: kde4; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group
Built on February 17th 2018
Comment 4 himajin100000 2018-02-22 00:22:40 UTC
recently, I was trying printf debugging, after reading

https://wiki.documentfoundation.org/Development/How_to_debug#Macros_Controlling_Debug_Code

to the following code,

https://opengrok.libreoffice.org/xref/core/sw/source/core/text/itrtxt.cxx?r=f55a9b77#280

I add some lines of code. (I'm too lazy to learn how to use diff command line.)
==================================
if( GetInfo().GetTextFrame()->IsVertLR() ){
    nOfst += rLine.Height() - ( rLine.Height() - nPorHeight ) / 2 - nPorAscent;
}else{
    SAL_INFO("vcl",nOfst);
    nOfst += ( rLine.Height() - nPorHeight ) / 2 + nPorAscent;
    SAL_INFO("vcl",rLine.Height());
    SAL_INFO("vcl",nPorHeight);
    SAL_INFO("vcl",nPorAscent);
    SAL_INFO("vcl",nOfst);
}

break;
==================================
When the line is WITHOUT emphasis mark, the result was:

info:vcl:9980:5152:sw/source/core/text/itrtxt.cxx:287: 0
info:vcl:9980:5152:sw/source/core/text/itrtxt.cxx:289: 401
info:vcl:9980:5152:sw/source/core/text/itrtxt.cxx:290: 401
info:vcl:9980:5152:sw/source/core/text/itrtxt.cxx:291: 346
info:vcl:9980:5152:sw/source/core/text/itrtxt.cxx:292: 346

while WITH emphasis mark on all characters in a line

info:vcl:9980:5152:sw/source/core/text/itrtxt.cxx:287: 0
info:vcl:9980:5152:sw/source/core/text/itrtxt.cxx:289: 499
info:vcl:9980:5152:sw/source/core/text/itrtxt.cxx:290: 499
info:vcl:9980:5152:sw/source/core/text/itrtxt.cxx:291: 444
info:vcl:9980:5152:sw/source/core/text/itrtxt.cxx:292: 444
===================================
for the following code

https://opengrok.libreoffice.org/xref/core/sw/source/core/text/itrpaint.cxx?r=180f2860#303

I tried

if ( bAdjustBaseLine ){
    GetInfo().Y( GetInfo().GetPos().Y() + AdjustBaseLine( *m_pCurr, pPor ) );
    SAL_INFO("vcl",GetInfo().Y());
    if ( pPor->Width() && pPor->InTextGrp() )
         pEndTempl = pPor;
    }
}

WITHOUT emphasis mark: 630
WITH emphasis mark: 728.

========================
additional note to my previous post(just to make sure):
I used IPA fonts downloadable from https://ipafont.ipa.go.jp/old/ipaexfont/download.html for the attachments. Values here may not be the same when different fonts (with different metrics) are used.
Comment 5 QA Administrators 2019-11-16 03:41:57 UTC
Dear himajin100000,

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the information from Help - About LibreOffice.
 
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice.

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)


If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from http://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
4b. If the bug was not present in 3.3 - add 'regression' to keyword


Feel free to come ask questions or to say hello in our QA chat: https://kiwiirc.com/nextclient/irc.freenode.net/#libreoffice-qa

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team

MassPing-UntouchedBug