Skip to main content
Known Participant
March 3, 2010
Question

extracting italics in XML

  • March 3, 2010
  • 1 reply
  • 1674 views

Hi All,

My goal is to have italics tagged in my final XML export.  I'm wondering a couple of things:

When an italic font (e.g., Frutiger Italic) is placed in InDesign, does InDesign mark this in the document  in any way as an Italic font, or is it just text?  That is, I'm looking for a flag or a hook that I can use to indicate in the final XML that this should be italicized text.

What are my options?

Any help would be appreciated...

Thanks,

ThisGuy

This topic has been closed for replies.

1 reply

Jongware
Community Expert
Community Expert
March 3, 2010
.. does InDesign mark this in the document  in any way as an Italic font? ..

Alas -- no.

But a perfectly good reason for Adobe not to have done this, is that you can have a Light Italic, Regular Italic, Semibold Italic, Bold Italic, and Black Italic -- all in the same font! Eat that, Microsoft Word! (More in general: the entire Windows font setup is rigged from the start to only "allow" Bold, Italic, and Bold Italic font variants.)

You can still use search-and-replace, to search for an italic variant of your current font and replace it with an XML tag -- CS4 allows a tag in the Replace field (but not in the Find field!). But you have to specify the exact name of your current italic variant(s).

For Times New Roman and Minion, italics are simply called "Italic"; but for Helvetica, it's called "Oblique", and that's what you have to search for. Searching for "Helvetica Italic" does not work. For ITC Garamond Light, it's called "Light Italic"; and for Myriad Pro, well, myriads of its variants are called "weight-such-and-such Italic".

A document has a property "fonts", which lists all used fonts, so perhaps you could loop over this and determine by the names in there which ones to tag; for example, if the name contains "Italic", "Oblique", "Slanted". Be aware that Frutiger and Univers use names like "46 Light Italic", so it may not be a simple one-word string.

(It also leads to another interesting point: if you encounter a "Bold Italic", how do you know if it's been used as a simple local attribute "Italic" in an otherwide Bold text -- such as a heading --, or if it's actually been used to mark Bold Italic text inside regular text? In the latter case, you would need an XML element "Bold Italic" , in the former just plain "Italic". Perhaps you ought to check the default font of the paragraph style ...)

Known Participant
March 4, 2010

Jongware,

Right...the benefit of font variations working well is the bane of trying to create a good extract.  I may have to reduce the number of fonts to one simple Italic style and conduct a find and replace operation. It just takes more time and effort.  I'll post back here if I come up with a brilliant work-around.

Thanks as always for your thorough responses.

-ThisGuy

Jongware
Community Expert
Community Expert
March 4, 2010
..  to one simple Italic style ...

Oh wait! I forgot all about character styles!

Putting all your different italics into character styles might be a good idea. If you only and exclusively use character styles (which is a good habit!), you can check their names, and devise a system of your own -- for example, the style defining Univers 55 Oblique could be simply named "Italic (Univers)"; for ITC Stone Serif Semibold Italic, it would be "Italic (Stone Serif Semibold)" -- and so on.