Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 01-25-2011, 06:20 AM   #1
silentguy
Connoisseur
silentguy doesn't littersilentguy doesn't littersilentguy doesn't litter
 
Posts: 88
Karma: 200
Join Date: Nov 2010
Location: Dortmund, Germany
Device: Kindle Paperwhite (10. Generation)
Removing embedded font/overwrite some css?

I have a collection of books and whoever created them embedded an ugly font for the whole book. I wanted to get rid of it so I ran an epub->epub conversion and not the fontsfiles are gone from the file, but the css file in the epun still contains a
Code:
.epub {
    display: block;
    font-family: "Font_71c88252-69ff-427d-9d08-e5662bb39245";
    font-size: 1em;
    margin-bottom: 0;
    margin-left: 5pt;
    margin-right: 5pt;
    margin-top: 0;
    padding-left: 0;
    padding-right: 0;
    page-break-before: always
    }
and the files themselve still contain a
Code:
<style type="text/css">
...
  @font-face {
    font-style: normal;
    font-family: Font_71c88252-69ff-427d-9d08-e5662bb39245;
    src: url(../fonts/LiberationSerif-Regular.ttf);
    font-weight: normal
    }
...
</style>
...
<body class="epub">
...
This is annoying cause it cases calibre to display the files differently. It uses a bigger sans serif font instead of what I expect. is there a way to get rid of the leftover stuff?
silentguy is offline   Reply With Quote
Old 01-25-2011, 06:46 AM   #2
Manichean
Wizard
Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.
 
Manichean's Avatar
 
Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
You can specify extra CSS in the conversion settings (in the layout tab). This CSS should override any definitions that might still be in the file. Thus, if you were to add the .epub- style without the font specification, you should get an ePub formatted as previously with whatever default font the viewer uses.
Manichean is offline   Reply With Quote
Advert
Old 01-25-2011, 10:39 AM   #3
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
You can use calibre's Tweak-epub on the converted epub to correct the CSS inside.

Open the .css file in a text editor. Find the part you posted:

Code:
.epub {
    display: block;
    font-family: "Font_71c88252-69ff-427d-9d08-e5662bb39245";
    font-size: 1em;
    margin-bottom: 0;
    margin-left: 5pt;
    margin-right: 5pt;
    margin-top: 0;
    padding-left: 0;
    padding-right: 0;
    page-break-before: always
    }
Either remove the red bit shown above or change the red bit to
Code:
font-family: serif;
assuming you want the epub to display with your reader's default serif font. Save the CSS changes, then click on the 'Rebuild epub' button.

If you've got more epubs with the same problem then putting the following in the ExtraCSS box on the Look&Feel page when you do the conversion should correct the problem during the conversion:
Code:
.epub {font-family: serif}
jackie_w is offline   Reply With Quote
Old 01-25-2011, 11:14 AM   #4
silentguy
Connoisseur
silentguy doesn't littersilentguy doesn't littersilentguy doesn't litter
 
Posts: 88
Karma: 200
Join Date: Nov 2010
Location: Dortmund, Germany
Device: Kindle Paperwhite (10. Generation)
Okay, I was looking for a way to get it to just disappear but I guess I could just replace it with the serif, thanks.

Oh, and I used the tweek ability to tell you what was left over, i was looking for a way to get rid of it in multiple files
silentguy is offline   Reply With Quote
Old 01-25-2011, 12:41 PM   #5
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Using ExtraCSS and a bulk-convert might work if your original epubs are similar enough. Although personally I never do bulk converts, certainly not for epub to epub which can be destructive if you get the conversion parameters wrong.

I don't know of any epub bulk-tweak options.
jackie_w is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sigil + embedded font variants troymc Sigil 6 10-17-2012 11:00 AM
Can't delete embedded font eosrose Sigil 1 08-16-2010 06:28 AM
problem with embedded font ericshliao EPUBReader 2 12-11-2009 10:04 AM
Common font and/or embedded fonts... Dahak LRF 6 06-28-2009 01:32 PM
LRF with embedded font igorsk Sony Reader 8 10-26-2006 08:08 AM


All times are GMT -4. The time now is 04:52 AM.


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