Bug 142174 - Characters shift to top in vertical layout with the Skia backend enabled
Summary: Characters shift to top in vertical layout with the Skia backend enabled
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
Version:
(earliest affected)
7.1.3.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL: http://document-foundation-mail-archi...
Whiteboard:
Keywords:
: 143025 (view as bug list)
Depends on:
Blocks: Skia
  Show dependency treegraph
 
Reported: 2021-05-08 17:09 UTC by Volga
Modified: 2021-06-26 15:23 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Fig 1. Open the attachment with Skia on (105.03 KB, image/png)
2021-05-08 17:10 UTC, Volga
Details
Fig 2. Open the attachment with Skia off (90.81 KB, image/png)
2021-05-08 17:13 UTC, Volga
Details
Not quite right yet with Skia rendering (52.54 KB, image/png)
2021-05-09 15:45 UTC, V Stuart Foote
Details
test doc with default GDI rendering (45.03 KB, image/png)
2021-05-09 15:48 UTC, V Stuart Foote
Details
Screenshot from a recent LibreOfficeDev build, Skia is enabled (72.94 KB, image/png)
2021-05-14 19:36 UTC, Volga
Details
Screenshot from a later LibreOfficeDev build, Skia is enabled (109.34 KB, image/png)
2021-06-24 07:39 UTC, Volga
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Volga 2021-05-08 17:09:27 UTC
Description:
While I set vertical layout in a frame, character shift to top and out of the boundry of frame. This is reproducable with the Skia backend enabled.

Steps to Reproduce:
1. Just download attachment 133801 [details] and open the file

Actual Results:
See my screenshot

Expected Results:
Even if the Skia backend enabled, characters should always placed in right position.


Reproducible: Always


User Profile Reset: No



Additional Info:
-
Comment 1 Volga 2021-05-08 17:10:27 UTC
Created attachment 171791 [details]
Fig 1. Open the attachment with Skia on

Version: 7.1.3.2 (x64) / LibreOffice Community
Build ID: 47f78053abe362b9384784d31a6e56f8511eb1c1
CPU threads: 4; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: zh-CN (zh_CN); UI: zh-CN
Calc: threaded
Comment 2 Volga 2021-05-08 17:13:48 UTC
Created attachment 171792 [details]
Fig 2. Open the attachment with Skia off

Version: 7.1.3.2 (x64) / LibreOffice Community
Build ID: 47f78053abe362b9384784d31a6e56f8511eb1c1
CPU threads: 4; OS: Windows 10.0 Build 19042; UI render: default; VCL: win
Locale: zh-CN (zh_CN); UI: zh-CN
Calc: threaded
Comment 3 Volga 2021-05-08 17:19:31 UTC
This bug affected characters with Vertical_Orientation value as U.
Comment 4 V Stuart Foote 2021-05-08 23:31:21 UTC
Confirmed opening attachment 133801 [details] on a recent build of master/7.2

No better with different fonts (e.g. Libertinus)

