04-05-2010, 02:57 PM | #1 |
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. |
04-05-2010, 03:56 PM | #2 |
Guru
Posts: 800
Karma: 194644
Join Date: Dec 2007
Location: Argentina
Device: Kindle Voyage
|
You are placing this in your css:
Code:
body { font-family: "Segoe UI", sans serif; } Code:
body { font-family: "Segoe UI",serif; } |
Advert | |
|
04-06-2010, 11:54 AM | #3 | |
Nameless Being
|
Quote:
However, you are correct about the elements. the epub had the font defined in a P element rather than the BODY element so it was overriding the BODY element definition. My bad--I should have looked more closely. This whole ePub book was a mess. I bought it from Sony and deDRMed it. It has hundreds of footnotes linked and almost every link included the entire paragraph such that hundreds of paragraphs were completely underlined. I had to use Dreamweaver to strip out all the A element tags to make the book readable. Fortunately dreamweaver can do that for an entire folder of files and it only took a few seconds, so it was a quick fix. |
|
04-06-2010, 12:04 PM | #4 | |
The Grand Mouse 高貴的老鼠
Posts: 71,406
Karma: 305065800
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
|
Quote:
sans serif is incorrect. You can't have a space in the value. The correct name for the sans serif generic family is "sans-serif" There are three generic family types defined in the CSS used in ePubs:
|
|
04-06-2010, 01:29 PM | #5 | |
ePub Maker
Posts: 120
Karma: 16
Join Date: Dec 2009
Location: Mordor
Device: iPad,Kindle 3, Nook 2
|
Quote:
I'm studying on the auto method of cleaning such mess, I need plenty of examples of various dirty HTML code. I would be appreciated, thanks. My email box: service(at)htmlcleaner(dot)com |
|
Advert | |
|
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
epub change font calibre | ploik000 | Calibre | 2 | 08-16-2010 11:34 AM |
Basic CSS Font family question! | kjk | ePub | 2 | 05-27-2010 01:28 PM |
converting to epub with my css | fbrzvnrnd | Calibre | 3 | 04-15-2010 02:46 AM |
ePub to ePub - just replace CSS? | ChristopherTD | Calibre | 21 | 02-11-2010 02:50 AM |
Embedding Chinese font using CSS override? | kome17 | Calibre | 0 | 09-18-2009 12:57 AM |