Mobileread
Font embedding and app-reader compatibility
#1  vermillion6 06-28-2020, 12:36 PM
Hello,

I've been trying to read an epub I created w/ Calibre that has an embedded font (Noto mono - an open monospaced font from Google) in an iPad device but it won't see the embedded font. It only displays fonts installed originally in the device, e.g.
Athelas, Charter, Georgia, Iowan, Palatino, San Francisco, New York, Seravek, Times New Roman

Is there sth else I can do with the epub while I create it w/ Calibre so that iBooks (or/and possibly other devices) can read the embedded font?

((( This is the procedure I follow so far. It seems to work w/ various reader apps for android like kobo, pocketbook or pc readers like Adobe Digital Editions.
I drag the Word docx file (the book) inside Calibre
I press Convert Books
In the Look & Feel tab -> Embed Font Family -> I choose the font I want to embed
then press ok
then save the book
then load the epub in iPad through mail )))

I've been told that using embedded fonts in epub is a hassle and that it may result in some distributors stripping the embedded font from the epub completely. I can't imagine what will happen then. Will some other monospace font be loaded into place? Or just some other random font that'll mess up the book form completely?
It's very important for me to have the book displayed in a monospaced font (any monospaced really) as it has a specific form that must be kept (like code but not exactly). The only reason I decided to use the embedded method is to have the epub presented in the way that I want w/ some major distributors like kindle, kobo, iBooks, Barnes & Noble. So far only the kobo app works ok (with or w/out embedded), the kindle app works only if I embed, Barnes and Noble is a mystery (not available in my country), and iBooks just doesn't see the embedded font.

I'm not a professional programmer, so all this seems confusing to say the least.
Any ideas on how to get the epub to display properly to most major distributors? In your professional opinion is it better to embed or not? (so as to get any device to display it in a monospaced font)

So sorry for the long post

p.s. this is part of the code in the stylesheet file that calibre creates:

.block_25 {
color: black;
display: block;
font-family: serif;
font-size: 1em;
line-height: 1.15;
text-align: justify;
padding: 0;
margin: 0
}
.calibre {
color: #365F91;
display: block;
font-family: "Noto Mono", monospace;
font-size: 0.625em;
padding-left: 0;
padding-right: 0;
margin: 0 5pt
}

and this is what the page_styles file looks like:

@page {
margin-bottom: 5pt;
margin-top: 5pt
}
@font-face {
font-family: "Noto Mono";
panose-1: 2 11 6 9 3 8 4 2 2 4;
src: url(fonts/Noto-Mono.ttf)
}
Reply 

#2  thiago.eec 06-28-2020, 03:56 PM
Quote vermillion6
Hello,

I've been trying to read an epub I created w/ Calibre that has an embedded font (Noto mono - an open monospaced font from Google) in an iPad device but it won't see the embedded font. It only displays fonts installed originally in the device, e.g.
Athelas, Charter, Georgia, Iowan, Palatino, San Francisco, New York, Seravek, Times New Roman

Is there sth else I can do with the epub while I create it w/ Calibre so that iBooks (or/and possibly other devices) can read the embedded font?

((( This is the procedure I follow so far. It seems to work w/ various reader apps for android like kobo, pocketbook or pc readers like Adobe Digital Editions.
I drag the Word docx file (the book) inside Calibre
I press Convert Books
In the Look & Feel tab -> Embed Font Family -> I choose the font I want to embed
then press ok
then save the book
then load the epub in iPad through mail )))

I've been told that using embedded fonts in epub is a hassle and that it may result in some distributors stripping the embedded font from the epub completely. I can't imagine what will happen then. Will some other monospace font be loaded into place? Or just some other random font that'll mess up the book form completely?
It's very important for me to have the book displayed in a monospaced font (any monospaced really) as it has a specific form that must be kept (like code but not exactly). The only reason I decided to use the embedded method is to have the epub presented in the way that I want w/ some major distributors like kindle, kobo, iBooks, Barnes & Noble. So far only the kobo app works ok (with or w/out embedded), the kindle app works only if I embed, Barnes and Noble is a mystery (not available in my country), and iBooks just doesn't see the embedded font.

I'm not a professional programmer, so all this seems confusing to say the least.
Any ideas on how to get the epub to display properly to most major distributors? In your professional opinion is it better to embed or not? (so as to get any device to display it in a monospaced font)

So sorry for the long post

p.s. this is part of the code in the stylesheet file that calibre creates:

.block_25 {
color: black;
display: block;
font-family: serif;
font-size: 1em;
line-height: 1.15;
text-align: justify;
padding: 0;
margin: 0
}
.calibre {
color: #365F91;
display: block;
font-family: "Noto Mono", monospace;
font-size: 0.625em;
padding-left: 0;
padding-right: 0;
margin: 0 5pt
}

