Bug 164904 - Times New W1 font not replaced correctly
Summary: Times New W1 font not replaced correctly
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
24.8.0.3 release
Hardware: All All
: medium normal
Assignee: Miklos Vajna
URL:
Whiteboard: target:25.8.0
Keywords: bibisected, bisected, regression
Depends on:
Blocks: RTF-Paragraph
  Show dependency treegraph
 
Reported: 2025-01-28 22:44 UTC by Gabor Kelemen (allotropia)
Modified: 2025-01-30 10:21 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Example file from Word 2016 (42.53 KB, application/msword)
2025-01-28 22:44 UTC, Gabor Kelemen (allotropia)
Details
The document in Word and Writer master (71.58 KB, image/png)
2025-01-28 22:44 UTC, Gabor Kelemen (allotropia)
Details
The font substitution dialog in Word (9.74 KB, image/png)
2025-01-28 22:45 UTC, Gabor Kelemen (allotropia)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gabor Kelemen (allotropia) 2025-01-28 22:44:09 UTC
Created attachment 198824 [details]
Example file from Word 2016

Attached example file has a paragraph of text with "Times New (W1)" font.
In Word this font is replaced with plain TNR, but not in Writer, so the text is rendered as a bit longer.

1. Open attached file in Word and Writer
-> text is 3 lines in Word, but 3 and a bit more in Writer

Version: 25.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 43fc662520e5488cbeadd6eb60a24374a837dca4
CPU threads: 14; OS: Windows 10 X86_64 (build 19045); UI render: Skia/Raster; VCL: win
Locale: hu-HU (hu_HU); UI: en-US
Calc: threaded

Seems to work in 24.2 and older, started in 24.8 with:

https://git.libreoffice.org/core/+/91dc75b03defdc2faefde1822588dcc96ab9b145%5E%21

author	Miklos Vajna <vmiklos@collabora.com>	Fri Jul 19 16:11:33 2024 +0200
committer	Xisco Fauli <xiscofauli@libreoffice.org>	Tue Jul 23 14:25:15 2024 +0200

Related: tdf#162072 DOCX import: handle font family for characters

Adding CC to: Miklos Vajna
Comment 1 Gabor Kelemen (allotropia) 2025-01-28 22:44:37 UTC
Created attachment 198825 [details]
The document in Word and Writer master
Comment 2 Gabor Kelemen (allotropia) 2025-01-28 22:45:09 UTC
Created attachment 198826 [details]
The font substitution dialog in Word
Comment 3 Miklos Vajna 2025-01-29 08:26:23 UTC
This is an RTF file and the above commit was only tested with DOCX. Seems the untested "no font family is provided" case for RTF goes wrong and sets a font family, even if the RTF tokenizer wasn't updated to provide something like that. Let me see what can I do here.
Comment 4 Commit Notification 2025-01-30 10:19:01 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/7af540ddeb42a3a733f258a77e17c7ebb16d4571

tdf#164904 RTF import: fix unexpected CharFontFamily

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