Bug 136081 - When Skia is enabled in vertical writing, changing the font scale changes the font size
Summary: When Skia is enabled in vertical writing, changing the font scale changes the...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.0.0.3 release
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.2.0
Keywords:
Depends on:
Blocks: CJK Vertical-Text CJK-Japanese Skia
  Show dependency treegraph
 
Reported: 2020-08-24 15:25 UTC by Jun Nogata
Modified: 2021-09-27 14:17 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Vertical writing, Skia enabled and scale width changed (260.39 KB, image/png)
2020-08-24 15:30 UTC, Jun Nogata
Details
Vertical writing, Skia disabled and scale width changed (124.22 KB, image/png)
2020-08-24 15:31 UTC, Jun Nogata
Details
Test odt file (19.08 KB, application/vnd.oasis.opendocument.text)
2020-08-24 15:32 UTC, Jun Nogata
Details
dwrite possible fix (36.74 KB, image/png)
2020-08-26 16:27 UTC, Luboš Luňák
Details
gdi possible fix (36.76 KB, image/png)
2020-08-26 16:27 UTC, Luboš Luňák
Details
Font scale correct and incorrect (85.31 KB, image/png)
2020-08-30 11:27 UTC, Jun Nogata
Details
vertical writing with 300% scaling in width (10.74 KB, application/vnd.oasis.opendocument.text)
2021-05-08 10:34 UTC, Mark Hung
Details
With https://gerrit.libreoffice.org/c/core/+/115246 (24.53 KB, image/png)
2021-05-08 10:41 UTC, Mark Hung
Details
7.1 without SKIA Screenshot (Good version) (261.32 KB, image/png)
2021-05-14 14:38 UTC, Jun Nogata
Details
patched 7.2 with SKIA Screenshot (313.76 KB, image/png)
2021-05-14 14:39 UTC, Jun Nogata
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jun Nogata 2020-08-24 15:25:35 UTC
Description:
When Skia is enabled in vertical writing, changing the width in the font scale modifies the font size.

Steps to Reproduce:
Configutation:
* Open Tools -> Options
    * LibreOffice -> View: [Use Skia for all rendering] is on.
    * Language Settings -> Languages: 
        * Asia: Default - Japanese

Page Style:
* Open Format -> Page Style...
    * [Page] Tab: Text Direction: Right-to-Left(Vertical1. )

1. Select a characters.
2. Right click, Select Character -> Character... from context menu.
3. [Position] Tab, Set [Scale Width] to 70% of 140%.

Actual Results:
Font size has changed.

Expected Results:
Font width has changed.


Reproducible: Always


User Profile Reset: Yes


OpenGL enabled: Yes

Additional Info:
Version: 7.0.0.3 (x64)
Build ID: 8061b3e9204bef6b321a21033174034a5e2ea88e
CPU threads: 2; OS:Windows 10.0 Build 19041; UI render: default; VCL: win
Locale: ja-JP (ja_JP); UI: ja-JP
Calc: threaded
Comment 1 Jun Nogata 2020-08-24 15:30:38 UTC
Created attachment 164642 [details]
Vertical writing, Skia enabled and scale width changed
Comment 2 Jun Nogata 2020-08-24 15:31:38 UTC
Created attachment 164643 [details]
Vertical writing, Skia disabled and scale width changed
Comment 3 Jun Nogata 2020-08-24 15:32:31 UTC
Created attachment 164644 [details]
Test odt file
Comment 4 Ming Hua 2020-08-24 22:09:40 UTC
Reproduced using the test file in comment #3.
Version: 7.0.0.3 (x64)
Build ID: 8061b3e9204bef6b321a21033174034a5e2ea88e
CPU 线程: 2; 操作系统: Windows 10.0 Build 18363; 界面渲染: Skia/点阵; VCL: win
Locale: zh-CN (zh_CN); 界面: zh-CN
Calc: threaded

