Spec fonts with InDesign (and by hand)
Earlier this week, @snew_pleop asked the #eprdctn thread why fonts were not appearing as expected in iBooks. I wrote back, suggesting he check that the following is in the content.opf:
I also mentioned that InDesign doesn’t write that line into the content.opf on export, so it needs to be included manually.
Before you could say zapf dingbat, @amarie tweeted that InDesign does, in fact, include that squirrelly font line.
In #eprdctn, it’s common to think you’re crazy when something you did successfully yesterday completely breaks down today. But I know that I add that meta property on a regular basis, so I wasn’t sure what the story was.
My confusion didn’t last long. I quickly realized that since I don’t often embed fonts (why don’t I? partly a throwback to when embedding wasn’t widely supported, but mostly as an acknowledgment of the power of the ultimate font chooser: the person reading the book), my content.opf lacks the needed metadata.
Here’s how the Export-to-EPUB screen looks when I export:
I leave the Include Embeddable Fonts box unchecked.
My InDesign export looks to see if I’ve embedded fonts. I haven’t, so there’s no ibooks-specific font metadata in the content.opf:
I insert it, like so:
I often use my own CSS. The option for this is under Additional CSS in the Export to EPUB screenshot above. I’ve developed a clean, simple CSS that I use for many projects; it’s easily mapped to InDesign documents that I create or that a client provides for EPUB creation. (I’ll post about using custom CSS soon.)
Here’s the CSS for the standard p tag:
Sometimes I spec a device-specific font set (iBooks includes Gill Sans):
Even though I’m not including an embedded font, I am spec’ing a font family, so the ibooks-specific font meta property needs to be present. Otherwise, ibooks will do what it wants with the <p> and <h1>, <h2>, etc. tags.
So, when you export, if you check Include Embeddable Fonts, InDesign will write the all-important ibooks-specific line into your content.opf. If you leave it unchecked, remember to add it after export, or be ready for ibooks to decide who your book should look.