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
Created attachment 202330 [details] testsample
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
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
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
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.
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.
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.
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.