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: 2018-11-15 09:02 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.