Bug 152679 - RTL text boxes misplaced when fallback font is used in importing a PDF into Writer
Summary: RTL text boxes misplaced when fallback font is used in importing a PDF into W...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: RTL-CTL PDF-Import-Writer
  Show dependency treegraph
 
Reported: 2022-12-25 22:38 UTC by Eyal Rozenberg
Modified: 2023-03-25 20:12 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Rendering of attachment 184337 from bug 152670 in PDF reader, LO Writer, LO Draw (56.73 KB, image/png)
2022-12-25 22:38 UTC, Eyal Rozenberg
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eyal Rozenberg 2022-12-25 22:38:47 UTC
Created attachment 184346 [details]
Rendering of attachment 184337 [details] from bug 152670 in PDF reader, LO Writer, LO Draw

Consider the testcase PDF from bug 152670: attachment 184337 [details].

If we open it in a recent version of LO Writer (i.e. after the resolution of bug 104597), we see that the textboxes of Hebrew text are misplaced; or at least - they're misplaced when the font is incorrectly determined (due to bug 143095), and the fallback font is used. For me, it's a Linux desktop PC where the Hebrew fallback font is DejaVu Sans family, Book variant; the intended font is David CLM, but it's mis-interpreted as "DavidCLMMedium", hence the use of the fallback.

I'm attaching how the six-cell table in the file is rendered in a PDF viewer, and in LO Writer (and Draw).

Notes:

1. If I set the font in the source ODT file used to generate the PDF to DejaVu Sans from the get-go, opening the PDF in Writer yields correctly-placed textboxes.
2. The LO Draw PDF import filter exhibits the same issue, but filing separately since the filters are separate code.
Comment 1 Dieter 2023-01-09 07:31:20 UTC
I confirm it with

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 376152fbd110cdc0a2cde1fa9758f36c016d9352
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: en-US (de_DE); UI: en-GB
Calc: CL threaded

but I don't understand, why this is a bug in Writer. If I open it from Writer, it opens in Draw (expected). And you attachment 184346 [details] shows the same rendering in Writer and Draw
Comment 2 Eyal Rozenberg 2023-01-13 13:38:31 UTC
(In reply to Dieter from comment #1)
> but I don't understand, why this is a bug in Writer. If I open it from
> Writer, it opens in Draw (expected).

No, Dieter. Use the Writer-targeting import filter.
Comment 3 Dieter 2023-03-19 17:29:33 UTC
(In reply to Eyal Rozenberg from comment #2)
> No, Dieter. Use the Writer-targeting import filter.

I don't know this filter. How can I use it?
Comment 4 Eyal Rozenberg 2023-03-19 18:47:03 UTC
(In reply to Dieter from comment #3)
> (In reply to Eyal Rozenberg from comment #2)
> > No, Dieter. Use the Writer-targeting import filter.
> 
> I don't know this filter. How can I use it?

Well, if bug 141732 were solved, you would just need to open the PDF in Writer. Unfortunately, what you need to do is, in the file open dialog box, scroll down the list of file types / import filters, until you get to "Portable Document Format (Writer)"; then select the PDF and open.
Comment 5 Dieter 2023-03-25 17:21:12 UTC
(In reply to Eyal Rozenberg from comment #4)
> Unfortunately, what you need to do is, in the file open dialog box,
> scroll down the list of file types / import filters, until you get to
> "Portable Document Format (Writer)"; then select the PDF and open.

Using windows, it is only available, if Tools -> Options -> Genreral -> "Use LibreOffice Dialogue boxes". thank you for this hint.
Comment 6 Eyal Rozenberg 2023-03-25 20:12:34 UTC
(In reply to Dieter from comment #5)
> Using windows, it is only available, if Tools -> Options -> Genreral -> "Use
> LibreOffice Dialogue boxes". thank you for this hint.

Wow, that's pretty bad... this makes me think maybe the severity of bug 141732 should be increased. Hint hint.