View Single Post
Old 04-05-2010, 02:57 PM   #1
jswinden
Nameless Being
 
Calibre not overwriting ePub CSS font info

In the Conversion--Look and feel window, the Extra CSS field is described as follows, "Either the path to a CSS stylesheet or raw CSS. This CSS will be appended to the style rules from the source file, so it can be used to override those rules."

However, it does not work correctly for font info. For example, I've added the font Segoi UI to my Sony PRS-300. Therefore I should be able to add he following in the Extra CSS field with the result of my ePub using bold Segoi UI rather than the Sony default serif font.

@font-face {
font-family: "Segoe UI";
font-weight: normal;
font-style: normal;
src: url(res:///Data/fonts/segoeuib.ttf);
}

@font-face {
font-family: "Segoe UI";
font-weight: bold;
font-style: normal;
src: url(res:///Data/fonts/segoeuib.ttf);
}

@font-face {
font-family: "Segoe UI";
font-weight: normal;
font-style: italic;
src: url(res:///Data/fonts/segoeuiz.ttf);
}

@font-face {
font-family: "Segoe UI";
font-weight: bold;
font-style: italic;
src: url(res:///Data/fonts/segoeuiz.ttf);
}

body { font-family: "Segoe UI", sans serif; }


However, this results not in the substitution of bold Segoi UI but in the default Sony serif font.

If I copy the ePub file and rename it from *.epub to *.zip, extract it, open the CSS file and change all occurences of font-family: serif; to font-family: "Segoe UI";, re-zip the file, change the name back to *.epub, then enter the extra CSS in the Extra CSS field Calibre converts the epub so that it uses bold Segoi UI.

My whole point here is that the Calibre Extra CSS field is not able to override the epub's CSS file font-family: serif; code.
  Reply With Quote