View Single Post
Old 01-02-2011, 06:42 PM   #239
elanamig
Junior Member
elanamig began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Dec 2010
Device: iPad
Quote:
Originally Posted by jackie_w View Post
The problem you have with this file is that there are font-family statements at a "lower level" than body or body.calibre.

You should be able to correct the already-converted epub by amending the epub's css file in Sigil or with Tweak-epub in calibre (whatever you're comfortable with). Given the settings in your @font-face statements, there is more than one way to fix this but the following 2 steps should work:

1. Change all those instances of
Code:
font-family: "Times New Roman";
to
Code:
font-family: serif; (or font-family: "Liberation";)
and all those instances of
Code:
font-family: Arial;
to
Code:
font-family: sans-serif;  (or font-family: serif; or font-family: "Liberation";)
I don't want to confuse you but I feel I should also add that the above could also have been achieved via the original Calibre conversion to EPUB if the Calibre ExtraCSS had matched your source file. I can't see the source file so I can't tell you what it should have been. If you want to pursue this for future info, send me a PM and we can take it from there.
2. You also need to make sure your actual font files are in exactly the correct directory as specified in your @font-face statements. e.g. you have referred to the Regular serif font as
Code:
res:///Data/fonts/LiberationSerif-Regular.ttf
which means that looking at your Sony in your PC's file browser you should have a directory
Code:
[Drive:]/fonts
containing the file
Code:
LiberationSerif-Regular.ttf
Everything is case-sensitive so directory names, filenames and extensions must match EXACTLY.


It seems so obvious now that you pointed it out. Changing all font-family refs to Liberation worked. I got rid of the fonts dir on the reader and added a fonts dir to the epub instead, just to make sure all references are good.

What confused me about this before is that Adobe Digital Editions reads the messed up css without problems. But Sony is pickier.
elanamig is offline   Reply With Quote