Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 11-19-2021, 10:43 PM   #1
AlanHK
Guru
AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.
 
AlanHK's Avatar
 
Posts: 668
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
Apple Books (iBooks) font-family gotcha

I know that to display embedded fonts in (i)Books on Apple you need to add
com.apple.ibooks.display-options.xml to epub2 or insert
<meta property="ibooks:specified-fonts">true</meta>
in the OPF for epub3.

However, I found this is also necessary even if you are just using system fonts, like
.sans {font-family:sans-serif;}

I had some text like this, and and that worked fine:

<p><b class="sans">TEXT IN SANS</b></p>


But if I wrapped several paragraphs in divs:

<div class="sans">
<p> Blah....</p><p> Blah....</p>
</div>


The font was ignored in iBooks.

I also had a few paragraphs set in monospace:

p.digits{text-align:center;font-weight:bold;margin:1em 1em;font-family:monospace;font-size:1.1em;}

<p class="digits">12345</p>
These displayed correctly most of the time, but in one chapter they were in the default serif, though still centred and bold.

In all of the above, the text showed the intended font in Sigil, and also on Kindle after conversion to AZW.

After adding the XML file and loading to iBooks, font display is now correct in all cases.
(In Sigil, use this plugin: https://www.mobileread.com/forums/sh...d.php?t=272241 )

So, the moral is, just always include Apple's font enabling code in every ePub if it ever might be loaded onto an Apple device.
AlanHK is offline   Reply With Quote
Old 01-06-2023, 10:50 PM   #2
graycyn
Wizard
graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.
 
Posts: 1,496
Karma: 11250344
Join Date: Aug 2010
Location: NE Oregon
Device: Kobo Sage, Forma, Kindle Oasis 2, Sony PRS-T2
Quote:
Originally Posted by AlanHK View Post
I know that to display embedded fonts in (i)Books on Apple you need to add
com.apple.ibooks.display-options.xml to epub2 or insert
<meta property="ibooks:specified-fonts">true</meta>
in the OPF for epub3.
I was encountering the same issue tonight with an epub3 I loaded into Apple Books on my iPad Air and it was driving me CRAZY, because font-family: sans-serif: was not working in just ONE H1 heading but fine in all the others!

The same epub3 that was misbehaving in Apple Books was fine on my Kobo, no problems sent to Kindle and likewise in assorted Android apps. (There were no embedded fonts.)

However, I'm slightly confused as to what exactly is necessary to add in epub3. It sounds like, from what you said above, that I only need the meta property? And in fact, when I added the meta property to the OPF, the problem promptly disappeared!

So HUGE THANKS!

But do I *also* need to add the com.apple.ibooks.display-options.xml file, or is that only necessary with epub2? I've no objection to adding it, but if it's not actually necessary for epub3, then....


NOTE: I did have to find the prefix declaration: prefix="ibooks: http://vocabulary.itunes.apple.com/rdf/ibooks/vocabulary-extensions-1.0/" (https://www.mobileread.com/forums/sh...51&postcount=2), and add that to the OPF in order for the epub3 to pass ePubCheck. FWIW in case that tidbit helps someone else down the line.
graycyn is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre x Apple iBooks/Books interfacing / plugin olerite Development 8 06-23-2020 08:55 AM
Troubleshooting Embedding font breaks font-family? Calan Amazon Kindle 1 06-13-2020 11:48 AM
How well does family sharing work for iBooks? Nate the great Apple Devices 3 07-17-2015 09:26 AM
Free (Kindle/Kobo/iBooks/Sony) Leaving Before It's Over [Literary Family Drama] ATDrake Deals and Resources (No Self-Promotion or Affiliate Links) 3 04-18-2012 02:09 AM
Apple's iBooks 2, iBooks Author: Bids to own publishing's future wannabee News 0 01-19-2012 07:33 PM


All times are GMT -4. The time now is 04:06 PM.


MobileRead.com is a privately owned, operated and funded community.