Italics in Word Export

Everything related to our flagship word processor.
Post Reply
ToddO
Posts: 17
Joined: 2015-10-18 14:25:32

Italics in Word Export

Post by ToddO » 2015-10-18 14:36:32

Hi,

When I export to Word, or open an rtf in word, I've noticed something strange with italics. It seems that in Word, any text that was in italics appears in the italicized font with a slanted faux-italics (a mathematical slant, or pseudo-italics) applied in addition to the italicized typeface. (At least when opened in Word 2011 or LibreOffice 5.0.2) The result is a very "slanty" italics.

In other words, applying italics in NWP results in the export specifying say Times-Italic, with a geometric italic applied on top of that.

This is not a huge deal, as I usually open the file in Word, use the style panel to select all italicized text, and then just apply the normal italics.

But, Is there a way to set this without needing to access Word after export?

dshan
Posts: 333
Joined: 2003-11-21 19:25:28
Location: Sydney, Australia

Re: Italics in Word Export

Post by dshan » 2015-10-19 15:20:55

How do you do the export from NWP to Word format .doc files? Are you using the File>Save As... File Format: [Microsoft Word Format] command in NWP? This does not create an actual Microsoft Word binary format file as you would expect, it creates an RTF format file with a .doc file extension. An RTF file in disguise if you like. Word handles such files the same way it handles files with .rtf extensions - it translates them into Word format when it opens them (likely creating this weird italic translation effect in the process, just as it does with .rtf files).

If you want to create real binary Word (.doc or .docx) files from NWP use the File>Export As... File Format: [Microsoft Word Format (binary .doc)] or [Microsoft Word XML (DOCX / Office 2007 Open XML)] command instead. This will hopefully avoid the italics translation problem.

User avatar
martin
Official Nisus Person
Posts: 4361
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: Italics in Word Export

Post by martin » 2015-10-19 16:19:46

Although trying different file formats is a good idea to workaround compatibility problems, you are going to see the best fidelity between Nisus Writer and Word using the RTF file format.

As to the original problem, where you see a Nisus Writer document's text appear to be too italicized in Word, this seems to be a bug in Word. I was able to reproduce the problem with Times New Roman, but it also just disappeared by itself, after I'd taken no actions that should affect the issue.

I had created a test document in Nisus Writer 2.1.2, used the italicized font face of Times New Roman, and saved it as RTF. I then opened the document in Word 2011, and as you describe, the text appears too italicized: both the italics font face and a faux italic slanting were in force on screen. Closing and reopening the document did not clear the problem. However, after doing some fiddling around in another test document, I reopened the original problematic test document, and the unwanted slanting was gone! After that I was no longer able to observe the unwanted slanting in any documents I opened.

However, if I quit and relaunch Word, the problem returns. But sure enough, after fiddling around using Word, the oddity cleared itself again and documents from Nisus Writer again imported properly, without the unwanted slanting.

Right now I'm not sure exactly what kind of fiddling in Word clears the error until the next time it is relaunched. I was just doing normal things like typing text, changing the font, and applying italics. Perhaps my actions aren't the trigger, and the problem clears itself randomly, or after some delay has expired? Perhaps Word needs time to (re)build a font database. I'm not sure.

ToddO
Posts: 17
Joined: 2015-10-18 14:25:32

Re: Italics in Word Export

Post by ToddO » 2015-10-19 16:41:43

Thanks to you both for your replies. I've tried "saving as" and exporting as a doc and docx, and the issue appears no matter the route.

Interesting that it disappeared for you, Martin, but thanks for taking a look. Indeed, as you found, Word applied a forced italics to the italicized font face instead of using the family and applying italics. Easy enough to correct in Word, I suppose. Thanks again.

exegete77
Posts: 184
Joined: 2007-09-20 17:58:56

Re: Italics in Word Export

Post by exegete77 » 2015-10-19 20:08:53

Is it only Times New Roman? That font has wacky behavior in many ways (in many situations and various computers; Times New Roman is not always Times New Roman). Perhaps a different font will not have that problem. Just a thought
iMac 21.5” / MBP 13” Retina
Mac user since 1990

ToddO
Posts: 17
Joined: 2015-10-18 14:25:32

Re: Italics in Word Export

Post by ToddO » 2015-10-20 00:46:44

Unfortunately, the font does not seem to matter.

User avatar
martin
Official Nisus Person
Posts: 4361
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: Italics in Word Export

Post by martin » 2015-10-20 09:46:36

I just retested on another Mac, and now I can't reproduce the problem at all. Any RTF document I save from NWP and open in Word is italicized correctly, even if I relaunch Word. On the Mac where I reproduced the issue yesterday, the font did matter. For example, in my testing Times New Roman exhibited the problem, but Helvetica did not.