Also happens for Chinese vertical text using similar steps on a new blank file.
Comment 5 Luboš Luňák 2020-08-26 16:26:40 UTC
What exactly am I supposed to see? I don't know how read the text, and it's not even the same text for the 3 different sizes, so I don't know what to compare.
Are either or both of these following screenshots correct?
Comment 6 Luboš Luňák 2020-08-26 16:27:19 UTC
Created attachment 164723 [details]
dwrite possible fix
Comment 7 Luboš Luňák 2020-08-26 16:27:45 UTC
Created attachment 164724 [details]
gdi possible fix
Comment 8 Ming Hua 2020-08-26 18:16:12 UTC
(In reply to Luboš Luňák from comment #5)
> What exactly am I supposed to see? I don't know how read the text, and it's
> not even the same text for the 3 different sizes, so I don't know what to
> compare.
> Are either or both of these following screenshots correct?
Alas, I thought the difference is obvious to non-CJK users.  Sorry for not explaining it better.

The usual Kanji/Hanzi character is a square-shaped glyph, i.e., the height and width is the same.  And in the example file, when the "width" (in vertical text, it refers to the vertical dimension) is scaled, the "height" (horizontal dimension for vertical text) stays the same, and the characters are no longer square-shaped, but looks like a rectangle.

So the expected behavior is: for 70% scaling, the vertical "width" is smaller than the horizontal "height", and the characters are "short and wide" rectangles; while for 140% scaling, the "width" is larger than "height", and the characters are "tall and slim" rectangles.  Of course, for 100% scaling, the characters are squares.  This is what's shown in attachment 164643 [details].

The actual behavior, which we consider buggy, is that characters are shown as squares in all three scalings.  It is as if the scaling in vertical "width" is also applied to the horizontal "height".  This is what's shown in attachment 164642 [details].

In your two screenshots characters are all squares, so neither of them is correct.
Comment 9 Jun Nogata 2020-08-30 11:27:56 UTC
Created attachment 164870 [details]
Font scale correct and incorrect
Comment 10 Jun Nogata 2020-08-30 11:30:54 UTC
(In reply to Luboš Luňák from comment #5)
> What exactly am I supposed to see? I don't know how read the text, and it's
> not even the same text for the 3 different sizes, so I don't know what to
> compare.
> Are either or both of these following screenshots correct?

I made a picture of the correct and incorrect font scale. Please see the attached image.

* https://bugs.documentfoundation.org/attachment.cgi?id=164870
Comment 11 Aron Budea 2020-10-16 03:08:22 UTC
(In reply to nogajun from comment #10)
> I made a picture of the correct and incorrect font scale. Please see the
> attached image.
> 
> * https://bugs.documentfoundation.org/attachment.cgi?id=164870
The "Good" 140% sample in this image is distorted compared to what it should look like alongside the 100% one, right? It should be the same width, and taller, while in the sample it is the same height, and narrower.

At least when I look at the test document without Skia rendering, or in the second attached screenshot, it seems to be the same width, and only the height changes (which corresponds to Ming Hua's explanation from comment 8).
Comment 12 Ming Hua 2020-12-02 23:33:09 UTC
Still reproducible in 7.1.0 Beta1:

Good (non-square characters for 70% and 140% scales) in:
Version: 7.1.0.0.beta1 (x64)
Build ID: 828a45a14a0b954e0e539f5a9a10ca31c81d8f53
CPU threads: 2; OS: Windows 10.0 Build 18363; UI render: default; VCL: win
Locale: zh-CN (zh_CN); UI: zh-CN
Calc: threaded

... and bad (all square characters) in:
Version: 7.1.0.0.beta1 (x64)
Build ID: 828a45a14a0b954e0e539f5a9a10ca31c81d8f53
CPU threads: 2; OS: Windows 10.0 Build 18363; UI render: Skia/Raster; VCL: win
Locale: zh-CN (zh_CN); UI: zh-CN
Calc: threaded
Comment 13 Mark Hung 2021-05-08 10:34:48 UTC
Created attachment 171783 [details]
vertical writing with 300% scaling in width

I made another test file. It contains two lines in vertical writing, one without scaling (100%) and the other with scaling (300%) for comparison.

With 7.1.2.2 and current master build, the font did scale 300% in width, just too much space padded between characters.


Version: 7.1.2.2 (x64) / LibreOffice Community
Build ID: 8a45595d069ef5570103caea1b71cc9d82b2aae4
CPU threads: 16; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: zh-TW (zh_TW); UI: zh-TW
Calc: CL
Comment 14 Mark Hung 2021-05-08 10:41:01 UTC
Created attachment 171784 [details]
With https://gerrit.libreoffice.org/c/core/+/115246


The attached image shows what appears with the attachment #171783 [details] and the fix below:

https://gerrit.libreoffice.org/c/core/+/115246
Comment 15 Jun Nogata 2021-05-14 14:37:11 UTC
(In reply to Mark Hung from comment #14)

Great! But it need to fix a some more.
I've attached screenshots. (7.1-without-skia.png and 7.2-with-skia.png)

* SKIA version is biginning of line are not aligned.
  70% is moved above 100%. 140% is moved below 100%.

* SKIA version is spacing between the characters has changed.
  70% overlaps the character above it. 140% moves the characters apart.
Comment 16 Jun Nogata 2021-05-14 14:38:38 UTC
Created attachment 171998 [details]
7.1 without SKIA Screenshot (Good version)
Comment 17 Jun Nogata 2021-05-14 14:39:34 UTC
Created attachment 171999 [details]
patched 7.2 with SKIA Screenshot
Comment 18 Commit Notification 2021-05-24 08:59:10 UTC
Luboš Luňák committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/d3772e26c077686fc5ca0a8ba526df7d104ada5c

fix font scale width handling for Skia/X11 (tdf#136081)

It will be available in 7.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 19 Luboš Luňák 2021-05-24 09:07:50 UTC
This should be fixed for 7.2+. As the fixes depend on other changes that are non-trivial and will not be backported to 7.1, this issue can be worked around by disabling Skia for 7.1 until 7.2 is released.
Comment 20 Ming Hua 2021-06-18 15:24:02 UTC
Confirmed with sample file in comment #3 and 7.2.0 Beta1 on Windows 10:
Version: 7.2.0.0.beta1 (x64) / LibreOffice Community
Build ID: c6974f7afec4cd5195617ae48c6ef9aacfe85ddd
CPU threads: 2; OS: Windows 10.0 Build 19041; UI render: Skia/Raster; VCL: win
Locale: zh-CN (zh_CN); UI: zh-CN
Calc: threaded

The 70% and 140% scaling paragraphs now correctly have non-square shaped characters.

Thanks Luboš!
Comment 21 Ming Hua 2021-06-18 15:25:48 UTC
(In reply to Ming Hua from comment #20)
> Thanks Luboš!
And of course thanks to Mark as well!