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-16-2017, 10:11 AM   #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
Custom fonts for iBooks

I've got some ePubs with embedded fonts.
They work fine in the readers on my PC. And also work on my Kindle when I convert the ePub to AZW3. I don't have an Apple device to test iBooks, but was sent a screencap that shows the declared fonts aren't being applied.


I read this column: http://guidohenkel.com/2015/04/custom-fonts-in-ibooks/
Which says you need to include both this line:

<meta property="ibooks:specified-fonts">true</meta>

in the opf and an XML file com.apple.ibooks.display-options.xml

However, when I do either, ePubCheck complains that the tag is "not allowed" and the xml file has an "invalid file extension".

So is the advice correct at all? Or is there another trick to using embedded fonts on iBooks? Preferably one that ePubcheck approves of, though that's not strictly necessary.

My CSS has this:

Code:
@font-face {
    font-family: "Garamond Premr Pro";
    font-style: normal;
    font-weight: normal;
    src: url("../Fonts/GaramondPremrPro.otf");
}

body, div, dl, dt, dd, h1, h2, h3, h4, h5, h6, p, blockquote {
    font-family: "Garamond Premr Pro", serif;
    margin: 0;
    padding: 0;
    border-width: 0;
}
But text with the <p> tag appears to be in a generic serif font, not the embedded one.

Last edited by AlanHK; 11-17-2017 at 11:11 PM.
AlanHK is offline   Reply With Quote
Old 11-16-2017, 11:34 AM   #2
Nabodita
Connoisseur
Nabodita has never been to obedience school.Nabodita has never been to obedience school.Nabodita has never been to obedience school.Nabodita has never been to obedience school.Nabodita has never been to obedience school.Nabodita has never been to obedience school.Nabodita has never been to obedience school.Nabodita has never been to obedience school.Nabodita has never been to obedience school.Nabodita has never been to obedience school.Nabodita has never been to obedience school.
 
Nabodita's Avatar
 
Posts: 97
Karma: 44418
Join Date: Jul 2013
Location: Mostly in my own head!
Device: Kindle Fire, iPad
Quote:
Originally Posted by AlanHK View Post
I read this column: http://guidohenkel.com/2015/04/custom-fonts-in-ibooks/
Which says you need to include both this line:

<meta property="ibooks:specified-fonts">true</meta>

in the opf and an XML file com.apple.ibooks.display-options.xml
AFAIK, you don't need to add that line in the opf file. The xml file should be unmanifested.

The com.apple.ibooks.display-options.xml file is attached with this post. Place the xml file in the META-INF folder and iBooks will recognise the embedded fonts.

Cheers
Attached Files
File Type: xml com.apple.ibooks.display-options.xml (169 Bytes, 753 views)

Last edited by Nabodita; 11-16-2017 at 11:45 AM.
Nabodita is offline   Reply With Quote
Advert
Old 11-16-2017, 12:25 PM   #3
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
Quote:
Originally Posted by Nabodita View Post
AFAIK, you don't need to add that line in the opf file. The xml file should be unmanifested.

The com.apple.ibooks.display-options.xml file is attached with this post. Place the xml file in the META-INF folder and iBooks will recognise the embedded fonts.

Cheers
I don't see any way to do that in Sigil.
If I import the file, it puts it into a "Misc" folder.
Of course I could use a zip tool to do it.
I think Sigil will lose any unmanifested files if you edit the epub and resave it.

I'll see if it works in the Misc folder.

Last edited by AlanHK; 11-16-2017 at 12:47 PM.
AlanHK is offline   Reply With Quote
Old 11-16-2017, 12:41 PM   #4
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by AlanHK View Post
I don't see any way to do that in Sigil.
DiapDealer has written a dedicated plugin for this task.
Doitsu is offline   Reply With Quote
Old 11-16-2017, 01:26 PM   #5
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
Quote:
Originally Posted by Doitsu View Post
DiapDealer has written a dedicated plugin for this task.
Excellent.

Wish I'd known about it a year ago...

Also, this: https://github.com/JayPanoz/Soma/wik...to-embed-fonts
says you can do this with just a change to the OPF. Is that correct?

Quote:
inside the <package> tag:

prefix="ibooks: http://vocabulary.itunes.apple.com/rdf/ibooks/vocabulary-extensions-1.0/"

You should end up with something looking at least like this:

<package xmlns="http://www.idpf.org/2007/opf" prefix="ibooks: http://vocabulary.itunes.apple.com/rdf/ibooks/vocabulary-extensions-1.0/" unique-identifier="stuff" version="3.0">

Then, in <metadata>, add:

<meta property="ibooks:specified-fonts">true</meta>
AlanHK is offline   Reply With Quote
Advert
Old 11-16-2017, 05:16 PM   #6
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by AlanHK View Post
Also, this: https://github.com/JayPanoz/Soma/wik...to-embed-fonts
says you can do this with just a change to the OPF. Is that correct?
AFAIK, it should be sufficient to use the .opf entries that are mentioned in the linked Github post.
However, I don't know when Apple introduced these metadata entries. I.e., it might be necessary to include com.apple.ibooks.display-options.xml for older iBooks versions.
For more information, also see this post.
Doitsu is offline   Reply With Quote
Old 11-16-2017, 10:26 PM   #7
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
Quote:
Originally Posted by Doitsu View Post
AFAIK, it should be sufficient to use the .opf entries that are mentioned in the linked Github post.
However, I don't know when Apple introduced these metadata entries. I.e., it might be necessary to include com.apple.ibooks.display-options.xml for older iBooks versions.
For more information, also see this post.
According to that, you can use the OPF entries for EPUB3. For EPUB2, you need the XML file.

I always convert to EPUB3 if I'm making it for iBooks anyway, the TOC doesn't work properly with just EPUB2.
AlanHK is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PRS-T3 T3 fonts & custom fonts Phil_C Sony Reader Dev Corner 5 12-22-2013 02:34 PM
Embedded fonts in iBooks helenouchkaia ePub 1 01-05-2012 05:48 AM
Touch Fonts question (special characters in stock and custom fonts) levil Kobo Reader 20 09-23-2011 01:51 PM
embedded fonts in ibooks? Uluhara Apple Devices 3 06-04-2011 05:41 AM
Need help - measuring fonts in iBooks jharker ePub 3 11-13-2010 05:14 PM


All times are GMT -4. The time now is 12:32 AM.


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