Created attachment 155019 [details]
noFontDefaults.docx: hand-modified to test the accuracy of some suspicious commits
In Word 2003 and 2016, the paragraph using a custom style with no parent uses program-defaults of Times New Roman 10pt font. In LO, this is currently using the Default-paragraph-style size of 32pt, and a hard-coded Calibri font.
The fontsize was broken by LO 4.3 commit 8766011bccfd0f12f8dd77d2f94eb16e2e8c3471
Author: Miklos Vajna
CommitDate: Wed Jan 22 16:21:51 2014 +0100
DOCX import: set document-level font size default based on default para style
This document contains
1.) no DocDefault information about sz (which is normal)
2.) the "Normal" paragraph style is marked as w:default=1 (which is normal) and has a w:sz defined.
3.) a "NoParent" paragraph style that has no w:sz defined.
There are a couple of things wrong with the regressive patch.
1.) although this matches what binary import format does, the entire premise seems to be false, as this document proves.
2.) m_pDefaultParaProps should never have a CHAR_HEIGHT property. That would be set in m_pDefaultCharProps.
The fontsize changed to Liberation Sans in LO 4.3 which based on the commit descriptions sounds like it is a valid change since the font metrics should be identical to TNR.
Author: Samuel Mehrbrodt
CommitDate: Wed Dec 4 05:06:50 2013 -0600
Prefer the Liberation fonts over Arial/Times
The new Writer template was supposed to use the Liberation fonts: http://nabble.documentfoundation.org/Default-Writer-Template-td4076271.html
So I changed the defaults to prefer them over their MS equivalents. When they are not available, they will be substituted as used.
This should not cause problems since the Liberation Fonts have the same metrics as Times, Arial and Courier New.
It broke in the change from TNR/Liberation-Sans to Calibri in LO 5.4 commits
Author: Mike Kaganski
Date: Tue Jun 6 16:19:31 2017 +0200
tdf#104450: Use Calibri; let LO to fallback to Carlito
Using Calibri will allow to keep originally intended font
on round-trip. If Calibri is absent on a system, LO will
fallback to Carlito for rendering, but keep original font
Author: Mike Kaganski
Date: Mon Jun 5 23:47:13 2017 +0300
tdf#108350: Use Carlito for DOCX import by default
In OOXML (i.e. Word since 2007), the default document font is Calibri
11 pt. If a document doesn't contain font information, we should assume
our metric-compatible equivalent Carlito to provide best layout match.
A unit test included.
An existing unit test (testN766487) was corrected to match the font
size that Word uses (11; was 12 which doesn't match Word's size).
Created attachment 155020 [details]
noFontDefaults.png: screenshot of Word 2016 showing TimesNewRoman 10pt.
For default fontname, the key differentiator between Mike's example document was that it consisted of only a document.xml file. The absence of styles.xml triggers the fallback to Calibri/11. The presence of styles.xml should trigger Times New Roman/10.
(In reply to Justin L from comment #2)
> The absence of styles.xml triggers the fallback to Calibri/11.
More specifically, it is the DocDefaults-rPrDefaults section that is required.
The proposed patch for this references bug 108350 instead of this bug report. So this report can focus on the fontsize.
Build ID: 4704acf63f4fed3a99fc95ff63c82eb5a9ae3908
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3;
Locale: ca-ES (ca_ES.UTF-8); UI-Language: en-US
I'll wait for LO 6.5 master before submitting this proposed fix at https://gerrit.libreoffice.org/81365
Justin Luth committed a patch related to this issue.
It has been pushed to "master":
tdf#128153 docx/VML: apply style properties to shape text
It will be available in 6.5.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:
Affected users are encouraged to test the fix and report feedback.