Bug 167962 - In vertical writing, if the text is italicized, the inclination will be different when displayed and PDF.
Summary: In vertical writing, if the text is italicized, the inclination will be diffe...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Aryan Mishra
URL:
Whiteboard: target:26.8.0 target:26.2.3
Keywords: difficultyMedium, easyHack, skillCpp
Depends on:
Blocks: PDF-Export CJK-Japanese
  Show dependency treegraph
 
Reported: 2025-08-15 10:47 UTC by Saburo
Modified: 2026-03-26 17:18 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
testsample (10.68 KB, application/vnd.oasis.opendocument.text)
2025-08-15 12:16 UTC, Saburo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Saburo 2025-08-15 10:47:25 UTC
Description:
https://ask.libreoffice.org/t/pdf/125436

Steps to Reproduce:
1.In Page Style, select Right-to-Left (Vertical)
2.Enter Japanese text and make it italic.
3.Export as PDF

Actual Results:
The text will be slanted downwards on the right

Expected Results:
The text will be tilted to the right


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 25.2.5.2 (X86_64) / LibreOffice Community
Build ID: 03d19516eb2e1dd5d4ccd751a0d6f35f35e08022
CPU threads: 12; OS: Windows 11 X86_64 (10.0 build 26100); UI render: Skia/Raster; VCL: win
Locale: ja-JP (ja_JP); UI: ja-JP
Calc: CL threaded

On Windows versions prior to 7.1, the display also sloped downward to the right.

and in
LibreOffice 3.3.0 
OOO330m19 (Build:6)
tag libreoffice-3.3.0.4
Comment 1 Saburo 2025-08-15 12:16:00 UTC
Created attachment 202330 [details]
testsample
Comment 2 LeroyG 2025-08-15 15:04:42 UTC
Reproducible with:
Version: 24.8.5.2 (X86_64) / LibreOffice Community
Build ID: 480(Build:2)
CPU threads: 4; OS: Linux 6.4; UI render: default; VCL: gtk3
Locale: es-MX (en_US.UTF-8); UI: en-US
Calc: threaded

More and screenshots at: https://ask.libreoffice.org/t/pdf/125436

With version 6.4.7.2, setting text to italics moves down the right side of each character (instead of moving right the upper part of each character). The error in the .odt is consistent in the PDF.

Versión: 6.4.7.2 (x64)
Id. de compilación: 639b8ac485750d5696d7590a72ef1b496725cfb5
Subprocs. CPU: 12; SO: Windows 10.0 Build 17763; Repres. IU: GL; VCL: win;
Configuración regional: es-AR (es_AR); Idioma de IU: es-ES
Calc: threaded
Comment 3 Jesus Solis 2025-08-15 20:06:22 UTC
Can reproduce. Setting to NEW.

Version: 25.2.5.2 (X86_64) / LibreOffice Community
Build ID: fb4792146257752f54eab576deb869869b108571
CPU threads: 12; OS: Linux 6.14; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: CL
Comment 4 Takenori Yasuda 2025-08-16 02:18:49 UTC
Reproduced not only in Japanese but also in Chinese.

Version: 25.8.1.0.0+ (X86_64) / LibreOffice Community
Build ID: 8b236227976b3b5c78afc916ea4acefd4b4b8c58
CPU threads: 8; OS: Windows 11 X86_64 (build 26100); UI render: Skia/Raster; VCL: win
Locale: ja-JP (ja_JP); UI: ja-JP
Calc: CL threaded Jumbo
Comment 5 Jonathan Clark 2026-02-24 10:48:29 UTC
Code pointer:

Vertical glyphs are written to PDF files by the PDFWriterImpl::drawVerticalGlyphs() function, located in vcl/source/pdf/pdfwriter_impl.cpp. Inside this function, we simulate italics when necessary by applying a skew:

> // perform artificial italics if necessary
> double fSkew = 0.0;
> if (rGlyphs[i].m_pFont->NeedsArtificialItalic())
>     fSkew = ARTIFICIAL_ITALIC_SKEW;
> 
> double fSkewB = fSkew;
> double fSkewA = 0.0;
> 
> Point aDeltaPos;
> if (rGlyphs[i].m_pGlyph->IsVertical())
> {
>     fDeltaAngle = M_PI/2.0;
>     fYScale = fXScale;
>     fTempXScale = 1.0;
>     fSkewA = -fSkewB;
>     fSkewB = 0.0;
> }
> ...
> Matrix3 aMat;
> if( fSkewB != 0.0 || fSkewA != 0.0 )
>     aMat.skew( fSkewA, fSkewB );

Unfortunately, the math used for vertical glyphs isn't quite right. The skew coefficients for vertical glyphs need to be changed so the glyphs look the same in the Writer UI and in the PDF export.
Comment 6 Aryan Mishra 2026-03-21 18:36:25 UTC
I have submitted a patch for this bug -

https://gerrit.libreoffice.org/c/core/+/202319.

I have tested the fix locally by exporting PDFs having vertical italicized japanese and chinese text.
Comment 7 Commit Notification 2026-03-23 18:08:15 UTC
Aryan Mishra committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/1a756ab9467794889ba70667a872dddc9c53196d

tdf#167962 Fix artificial skew for italic vertical glyphs in PDF export

It will be available in 26.8.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 8 Commit Notification 2026-03-26 17:18:17 UTC
Aryan Mishra committed a patch related to this issue.
It has been pushed to "libreoffice-26-2":

https://git.libreoffice.org/core/commit/4d82ca0ec8ca11bf81140d070b07c825777a94fa

tdf#167962 Fix artificial skew for italic vertical glyphs in PDF export

It will be available in 26.2.3.

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.