Bug 104390 - FILEOPEN RTF Courier New erroneously replaced with fallback font, when file does not contain \pard\plain
Summary: FILEOPEN RTF Courier New erroneously replaced with fallback font, when file d...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.5.0 release
Hardware: All All
: medium normal
Assignee: Vasily Melenchuk (CIB)
URL:
Whiteboard: target:7.4.0 target:7.3.3
Keywords: filter:rtf, preBibisect, regression
Depends on:
Blocks: RTF-New-Import
  Show dependency treegraph
 
Reported: 2016-12-04 12:54 UTC by robert
Modified: 2022-03-22 13:29 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
File showing the problem (4.80 KB, text/rtf)
2016-12-04 12:54 UTC, robert
Details
Table as it should be displayed (130.07 KB, image/jpeg)
2016-12-10 21:41 UTC, robert
Details

Note You need to log in before you can comment on or make changes to this bug.
Description robert 2016-12-04 12:54:13 UTC
Created attachment 129299 [details]
File showing the problem

The attached file, when opened with 

Version: 5.2.3.3 (x64)
Build ID: d54a8868f08a7b39642414cf2c8ef2f228f780cf
CPU Threads: 8; OS Version: Windows 6.1; UI Render: default; 
Locale: en-GB (en_GB); Calc: group

displays "Courier New" in the font drop-down box, but a single click on the badly displayed fixed format layout will change that into the actually used font, "Liberation Sans".

The problem seems to be that Writer cannot handle an RTF document that does not contain "\pard\plain", whereas Word 2002 (a "freebie" with my PC) has absolutely no trouble opening the attached.
Comment 1 m_a_riosv 2016-12-04 18:13:20 UTC
The first row has 'Courier new' up to the space before 'Year' but the rest of the document has 'Calibri' font.
Comment 2 m_a_riosv 2016-12-04 18:14:49 UTC Comment hidden (obsolete)
Comment 3 robert 2016-12-04 18:18:52 UTC
You're right about the first line, and the font drop-down tells me that the rest is "Liberation Serif".

Must still have been sleeping...
Comment 4 Buovjaga 2016-12-10 16:29:05 UTC
From the comments I understand there is no bug, so closing as such.
Comment 5 robert 2016-12-10 19:34:32 UTC
Did you actually look at the file?

THE FORMAT IS COMPLETELY GONE!
Comment 6 Buovjaga 2016-12-10 19:49:40 UTC
(In reply to robert from comment #5)
> Did you actually look at the file?
> 
> THE FORMAT IS COMPLETELY GONE!

Yes, I looked at the file.

So are you wanting to turn this report now to something else than in your description? If yes, please attach a screenshot or PDF of how the RTF is supposed to look like, when rendered correctly.

Set to NEEDINFO.
Change back to UNCONFIRMED after you have provided the information.
Comment 7 robert 2016-12-10 21:41:44 UTC
Created attachment 129466 [details]
Table as it should be displayed

And the fact that the ignored font, "Courier New" is a fixed pitch font didn't ring any bells?
Comment 8 Buovjaga 2016-12-12 17:33:06 UTC
(In reply to robert from comment #7)
> Created attachment 129466 [details]
> Table as it should be displayed

Confirmed it looks like that in MSO 2013. Confirmed that it is rendered incorrectly in LibO (with Courier New available).

For me, the replacement font is Liberation Serif, so now we have three different experiences (L. Sans, Calibri).

Arch Linux 64-bit, KDE Plasma 5
Version: 5.4.0.0.alpha0+
Build ID: 1fce5b024e9f25c3fcef2537a22474ece0dc416f
CPU Threads: 8; OS Version: Linux 4.8; UI Render: default; VCL: kde4; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group
Built on December 10th 2016
Comment 9 QA Administrators 2018-07-19 02:42:08 UTC Comment hidden (obsolete)
Comment 10 V Stuart Foote 2018-07-19 03:28:12 UTC
Continues reproducible on Windows 10 Pro 64-bit en-US with Courier New font available and current master/6.2.0

Version: 6.2.0.0.alpha0+ (x64)
Build ID: daafe79c55cd53decbeac2367f298d79371dcf3d
CPU threads: 8; OS: Windows 10.0; UI render: GL; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2018-07-18_02:59:18
Locale: en-US (en_US); Calc: group threaded

RTF import filter does not pick up the Courier New font--and Default style is assigned to all paragraphs.

Once opened into LO, modifying Default paragraph style to use Courier New restores tabular format of the file.
Comment 11 QA Administrators 2019-07-20 02:46:40 UTC Comment hidden (obsolete)
Comment 12 robert 2019-07-21 09:46:27 UTC
Problem still occurs:

Version: 6.2.5.2 (x64)
Build ID: 1ec314fa52f458adc18c4f025c545a4e8b22c159
CPU threads: 8; OS: Windows 6.1; UI render: default; VCL: win; 
Locale: en-GB (en_GB); UI-Language: en-US
Calc: threaded
Comment 13 robert 2020-09-03 22:01:08 UTC
Problem still present @

Version: 7.0.1.2 (x64)
Build ID: 7cbcfc562f6eb6708b5ff7d7397325de9e764452
CPU threads: 8; OS: Windows 6.1 Service Pack 1 Build 7601; UI render: Skia/Raster; VCL: win
Locale: en-GB (en_GB); UI: en-US
Calc: threaded
Comment 14 robert 2021-05-12 20:49:23 UTC
Version: 7.1.3.2 (x64) / LibreOffice Community
Build ID: 47f78053abe362b9384784d31a6e56f8511eb1c1
CPU threads: 8; OS: Windows 6.1 Service Pack 1 Build 7601; UI render: Skia/Raster; VCL: win
Locale: en-GB (en_GB); UI: en-US
Calc: threaded

Problem still present!
Comment 15 Aron Budea 2021-08-22 18:37:29 UTC
This was fine in LO 3.4.0, and got buggy in 3.5.0, thus it is probably a regression related to the new RTF import code. Already buggy in oldest of bibisect-43all -> preBibisect.
Comment 16 Commit Notification 2022-03-22 08:38:33 UTC
Vasily Melenchuk committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/24b5490cb0fd8de19415509fbf452874669106ad

tdf#104390: rtf import: init default font for entire state stack

It will be available in 7.4.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 17 Commit Notification 2022-03-22 13:29:05 UTC
Vasily Melenchuk committed a patch related to this issue.
It has been pushed to "libreoffice-7-3":

https://git.libreoffice.org/core/commit/07ab51a3ac3d2c2af417c950d095c1fba49ab2a9

tdf#104390: rtf import: init default font for entire state stack

It will be available in 7.3.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.