Bug 119070 - Fractional font sizes in PDF causes misalignment
Summary: Fractional font sizes in PDF causes misalignment
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
Depends on:
Blocks: Font-Rendering PDF-Import-Draw
  Show dependency treegraph
Reported: 2018-08-02 18:37 UTC by Arcadiy Ivanov
Modified: 2023-09-21 06:01 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:

Source test doc created in Writer (4.14 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2018-08-02 18:39 UTC, Arcadiy Ivanov
PDF doc exported from Writer (40.61 KB, application/pdf)
2018-08-02 18:39 UTC, Arcadiy Ivanov
How Ocular sees the PDF doc (79.44 KB, image/png)
2018-08-02 18:41 UTC, Arcadiy Ivanov
How Draw sees the PDF doc (58.70 KB, image/png)
2018-08-02 18:42 UTC, Arcadiy Ivanov
How Draw sees a real-life PDF doc (worst case) (3.49 KB, image/png)
2018-08-02 18:45 UTC, Arcadiy Ivanov
Screenshot doc vs pdf (62.28 KB, image/png)
2018-08-28 01:08 UTC, Regis Perdreau
screenshot (107.71 KB, image/png)
2023-09-21 06:01 UTC, BogdanB

Note You need to log in before you can comment on or make changes to this bug.
Description Arcadiy Ivanov 2018-08-02 18:37:48 UTC
The use of fractional font sizes in PDF opened in LibreDraw causes misalignment.

Steps to Reproduce:
1. Create or find a word document that has fractional size fonts.
2. Export to PDF from writer.
3. Open in Draw. Observe various degrees of text misalignment.
4. Export from Draw into another PDF, observe the misalignment stays in the new PDF.

Actual Results:
Run-on text, misaligned text.

Expected Results:
Properly aligned text.

Reproducible: Always

User Profile Reset: Yes

Additional Info:
Comment 1 Arcadiy Ivanov 2018-08-02 18:39:05 UTC
Created attachment 143938 [details]
Source test doc created in Writer
Comment 2 Arcadiy Ivanov 2018-08-02 18:39:38 UTC
Created attachment 143939 [details]
PDF doc exported from Writer
Comment 3 Arcadiy Ivanov 2018-08-02 18:41:35 UTC
Created attachment 143940 [details]
How Ocular sees the PDF doc
Comment 4 Arcadiy Ivanov 2018-08-02 18:42:41 UTC
Created attachment 143941 [details]
How Draw sees the PDF doc
Comment 5 Arcadiy Ivanov 2018-08-02 18:45:03 UTC
Created attachment 143942 [details]
How Draw sees a real-life PDF doc (worst case)
Comment 6 Regis Perdreau 2018-08-28 01:08:27 UTC
Created attachment 144490 [details]
Screenshot doc vs pdf

May be a lack of pdf support. I confirm the misalignement for pdf import in Draw. May be, we can have better. I set confirmed.
Comment 7 Buovjaga 2018-09-02 16:15:42 UTC
Sounds like Regis wanted to set to NEW, so correcting
Comment 8 V Stuart Foote 2018-10-12 16:18:26 UTC
Nothing new here!
Same behavior in
LibreOffice 3.3.0 
OOO330m19 (Build:6)
tag libreoffice-

Why would one expect fidelity when taking text with differing font metrics and attributes (e.g. underlining) through filter export from MS Word to PDF, import from PDF into Draw document canvas as individual text runs, and then an export to PDF from Draw?

The PDF is structured with text runs drawn from spans on export, each change of font & attributes in the source OOXML or ODF will ensure it is handled in a different text run in the PDF. Then on filter import, positioning of *each* individual run as a Draw object onto document canvas is limited by our 1/100mm placement resolution.

Additionally, there is also a known issue in the precision of how fonts are scaled and text glyph height and span width is calculated--which is then manifested in filter during import and export.

That is why LibreOffice will *never* be considered a PDF editor--we do not hold positional precision of the objects placed to document canvas during filter import and then export, neither graphics nor text.
Comment 9 QA Administrators 2019-10-13 02:33:55 UTC Comment hidden (obsolete)
Comment 10 QA Administrators 2021-10-13 03:40:19 UTC Comment hidden (obsolete)
Comment 11 BogdanB 2023-09-21 05:58:46 UTC
The render seems much better now, please retest this bug.

Version: (X86_64) / LibreOffice Community
Build ID: a34dcd03254480927c403d904c0e754802d97b90
CPU threads: 4; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded
Comment 12 BogdanB 2023-09-21 06:01:11 UTC
Created attachment 189727 [details]

See screenshot