03-01-2010, 06:29 PM | #1 |
Junior Member
Posts: 9
Karma: 10
Join Date: Mar 2010
Device: EPubReader
|
Another font embedding problem
This is driving me a little crazy. I've made an e-pub with embedded fonts, and it displays correctly in Calibre and ADE. I've read the thread from last December recommending testing by loading a page from the unzipped epub in FireFox: I've done that, and the font gets displayed correctly. The epub validates with epubcheck and the CSS validates as version 3 in the W3C validator. But the font does not get displayed in the FireFox EPubReader. So what can be going on? Here are the the @font-face declarations:
@font-face{font-family: JunWeb; font-weight: normal; font-style: normal; src: url("JunWeb-Regular.ttf") format("truetype");} @font-face{font-family: JunWeb; font-weight: bold; font-style: normal; src: url("JunWeb-Bold.ttf") format("truetype");} @font-face{font-family: JunWeb; font-weight: normal; font-style: italic; src: url("JunWeb-Italic.ttf") format("truetype");} @font-face{font-family: JunWeb; font-weight: bold; font-style: italic; src: url("JunWeb-BoldItalic.ttf") format("truetype");} And the invocation of the font: body {font-family: JunWeb, serif;} And in case anyone want to look at this in context, I've posted the whole epub here: http://faculty.virginia.edu/OldEnglish/secret/oeg.epub I'd hugely appreciate any advice here. EPubReader is a terrific add-on, and I'd like to get my files to work correctly with it! Thanks, Peter |
03-02-2010, 05:03 AM | #2 | |
Developer of EPUBReader
Posts: 271
Karma: 1922
Join Date: Oct 2009
Device: none
|
Quote:
I had a look at your ePub and must admit that I couldn't see a difference between loading it in EPUBReader and loading it in FF directly. I guess you have checked the FF option for embedded fonts, because you say you can see the right font when you open it in FF directly. Please post a screenshot from Calibre or ADE and from EPUBReader. Please mention additionally which page you opened. Last edited by mikelv; 03-02-2010 at 05:06 AM. |
|
Advert | |
|
03-02-2010, 08:05 AM | #3 |
Junior Member
Posts: 9
Karma: 10
Join Date: Mar 2010
Device: EPubReader
|
Thanks for the quick reply. Here's ADE:
And here's Calibre: Calibre has got issues of its own: this version does not display italics (an acknowledged bug), and it looks as if it may be having trouble with bold as well. But it is loading the embedded font(s). The font is definitely embeddable (Open Source, etc.), but I've double-checked just to make sure. |
03-02-2010, 08:48 AM | #4 |
Developer of EPUBReader
Posts: 271
Karma: 1922
Join Date: Oct 2009
Device: none
|
Thanks for uploading.
Attached you find a screenshot how it looks like in EPBUReader. If I open the file directly in FF, I can see no difference. This would mean, if there is a problem, it's not a special EPUBReader problem, but a FF problem. Okay, perhaps I'm blind, but I can't see a big difference between my screenshot and your screenshots . Where do you see a problem? |
03-02-2010, 09:12 AM | #5 |
Junior Member
Posts: 9
Karma: 10
Join Date: Mar 2010
Device: EPubReader
|
You're not blind: you are definitely seeing the correct font. And I'm completely flummoxed, for I am definitely *not* seeing the correct font in FF 3.6/Mac or FF 3.5.x/Linux. Here's what I'm seeing (sorry I haven't figured out that neat thumbnail thing):
Definitely Times. My copy of FF is set to allow pages to choose their own fonts: and they do! I suppose there must be a difference in my configuration directory somewhere. But where? |
Advert | |
|
03-02-2010, 11:23 AM | #6 |
Junior Member
Posts: 9
Karma: 10
Join Date: Mar 2010
Device: EPubReader
|
Further notes:
I've tried this with other Open Source fonts (Gentium, DejaVu): no dice. I've cleaned out the Mac font cache and restarted the computer: no dice. I've tried it out in a new, clean user account: no luck. I am completely flummoxed. |
03-02-2010, 12:12 PM | #7 |
Developer of EPUBReader
Posts: 271
Karma: 1922
Join Date: Oct 2009
Device: none
|
I think I found the reason for the problem. Because the font you use seems to be very similar to Times, I didn't see that the pages in EPUBReader look different than the one directly in FF .
It is probably caused by this statement in EPUBReader's css-file: "font-family: parent !important;" This statement is used for "body, div, span, p". The css is applied to the pages of the epub-file. I've added this line because the users should be able to change the font of the epub. If the users want to have "arial", "parent" is replaced by "arial" and everything works fine. "parent" is used, when the font defined in the book should be used. Obviously seems "parent" not the right value to reach this goal. Any idea which is the right value? Sorry for the headache this may have caused . |
03-02-2010, 01:34 PM | #8 |
Junior Member
Posts: 9
Karma: 10
Join Date: Mar 2010
Device: EPubReader
|
I'm glad if my little problem ends up contributing to an improvement in EPubReader. But unfortunately my CSS is not nearly advanced enough to understand the issue, let alone help to solve it.
I'll hope for a fix in the next release. |
03-03-2010, 04:26 AM | #9 |
ISV
Posts: 19
Karma: 10
Join Date: Feb 2010
Location: Belgium
Device: iPhone
|
The oeb-page-head and oeb-page-foot display values
Hello,
Those values are not supported, in which case they should be treated as "none". In understand Firefox doesn't understand it and hence uses the default display type, which is "inline". A simply way to implement this is to scan all CSS-files and replace those values with "none". You don't even need a proper CSS-parser for this. Best regards, Werner. |
03-09-2010, 08:18 AM | #10 |
Junior Member
Posts: 1
Karma: 10
Join Date: Mar 2010
Device: Inves-600
|
Hi, sorry, i forget my inglish, but i will try
Don't use embebed fonts. The philosophy of epubs is that can be readed in all platforms. If you embebed the font, the first problem is the doc size, and the permissions to reproduce asociated to this font (© or whatever)... ADE work properly in this cases if you did' correctly, but i think it's just the one program that can do it. Calibre ignore this fonts and use the fonts that you selected on preferences: one kind of font for serif and one for non-serif. The first way: If you want use fonts on epubs, try to use opentype fonts, actually are usefull than truetype. Never use postscript fonts. I can't download your epub, so i don't know if you add the fonts nut i can read your template and i think where is the problem Try to put a folder inside the OEBPS folder and name it “Fonts” (obviously...) and ad this lines on the template.css: @font-face { I have used Adobe Garamond Pro for this example. Look at this line: font-family: "Adobe Garamond Pro"; font-style: normal; font-weight: normal; src:url(Fonts/AGaramondPro-Regular.otf); } @font-face { font-family: "Adobe Garamond Pro"; font-style: italic; src:url(Fonts/AGaramondPro-Italic.otf); } @font-face { font-family: "Adobe Garamond Pro"; font-weight: bold; src:url(Fonts/AGaramondPro-Semibold.otf); } @font-face { font-family: "Adobe Garamond Pro"; font-style: italic; font-weight: bold; src:url(Fonts/AGaramondPro-SemiboldItalic.otf); } src:url(Fonts/AGaramondPro-SemiboldItalic.otf); in the url camp must wirte the corect route to the FONTS folder, just the folder place inside OEBPS. If you need a example, write me a pm and i will send you a complet epub... Second way: Maybe the problem is that you only want to use italics and bolds fonts. How to explain?... i'll try to resume. Use character stiles on your program (i use Indesign) for bold and italic; use paragraph styles to try to mantein the paragraph structure. Them export the doc like ADE including the styles like template. You will lose all the styles, but everything (paragraphs and characters) are marked now. Open the template in Dreamwaver, Coda or oxygen and change the span like this: span.italic { Look that i named the span like the style but you can use span.anothername but is the same name used on the character/paragraph styles Indesign palettes font-style:italic; } span.bold-italic{ font-weight:bold; font-style:italic; } span.bold{ font-weight:bold; } Save, close, and compress the MIMETYPE, META-INF and OEBPS in zip format. rename the extension with epub and voila! Finally always try the epub in other system or ereader hardware. I know that this methods are less friendly, but is the way that report better results. Maybe you do something similar Espero que te sea de ayuda (I hope that help you) Un saludo. |
03-09-2010, 09:27 AM | #11 |
Junior Member
Posts: 9
Karma: 10
Join Date: Mar 2010
Device: EPubReader
|
Thanks for the feedback. I've read in various places that it's bad form to embed fonts, but in some cases it's unavoidable. My book uses phonetic characters and other odd things that aren't found on all systems. ADE in particular is infamous for its extremely limited character set: it won't even display Eastern European languages properly. It's often pointed out that Math and science texts need embedded fonts.
I can't help wondering where the recommendation that epubs use .otf fonts comes from. I've seen it in the Adobe specs, and that's no surprise, since that's what Adobe sells; but my TrueType font works well in ADE and (mostly) Calibre. Does anyone know why it's so often stated that .otf fonts are preferable in epubs? i don't get it. I tried various directory arrangements while working with this problem, on the theory that EPubReader or Firefox was being picky about their locations: nothing made any difference. And it seems pretty well established now that there's a problem in the CSS that ships with EPubReader. Finally I'll just say that if our excellent developer wants any help testing a fix, I'll be more than glad to help! |
03-11-2010, 07:51 AM | #12 |
Developer of EPUBReader
Posts: 271
Karma: 1922
Join Date: Oct 2009
Device: none
|
I've created a special version which doesn't change the font in the EPUBReader css. If you still don't see your font with this version, it's not a problem caused by EPUBReader. If you like to try it, please send me a private message with your emailaddress.
|
03-11-2010, 01:40 PM | #13 |
Developer of EPUBReader
Posts: 271
Karma: 1922
Join Date: Oct 2009
Device: none
|
Peter made some tests with this version and the problem seems to be fixed. The fix will be available in the next official version.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Embedding .symbol font? | Kivgaen | Sigil | 23 | 06-24-2010 09:13 PM |
Directionality, font-embedding and ADE | lecteur9 | ePub | 6 | 12-04-2009 06:26 AM |
Automatic font embedding - or something else? | pepak | Calibre | 4 | 06-01-2009 03:38 PM |
Font embedding/enryption/obfuscation | ckirchho | ePub | 5 | 03-14-2009 10:28 AM |
Font embedding error | Peto | Calibre | 2 | 08-05-2008 10:40 AM |