and this is what the page_styles file looks like:

@page {
margin-bottom: 5pt;
margin-top: 5pt
}
@font-face {
font-family: "Noto Mono";
panose-1: 2 11 6 9 3 8 4 2 2 4;
src: url(fonts/Noto-Mono.ttf)
}
I suppose you are creating an EPUB2. In that case, just add the attached file to the META-INF folder of your EPUB file. This folder is the same where your OPF file is located.

This extra step is needed for iBooks, but not for any other Reader that I know of.
[xml] com.apple.ibooks.display-options.xml (160 Bytes, 29 views)
Reply 

#3  vermillion6 06-29-2020, 05:09 AM
Thanks for the reply. I've got a few more questions

"I suppose you are creating an EPUB2."
Is the epub3 a better solution for embedded fonts?

"...just add the attached file to the META-INF folder of your EPUB file."
This folder only contains a single file: container.xml

"This folder is the same where your OPF file is located."
the only opf file I could locate is in the main folder, not in the meta-inf one: content.opf

Would I have to unzip the epub file, then add the file you're suggesting and then rezip the files in epub form?
or just insert the attached file in calibre?

Thank you very much in advance
Reply 

#4  thiago.eec 06-29-2020, 08:17 AM
Quote vermillion6
"I suppose you are creating an EPUB2."
Is the epub3 a better solution for embedded fonts?
No. Regarding the ability to use embedded fonts, it doesn't matter if 2 or 3.
But, if you use EPUB3, you don't need this XML file. You just have to edit the OPF file, like this:

Code
<?xml version='1.0' encoding='utf-8'?>
<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="isbn-id" prefix="ibooks: http://vocabulary.itunes.apple.com/rdf/ibooks/vocabulary-extensions-1.0/ a11y: http://www.idpf.org/epub/vocab/package/a11y/#" xml:lang="pt-BR"> <metadata xmlns:dc="http://purl.org/dc/elements/1.1/"> <meta property="ibooks:specified-fonts">true</meta> ...
Remember to add both the prefix and the meta property

Quote vermillion6
"...just add the attached file to the META-INF folder of your EPUB file."
This folder only contains a single file: container.xml

"This folder is the same where your OPF file is located."
the only opf file I could locate is in the main folder, not in the meta-inf one: content.opf
Sorry. My mistake. Is the same folder where the "container.xml" is located.

Quote vermillion6
Would I have to unzip the epub file, then add the file you're suggesting and then rezip the files in epub form?
or just insert the attached file in calibre?
No need to unzip. Just add it via calibre.
Reply 

#5  JSWolf 06-29-2020, 08:24 AM
Quote thiago.eec
No. Regarding the ability to use embedded fonts, it doesn't matter if 2 or 3.
But, if you use EPUB3, you don't need this XML file. You just have to edit the OPF file, like this:

Code
<?xml version='1.0' encoding='utf-8'?>
<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="isbn-id" prefix="ibooks: http://vocabulary.itunes.apple.com/rdf/ibooks/vocabulary-extensions-1.0/ a11y: http://www.idpf.org/epub/vocab/package/a11y/#" xml:lang="pt-BR"> <metadata xmlns:dc="http://purl.org/dc/elements/1.1/"> <meta property="ibooks:specified-fonts">true</meta> ...
Remember to add both the prefix and the meta property



Sorry. My mistake. Is the same folder where the "container.xml" is located.



No need to unzip. Just add it via calibre.
Does the XML file in Meta-Inf work with ePub3 in Books?
Reply 

#6  thiago.eec 06-29-2020, 09:24 AM
Quote JSWolf
Does the XML file in Meta-Inf work with ePub3 in Books?
To be honest, I don't know for sure. I think it might.
But, since the iBooks is EPUB3 aware, using the OPF meta property seems more reasonable. No need for an extra file. And this does not break backwards compatibility, since it is an iBooks specific property.
Reply 

#7  vermillion6 07-04-2020, 05:57 AM
Thanks a bunch!
The xml file worked in iPad
Reply 

#8  JSWolf 07-04-2020, 06:35 AM
Quote thiago.eec
To be honest, I don't know for sure. I think it might.
But, since the iBooks is EPUB3 aware, using the OPF meta property seems more reasonable. No need for an extra file. And this does not break backwards compatibility, since it is an iBooks specific property.
IMHO, I find the OPF solution to be messy. I prefer the XML file solution as i doesn't make a mess.
Reply 

Today's Posts | Search this Thread | Login | Register