Version: 7.2.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: f616d96bd8ce8986e4cc204953db0467e6060b5c
CPU threads: 8; OS: Windows 10.0 Build 19042; UI render: default; VCL: win
Locale: en-US (en_US); UI: en-US
Calc:
Comment 5 V Stuart Foote 2021-05-08 23:32:54 UTC
(In reply to V Stuart Foote from comment #4)
> Confirmed opening attachment 133801 [details] on a recent build of master/7.2
> 
> No better with different fonts (e.g. Libertinus)
> 
> Version: 7.2.0.0.alpha0+ (x64) / LibreOffice Community
> Build ID: f616d96bd8ce8986e4cc204953db0467e6060b5c
> CPU threads: 8; OS: Windows 10.0 Build 19042; UI render: default; VCL: win
> Locale: en-US (en_US); UI: en-US
> Calc:

affects both Skia modes, Vulkan or raster rendering.
Comment 6 Ming Hua 2021-05-08 23:56:45 UTC
I believe this is the same problem Mark Hung described in the mailing list sub-thread starting at [1].  Adding him to CC.

1. https://lists.freedesktop.org/archives/libreoffice/2021-May/087315.html
Comment 7 V Stuart Foote 2021-05-09 04:27:17 UTC
Did we ever correct the DirectWrite Direct2D handling of rotated glyphs? See also bug 100986

Khaled had given up and resorted to GDI+ calls, with [1]; but that got stripped out when dumping the OpenGL support [2].

=-ref-=
[1] https://gerrit.libreoffice.org/c/core/+/34862
[2] https://gerrit.libreoffice.org/c/core/+/107290
Comment 8 V Stuart Foote 2021-05-09 06:11:59 UTC
(In reply to V Stuart Foote from comment #7)
> ...; but that got
> stripped out when dumping the OpenGL support [2].
> 
> =-ref-=

> [2] https://gerrit.libreoffice.org/c/core/+/107290

actually was done in https://gerrit.libreoffice.org/c/core/+/107291
Comment 9 V Stuart Foote 2021-05-09 15:45:38 UTC
Created attachment 171800 [details]
Not quite right yet with Skia rendering

With Mark Hung's commits [1][2] applied the vertical glyphs still are extending outside the frame on Writer canvas.

Canvas was at 118% zoom, and I had to <Ctrl>+A select all the text and assign it Libertinus Serif as there was considerable difference in font fallback with Skia as compared to default GDI. Setting all the text in the frame to Libertinus Serif cleared that (with a couple of undefined gylphs).

And, is the Frame size different between Skia rendering and default GDI? Kind of seems to shrink on canvas--is that maybe part of the issue?

=-ref-=
https://gerrit.libreoffice.org/c/core/+/115148 https://gerrit.libreoffice.org/c/core/+/115016
Comment 10 V Stuart Foote 2021-05-09 15:48:02 UTC
Created attachment 171801 [details]
test doc with default GDI rendering

Graphics mode changed to default GDI. Writer canvas at 118%, same select all text and font change for the frame to Libertinus Serif.

Didn't measure but is the Frame larger on canvas, or just an optical illusion?
Comment 11 Mark Hung 2021-05-10 00:45:16 UTC
(In reply to V Stuart Foote from comment #9)
> Created attachment 171800 [details]
> Not quite right yet with Skia rendering
> 
> With Mark Hung's commits [1][2] applied the vertical glyphs still are
> extending outside the frame on Writer canvas.
> 

It still needs:
https://gerrit.libreoffice.org/c/core/+/115017  (not merged yet) 

But this is only useful if user turns off Skia.

> Canvas was at 118% zoom, and I had to <Ctrl>+A select all the text and
> assign it Libertinus Serif as there was considerable difference in font
> fallback with Skia as compared to default GDI. Setting all the text in the
> frame to Libertinus Serif cleared that (with a couple of undefined gylphs).

I did find upright glyphs that use fallback fonts in vertical writing shift up roughly the height of the font ascender. I'm working on a solution right now. It's consistent when Skia enabled (Windows), DWriteTextRenderer ( need the patch above and with Skia disabled ), Cairo(Linux) on current Master. But I'm not sure if appearance of the font fallback is the main point of this issue. Maybe it worth another ticket ( and use non fallback font for this issue ).

> 
> And, is the Frame size different between Skia rendering and default GDI?
> Kind of seems to shrink on canvas--is that maybe part of the issue?
> 
I didn't look at this yet. But maybe it worth another ticket?

> =-ref-=
> https://gerrit.libreoffice.org/c/core/+/115148
> https://gerrit.libreoffice.org/c/core/+/115016
Comment 12 Volga 2021-05-14 19:36:28 UTC
Created attachment 172009 [details]
Screenshot from a recent LibreOfficeDev build, Skia is enabled

On the recent master build, the texts works pretty with original Segoe UI Symbol font, but after I switch to Segoe UI font, it happened again to me while they are rendering with fallback fonts.

Version: 7.2.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 6c8ca02c5935a800cff70f3c173319b454b63c41
CPU threads: 4; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: zh-CN (zh_CN); UI: zh-CN
Calc: threaded
Comment 13 Volga 2021-06-24 07:39:14 UTC
Created attachment 173135 [details]
Screenshot from a later LibreOfficeDev build, Skia is enabled

Again, on 7.3.0 Alpha0 build, some glyphs even overlapped togther.

Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: f6b9f671d128c989ce223d61d0d5d43ff1dc9fcb
CPU threads: 4; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: zh-CN (zh_CN); UI: zh-CN
Calc: threaded
Comment 14 Mark Hung 2021-06-26 01:02:55 UTC
(In reply to Volga from comment #12)
> Created attachment 172009 [details]
> Screenshot from a recent LibreOfficeDev build, Skia is enabled
> 
> On the recent master build, the texts works pretty with original Segoe UI
> Symbol font, but after I switch to Segoe UI font, it happened again to me
> while they are rendering with fallback fonts.
> 
> Version: 7.2.0.0.alpha0+ (x64) / LibreOffice Community
> Build ID: 6c8ca02c5935a800cff70f3c173319b454b63c41
> CPU threads: 4; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL:
> win
> Locale: zh-CN (zh_CN); UI: zh-CN
> Calc: threaded

Set the status to resolved fixed because original test file now rendered correctly.

@Volga:
The cause of the issue is different when you a fallback font is used. It is related to neither vertical layout nor Skia, that makes the summary of the issue invalid. Please fill another issue with different reproducing steps.
Comment 15 Mark Hung 2021-06-26 09:07:32 UTC
*** Bug 143025 has been marked as a duplicate of this bug. ***
Comment 16 Volga 2021-06-26 15:23:54 UTC
The comment 13 is superceded by bug 143084.