View Single Post
Old 07-25-2012, 10:28 AM   #6
Alabala
Junior Member
Alabala began at the beginning.
 
Alabala's Avatar
 
Posts: 2
Karma: 10
Join Date: Jul 2012
Device: Mobipocket; Kindle; Calibre; ADE
Thank you all for your responses, you guys are great. I finally made it work by going through several additionnal steps.

I was using a "font" directory (without capitalization) since I've noticed that InDesign was doing so when the embed font option was checked upon export. I suspected, therefore, that the directory location was not the problem per se. However, I tried capitalizing both the directory and the corresponding fields in the .opf and .css. That didn't change anything.

However, the media-type problem pointed by Toxaris made me think that there was probably more than one issue out there. I decided to download Sigil (I didn't think it was necessary, but it was this step that helped my figure it out) and to check the document with it.

Sigil revealed that there was indeed a media-type error. More importantly, it detected that my font was "present in the OPF <manifest>, but not reachable (it's unused)". Instead of trying to correct my old epub, I embedded the fonts directly through Sigil, in a new document, which corrected the .opf. Since I was still getting the error, I had to get rid of the blank space in "src:url ("../Fonts/..." and change it to "src:url("../Fonts/...". That made it work perfectly. Finally, I also got rid of the "serif" in @font-face, as suggested by Aerys.

Here's the corrected parts of the. opf and .css in case that could help someone:

<item href="Fonts/GentiumPlus-I.ttf" id="GentiumPlus-I.ttf" media-type="application/x-font-ttf" />
<item href="Fonts/GentiumPlus-R.ttf" id="GentiumPlus-R.ttf" media-type="application/x-font-ttf" />
</manifest>

@font-face {
font-family: "Gentium Plus";
font-style: normal;
font-weight: normal;
src:url("../Fonts/GentiumPlus-R.ttf");
}
@font-face {
font-family: "Gentium Plus";
font-style: italic;
font-weight: normal;
src:url("../Fonts/GentiumPlus-I.ttf");
}
body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, p, pre, code, blockquote {
font-family: "Gentium Plus";
margin:0;
padding:0;
border-width:0;
}
Alabala is offline   Reply With Quote