Bug 107801 - EDITING: DOCX: w:kern not exported
Summary: EDITING: DOCX: w:kern not exported
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.4.0.0.alpha1+
Hardware: All All
: medium enhancement
Assignee: Justin L
URL:
Whiteboard: target:5.4.0
Keywords: bisected
Depends on:
Blocks:
 
Reported: 2017-05-12 14:51 UTC by Telesto
Modified: 2017-05-18 16:44 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Example file (12.00 KB, application/odt)
2017-05-12 14:51 UTC, Telesto
Details
KERN_disabled.docx: test file - DocDefault normally does not enable kerning in MSWord. (11.56 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2017-05-16 06:00 UTC, Justin L
Details
KERN_DocDefault.docx: test file - this one has kern enabled as a DocDefault. (11.58 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2017-05-16 06:02 UTC, Justin L
Details
KERN_DocDefault_disabledDefStyle.docx: test file - default style explicitly disables kerning. (11.62 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2017-05-16 06:08 UTC, Justin L
Details
KERN_enabledDefStyle.docx: test file - default style changed to enable kerning (11.59 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2017-05-16 06:10 UTC, Justin L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2017-05-12 14:51:33 UTC
Description:
The font spacing differs between ODT and DOCX

Steps to Reproduce:
1. Open the attached file
2. Save it as DOCX
3. Open the DOCX in LibreOffice
4. Open the ODT
5. Switch back and forward

Actual Results:  
The font spacing is not the same with a DOCX and the ODT file

Expected Results:
Font spacing should the same


Reproducible: Always

User Profile Reset: No

Additional Info:
Found in
Version: 5.4.0.0.alpha1+
Build ID: 970b431f1a7b6b96c4c9536657ce4fe9d8f5b585
CPU threads: 4; OS: Windows 6.2; UI render: default; 
TinderBox: Win-x86@62-TDF, Branch:MASTER, Time: 2017-05-11_23:07:53
Locale: en-US (nl_NL); Calc: single

but not in
Versie: 4.4.6.3 
Build ID: e8938fd3328e95dcf59dd64e7facd2c7d67c704d
Locale: nl_NL


User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0
Comment 1 Telesto 2017-05-12 14:51:49 UTC
Created attachment 133266 [details]
Example file
Comment 2 Justin L 2017-05-13 06:11:35 UTC
confirmed with Ubuntu 16.04 / bibisect54. 

author Miklos Vajna 2017-03-30 07:27:45 (GMT)
commit 38b0c24fa5cbb4246e03d77ac022dfdc9fdede03
Related: tdf#105454 DOCX import: fix unwanted enabled-by-default kerning
Similar to DOC, DOCX doesn't enable kerning by default.

Not a regression, but an uncovered missing feature (so not CCing Miklos). It looks like we aren't exporting kerning for docx (but we do for .doc).  [See default paragraph style - Position - Pair kerning].
Comment 3 Justin L 2017-05-13 10:39:03 UTC Comment hidden (obsolete)
Comment 4 Justin L 2017-05-13 14:25:21 UTC
Proposed fix at https://gerrit.libreoffice.org/#/c/37574/
Comment 5 Justin L 2017-05-16 06:00:04 UTC
Created attachment 133346 [details]
KERN_disabled.docx: test file - DocDefault normally does not enable kerning in MSWord.

These test files are meant for round-trip testing.  Created in MSWord 2013. This first one is the most basic - kerning is only defined in a kern style and directly applied character formatting.
Comment 6 Justin L 2017-05-16 06:02:34 UTC
Created attachment 133347 [details]
KERN_DocDefault.docx: test file - this one has kern enabled as a DocDefault.

The second one enables kerning as a document default, but doesn't touch the Normal/Default property style.  (So, default style should match the docDefault.)
Comment 7 Justin L 2017-05-16 06:08:32 UTC
Created attachment 133348 [details]
KERN_DocDefault_disabledDefStyle.docx: test file - default style explicitly disables kerning.

This third test is the strangest.  It sets a DocDefault to enable kerning, but explicitly turns it off in the default style.
Comment 8 Justin L 2017-05-16 06:10:11 UTC
Created attachment 133349 [details]
KERN_enabledDefStyle.docx: test file - default style changed to enable kerning

This fourth test is the most normal situation.  No DocDefault is defined (kerning is off), but the default style enables kerning.
Comment 9 Commit Notification 2017-05-16 12:55:47 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=c7e31f492140a064d9c152583bda3d111c8bee83

tdf#107801 docx export: support w:kern

It will be available in 5.4.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 10 Justin L 2017-05-16 13:20:46 UTC
(In reply to Justin L from comment #3)
> A small problem arises because Writer's defaultDoc settings have
> CharAutoKern always enabled. ::OutputDefaultItem thus sets this, and Word
> then auto-enables kern.  However, ::OutputDefaultItem is a new-ish function
> (Oct 2013 commit 62ceeb1d1a0ff32e1be615f78da796aa13aaa06c), so excluding
> this from the written default doc properties is probably fine.

This paragraph appears to be completely incorrect. I was unable to reproduce this concern, so it was probably a result of bad development code.