11-19-2021, 11:43 PM | #1 |
Guru
Posts: 677
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. |
01-06-2023, 11:50 PM | #2 | |
Wizard
Posts: 1,571
Karma: 11380098
Join Date: Aug 2010
Location: NE Oregon
Device: Kobo Sage, Pocketbook Era, Kobo Forma, Kindle Oasis 2
|
Quote:
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. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Calibre x Apple iBooks/Books interfacing / plugin | olerite | Development | 9 | Today 10:01 AM |
Troubleshooting Embedding font breaks font-family? | Calan | Amazon Kindle | 1 | 06-13-2020 12:48 PM |
How well does family sharing work for iBooks? | Nate the great | Apple Devices | 3 | 07-17-2015 10: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 03:09 AM |
Apple's iBooks 2, iBooks Author: Bids to own publishing's future | wannabee | News | 0 | 01-19-2012 08:33 PM |