02-05-2012, 07:10 PM
I'm currently creating some epubs that use embedded fonts. My problem is that, while some fonts do show up in Adobe Digital Editions, others do not. I'm using the same code each time, just changing it for the appropriate font. The fonts themselves come from Google's Webfonts collection.
This is an example of my CSS:
font-family : 'FanwoodItalic';
This example doesn't work in ADE, although the fonts show up every time in iBooks.
What am I doing wrong???
02-06-2012, 11:00 PM
As I recall, the name in the font-family line must be the same as the name specified in the font file - FontForge reports the name as 'Fanwood-Italic'
Try 'Fanwood-Italic' in the font-family lines and let us know if it works.
02-09-2012, 10:16 AM
Does the font's filename/path in the css and content.opf files match (i.e. capitalization, punctuation, spaces)?
02-13-2012, 02:45 PM
Thank you both for your responses. I've tried again with the font name provided as Fanwood-Italic. It doesn't seem to make a difference.
In all cases, however, the font is displayed correctly in ADE 1.8 Preview. It's only in ADE 1.7 (the current version) that the font is ignored. This happens however I name the font.
In any case, here's the relevant section of my updated CSS. This CSS file is in the styles/ directory:
And this from the book.opf file. Please note that the book.opf file is in the root, whereas the style.css is in the style directory, hence the '../' in the CSS. Putting style.css in the root and changing the CSS accordingly still makes no difference:
<item id="coverPage" href="CoverPage.html" media-type="application/xhtml+xml" />
<item id="coverImage" href="images/img_1329158139801.jpg" media-type="image/jpeg" />
<item id="ncx" href="book.ncx" media-type="application/x-dtbncx+xml" />
<item id="h1_font" href="fonts/Fanwood/Fanwood-Italic-webfont.ttf" media-type="application/x-font-ttf" />
<item id="css_css1" href="styles/styles.css" media-type="text/css" />
<item id="chapter1" href="Section1.html" media-type="application/xhtml+xml" />
<item id="chapter2" href="Section2.html" media-type="application/xhtml+xml" />
<item id="chapter3" href="Section3.html" media-type="application/xhtml+xml" />
Grateful for any further suggestions!
02-13-2012, 03:04 PM
Update: it seems that, irrespective of how I name the fonts, ADE 1.7.2 will display some fonts, but not others.
Droid Serif Regular displays correctly.
Whereas Fanwood Italic and Fanwood Regular (for example - they're not the only ones) are ignored.
Could it be that ADE 1.7.2 simply doesn't like some fonts? As mentioned in the previous post, ADE 1.8 preview appears to display all fonts correctly.
02-13-2012, 03:24 PM
Could it be that ADE 1.7.2 simply doesn't like some fonts?
Very possible. I've seen reports of other fonts that ADE 1.7.2 just doesn't like for whatever reason. Wellrock Slab is one.
My guess is that if you try to validate the fonts with something like FontForge, you'll find that the fonts that ADE doesn't like do not pass all tests with flying colors. Perhaps ADE 1.8 has decided to be a little less picky about 100% compliant font-files.
02-13-2012, 04:05 PM
Thanks for the suggestion. I'll try that.
02-13-2012, 07:06 PM
Yeah, I've seen ADE 1.7.2 choke on fonts that have errors in them.
Also, your sample ePUB does not have any fonts embedded in it.