Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 02-26-2012, 01:05 PM   #1
paulfiera
Addict
paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.
 
paulfiera's Avatar
 
Posts: 387
Karma: 3102
Join Date: Dec 2010
Location: EU
Device: Kobo Aura ONE, Kobo Libra H20
Embedded fonts and inline style

Whenever I have some epubs with embedded fonts I usually run the Modify epub plugin to remove them and then I do a conversion.

Doing that, the resulting epub always generates an inline style with these font definitions:

Quote:
@font-face {
font-family: "Charis";
font-style: normal;
font-weight: normal;
src: url(fonts/CharisSILR.ttf)
}
@font-face {
font-family: "Charis";
font-style: normal;
font-weight: bold;
src: url(fonts/CharisSILB.ttf)
}
@font-face {
font-family: "Charis";
font-style: italic;
font-weight: normal;
src: url(fonts/CharisSILI.ttf)
}
@font-face {
font-family: "Charis";
font-style: italic;
font-weight: bold;
src: url(fonts/CharisSILBI.ttf)
}
Then I open the epub in Sigil and replace all these occurrences.

I've tried checking the checkbox "fonts" in Look & Feel -> Filter Style Information hoping that no fonts would be declared in the inline CSS but that doesn't seem to do the trick.

Is there any way I can prevent calibre to declare these non existing fonts?

Not really a show stopper. Mostly so I can avoid doing the search & replace with Sigil after a conversion.
paulfiera is offline   Reply With Quote
Old 02-26-2012, 01:10 PM   #2
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,714
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Load the ePub into Sigil, remove the font code from the CSS. Remove the fonts, remove the font code in the OPF and forget about the modify ePub plugin (doesn't seem to work). Then you can do any other editing you need/want to do via Sigil.

Doing a conversion from ePub > ePub can cause problems you don't want. So this is why it's best to do the font removal via Sigil and forget converting. It's already ePub. It doesn't need to be remade into ePub.

Last edited by JSWolf; 02-26-2012 at 01:13 PM.
JSWolf is offline   Reply With Quote
Advert
Old 02-26-2012, 01:16 PM   #3
paulfiera
Addict
paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.
 
paulfiera's Avatar
 
Posts: 387
Karma: 3102
Join Date: Dec 2010
Location: EU
Device: Kobo Aura ONE, Kobo Libra H20
Quote:
Originally Posted by JSWolf View Post
Load the ePub into Sigil, remove the font code from the CSS. Remove the fonts, remove the font code in the OPF and forget about the modify ePub plugin (doesn't seem to work). Then you can do any other editing you need/want to do via Sigil.
Thanks, JSWolf.

That's what I'm currently doing - more or less. I was just wondering, generally, why calibre has to declare fonts inline that actually do not exist.

Quote:
Originally Posted by JSWolf View Post
Doing a conversion from ePub > ePub can cause problems you don't want. So this is why it's best to do the font removal via Sigil and forget converting. It's already ePub. It doesn't need to be remade into ePub.
I'm aware of that, but sometimes I like to get better covers for the epubs I convert, or generate a TOC if it isn't present, or change the look & feel of h1, h2 headings, etc...

Last edited by paulfiera; 02-26-2012 at 01:23 PM.
paulfiera is offline   Reply With Quote
Old 02-26-2012, 01:23 PM   #4
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,714
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by paulfiera View Post
Thanks, JSWolf.

That's what I'm currently doing - more or less. I was just wondering, generally, why calibre has to declare these fonts in an inline style - no matter if these fonts are present or not.
Calibre take any @ code like @font-face and @page and puts them in every XML file and removes them from the CSS. That to me is the wrong way to do it. Because it then means any changes have to be done to every XML file. This is one of the issue you can get going ePub > ePub.
JSWolf is offline   Reply With Quote
Old 02-26-2012, 01:32 PM   #5
paulfiera
Addict
paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.
 
paulfiera's Avatar
 
Posts: 387
Karma: 3102
Join Date: Dec 2010
Location: EU
Device: Kobo Aura ONE, Kobo Libra H20
Quote:
Originally Posted by JSWolf View Post
Calibre take any @ code like @font-face and @page and puts them in every XML file and removes them from the CSS. That to me is the wrong way to do it. Because it then means any changes have to be done to every XML file. This is one of the issue you can get going ePub > ePub.
So that's how it works!

I guess I'll follow your advice on the sequence: Remove the font code from the CSS. Remove the fonts, remove the font code in the OPF.

Many thanks JSWolf
paulfiera is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
embedded fonts Wally S Workshop 15 01-21-2012 03:57 PM
Embedded fonts dicknskip Sigil 27 12-01-2011 09:24 AM
Embedded fonts? Greenmantle Kobo Reader 66 07-27-2011 08:20 PM
Import of HTML With Embedded <Style> Broken In 0.7.5 Oboe Joe Calibre 2 06-27-2010 10:35 AM
Embedded fonts, Calibre, and choice of fonts AlexBell ePub 8 05-30-2010 06:00 AM


All times are GMT -4. The time now is 02:39 AM.


MobileRead.com is a privately owned, operated and funded community.