View Full Version : Sans-serif fonts and iBooks


Adjust
09-27-2010, 08:01 PM
Has anyone come up with an alternative work a round for sans-serif fonts not being supported within the p., div, and span classes since this post on Liz's blog?

http://www.pigsgourdsandwikis.com/2010/06/apple-kills-fonts-in-ibooks-strikes.html

Since InDesign exports out Xhtml using all these class tags, What would be the correct method of changing them so the Sans-Serif font I want in my heading displays as sans-serif in iBooks, like it does everywhere else...

Keeping in mind I do not want to use the default H1, H2, H3 heading levels, unless, of course, I can find/change Paragraph names to h1, h2, h3 while keeping my defined formatting.

GRRRRRRRRR Apple iBooks GRRRRRRR

Thanks

capidamonte
09-28-2010, 05:45 PM
Add some other tag to your <p> tags.

I'm using <p><abbr>ParagraphContent</abbr></p>.

I add the font styling to abbr and the layout styling to p.

F* Apple.

georg3200
09-30-2010, 11:34 AM
Doesn't the iPad have global settings to change the font?
I was of the opinion, that when you use a serif-font like "georgia" the complete text is in georgia (a serif-font). And if you use "verdana" completely everything is in sans-serif?!?

We could not tell different parts of the text that they should be sans-serif while other parts should be in serif. Are we wrong and it is possible?
Maybe we used a wrong style: font-family:serif; ???

So, does it work, when I use abbr?

Adjust
10-03-2010, 08:14 PM
Add some other tag to your <p> tags.

I'm using <p><abbr>ParagraphContent</abbr></p>.

I add the font styling to abbr and the layout styling to p.

F* Apple.

Gotcha, thanks...
I ended up using the <samp></samp> tags. Works a treat for getting at pesky first few words in the first paragraph after a heading to display sans-serif.

So I guess you could use any redundant/not often used tags to compensate for Apple's blatant disregard to the epub standards.

ibillabong
01-17-2013, 12:23 PM
For those out there still struggling to get fonts to work on these tags, your ePub is missing an com.apple.ibooks.display-options.xml file in the meta-inf folder.

Add this to the file:
<?xml version="1.0" encoding="UTF-8"?>
<display_options>
<platform name="*">
<option name="specified-fonts">true</option>
</platform>
</display_options>

Toxaris
01-18-2013, 02:12 AM
Why do you resurrect such an old thread? The xml file you post is posted on several other places on the forum.

Adjust
01-18-2013, 02:56 AM
I guess because it's still relevant... i.e. sans serif does not display unless wrapped in a <samp> tag. Without embedding fonts

Toxaris
01-18-2013, 04:30 AM
It should no longer be relevant and the posting is not the solution. Resurrection is fine, if it contributes to the problem.
As I understood from Liz, the iBooks app does work now.

Adjust
01-18-2013, 04:37 AM
Pretty sure it breaks when you select another font from the list other than the default .
Which is why I still have to still use the <samp>

JSWolf
01-18-2013, 02:51 PM
iBooks in 2010 is not the same as iBooks in 2012. Things have been fixed and things have been changed. Unless you know for sure that what's talked about in 2010 is still relevent today, please leave it be.

Adjust
01-18-2013, 05:08 PM
So you're telling me that it doesn't break when you switch fonts?

Also I'm not the one who brought it back.

JSWolf
01-18-2013, 05:28 PM
So you're telling me that it doesn't break when you switch fonts?

Also I'm not the one who brought it back.

I have no idea if it does or does not break when fonts are switched. But that's not the point. The point is, do you know since you resurrected this thread?

dgatwood
01-18-2013, 06:25 PM
For sure, "specified-fonts" is still required. It distinguishes an iBook that has actually been tested and verified to look acceptable on iBooks from a file that has not. The assumption is that old books are much, much more likely to be broken. Thus, in EPUB books that lack that addition, all font specifications are just plain ignored.

The workaround where you have to add a tag inside the paragraph tag, however, is no longer required. It is a crude way to add specificity so that iBooks knows that some special piece of content should not change fonts along with the body text, but it is not a very good way. :)

Adjust
01-18-2013, 06:45 PM
since you resurrected this thread?

Go back and take a look at the dates... I DIDN'T bring this back... But as it turns out, maybe it needed to be.

ibillabong
01-25-2013, 03:37 PM
Hi all - Sorry to offend!

The reason I added my post was because I searched for an answer to this question, and found this board. Whether it's old or not, it's still shows up in searches (like searching programming help from 2005 can still be helpful).

The 2013 beta version of iBooks I have access to STILL has this problem. Adding the display-options xml file FIXES the problem. Let me also add that "samp" is not needed if specified fonts is true, so this fixes incorrect information originally posted in 2010. And samp is bad code practice.

Also - there is not a single reference to the display-options xml in this thread, so perhaps it should have been added (which I just did).

Adjust
01-25-2013, 05:21 PM
So will adding this code fix the titles without any embeded fonts fix the need for the samp code?

For example I do not embed any fonts, due to font license restrictions.

ibillabong
01-26-2013, 05:11 PM
Ah, I see Adjust.

I presume that you are using iOS system fonts then? This will work even if you don't have any embedded fonts, BUT the fonts referenced must match the font name exactly as listed on iosfonts.com

dgatwood
01-26-2013, 07:31 PM
Ah, I see Adjust.

I presume that you are using iOS system fonts then? This will work even if you don't have any embedded fonts, BUT the fonts referenced must match the font name exactly as listed on iosfonts.com

You can also use a generic font family name, e.g. serif, sans-serif, cursive, fantasy, and monospace. And AFAIK, iBooks handles font fallback correctly, so you can specify multiple fonts in order of preference, ending with a generic font family name, and iBooks should do the right thing.