View Full Version : The option "--extra-css" doesn't work


slex
02-13-2011, 04:06 PM
I try it both in the GUI -> Preferences - Conversion -> Common options -> Conversion -> Extra CSS

and as an option to the command line ebook-convert.

I want to modify the CSS of epub conversion, but it makes no changes to the .css file. When running from the console, it shows some info as if implementing the CSS, but showing some problems, something like

Property: Not valid for profile "['CSS Fonts Module Level 3 @font-face properties']" but valid "CSS Level 2.1" value: "Liberation Mono", monospace [73:5: font-family]

I try to make epub files use Liberation fonts. The CSS is valid, if I edit it manually after conversion, it works OK, but Calibre doesn't apply it at the process of conversion.

I use Calibre 0.7.38 on Fedora 14.

tarzan
02-19-2011, 07:21 AM
I had e very similar problem on calibre 0.7.46. I was using the news recipe Kathimerini to get my news from Greece, but when I got that in my PRS 650 the accented (tonos , modern greek monotonic) fonts were replaced by question marks.

After many hours of happily swearing at Sony and the world in general, I decided to get some free fonts (GFSArtemisia from http://www.greekfontsociety.gr/) put them in a folder named "fonts" and add the following CSS to the EPUB:

@font-face {
font-family: "Arial";
font-weight: normal;
font-style: normal;
src: url(res:///Data/fonts/GFSArtemisia.otf);
}

@font-face {
font-family: "Arial";
font-weight: bold;
font-style: normal;
src: url(res:///Data/fonts/GFSArtemisiaBold.otf);
}

@font-face {
font-family: "Arial";
font-weight: normal;
font-style: italic;
src: url(res:///Data/fonts/GFSArtemisiaIt.otf);
}

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

body {
font-family: "Arial";
}


I tried converting EPUB to EPUB and adding the extra CSS through the GUI but that did not work.

I also tried to fix my problem to add the extra_css, by modifying the news recipe python script.

But nothing.

The only way I got it to work is by right clicking on the book and selecting "tweak EPUB", exploding the epub, adding the above css fragment to the stylesheet.css file and then rebuilding the EPUB, which worked fine in my PRS 650 (I hope Sony burns in hell for the time they wasted me :-) ).

This sounds like a calibre bug to me.

tarzan
02-19-2011, 07:26 AM
My reply is in the moderator queue, but I have to leave my computer now, I just wanted to update that I am actually using 0.7.45 not 0.7.46 as i said in the previous post