View Full Version : Embedded fonts not showing up in ADE


mateo999
02-05-2012, 06:10 PM
Hello,

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-face {
font-family : 'FanwoodItalic';
src: url(../fonts/Fanwood/Fanwood-Italic-webfont.ttf);
font-style: normal;
}
h2 {
font-family: 'FanwoodItalic';
}

This example doesn't work in ADE, although the fonts show up every time in iBooks.

What am I doing wrong???

Thanks,

pholy
02-06-2012, 10: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.

Keroberos
02-09-2012, 09:16 AM
Does the font's filename/path in the css and content.opf files match (i.e. capitalization, punctuation, spaces)?

mateo999
02-13-2012, 01:45 PM
Hello,

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:

@font-face {
font-family: 'Fanwood-Italic';
src: url(../fonts/Fanwood/Fanwood-Italic-webfont.ttf);
font-style: normal;
}
h2 {
page-break-before: always;
font-family: 'Fanwood-Italic';
font-size: 1.4em;
text-align: center;
margin-top: 0em;
margin-bottom: 1em;
}

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:

<manifest>
<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" />
</manifest>

Grateful for any further suggestions!

mateo999
02-13-2012, 02: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.

DiapDealer
02-13-2012, 02: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.

mateo999
02-13-2012, 03:05 PM
Thanks for the suggestion. I'll try that.

Keroberos
02-13-2012, 06: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.