I can only speculate that there is some kind of intermittent bug in Word here.

I'm not sure what to suggest, since the issue randomly cleared itself on the problematic Mac (as I described earlier). If the problem only affected certain fonts, I would have suggested that you try reinstalling one of those fonts. But since all your fonts seem to be affected, that's unlikely to help. Maybe you could try clearing your OSX font caches? That's unfortunately also unlikely to help.

ToddO
Posts: 17
Joined: 2015-10-18 14:25:32

Re: Italics in Word Export

Post by ToddO » 2015-10-26 16:53:15

You know, I stand corrected -- the font does seem to matter in a way. If the font does not have an italic version, it does not double-italicize.

If you crack open the rtf in something like TextWrangler, and compare it to an rtf made in TextEdit (which does not show the issue) you can see a difference in the formatting of the italicized text:

Nisus shows the following inline formatting: {\f1\i text that is italicized shows here}
In the header info, it defines "f1" as: {\f1 \fnil \fcharset77 ChaparralPro-Italic{\*\falt Chaparral Pro};}
So, based on the "\f1\i" definition right before the text, it does look like it is being defined twice, and Word is not sliding to the \falt

Text Edit's formatting is simpler, of course, because of the lack of styles: \i text that is italicized shows here \i0
However, it seems to come across to Word just fine.

Is there anything might have done that would cause the issue "\f1\i" above, rather than it just keeping the base font, or is that normal for the behind-the-scenes nisus rtf formatting?

(Of course, it does look like the above is avoided simply by exporting with fonts that don't have italic faces.)

User avatar
martin
Official Nisus Person
Posts: 4361
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: Italics in Word Export

Post by martin » 2015-10-30 16:41:34

That is some good RTF dissection you've done Todd! Getting into it:
ToddO wrote:Nisus shows the following inline formatting: {\f1\i text that is italicized shows here}
In the header info, it defines "f1" as: {\f1 \fnil \fcharset77 ChaparralPro-Italic{\*\falt Chaparral Pro};}
What you've observed here is that NWP declares separate font entries in the font table for each font face used in the document, eg: TimesNewRomanPSMT and TimesNewRomanPS-ItalicMT are two separate entries.

NWP has been doing this for a long time. I looked into the motivation behind the choice, and it seems this was originally done to improve fidelity when importing RTF documents into InDesign. Apparently without these kinds of face-specific font table entries, InDesign would not pick up italics and bold. I don't know if that's still the case.
So, based on the "\f1\i" definition right before the text, it does look like it is being defined twice, and Word is not sliding to the \falt
Word should resolve the two sources of italicization into a single proper italic typeface, instead of yielding this errant super-slanty italics. In general this is how formatting in RTF is emitted: any formatting applied to text in the document is emitted using the final display formatting (eg: after taking into account stylesheets), and the app importing the RTF has to reduce that back into its underlying base components.

But obviously there's something wrong with Word 2011 here. I can still reproduce the problem intermittently. If I leave Word running for a time, and reopen the exact same RTF file, the problem goes away by itself. And for what it's worth, Word 2008 doesn't have the problem at all. My guess is that Word 2011 is mismanaging some internal font face cache. If the RTF is opened before Word realizes that some font has a proper italics typeface, you get the unwanted slanting. After Word resolves all typefaces, it knows that it doesn't need to use a faux italic slanting.

We'll have to do some testing, to see if InDesign handles this properly now, without the need for separate RTF font table entries for each face. Even if it doesn't, Word compatibility is more important than InDesign, so perhaps a change in NWP is warranted. Still, this does appear to be a bug in Word. It would be a good idea to report it to Microsoft.

ToddO
Posts: 17
Joined: 2015-10-18 14:25:32

Re: Italics in Word Export

Post by ToddO » 2015-10-31 12:54:50

Thanks for all your effort, Martin.

Interesting info that is good to know, and great support form you, as always.

ToddO
Posts: 17
Joined: 2015-10-18 14:25:32

Re: Italics in Word Export

Post by ToddO » 2016-01-18 12:59:51

FWIW, this does not seem to occur in Word 2016.

If you're out there, Martin, and I'm sure you are, it appears you're right about this being a bug in Word 2011.

User avatar
martin
Official Nisus Person
Posts: 4361
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: Italics in Word Export

Post by martin » 2016-01-18 16:46:19

That's good news. I'm glad Microsoft got this fixed, so Word 2011 is apparently the only version intermittently affected by this issue.
Thank you for the update Todd.

Post Reply