06-06-2011, 09:40 PM | #1 |
Chasing Butterflies
Posts: 3,132
Karma: 5074169
Join Date: Mar 2011
Location: American Southwest
Device: Uses batteries.
|
Removing Font and Margin Overrides
Complete newbie to the epub forum here. Hi.
(Please don't kill me with sheep. ) I'm really liking my new Sony reader, but I'm astounded to see that there's a high variation in embedded fonts and margin sizes in my epub collection. I'm kind of a control freak, so I'd like to strip out the embedded fonts on all my books and force them to conform to my device-font. And while I'm at it, I wouldn't mind ripping out the predefined margins, because some of my books have a wasted inch of space or more. Ick. I know just enough about epubs to turn the .epub extension into a .zip extension and look at the .css file. That is it. I know what CSS looks like, but have no idea what does what or what I need to change, etc. So... 1. Is there a program (Sigil? Calibre?) that will let me change my epubs or do I have to modify them through the zip file --> css method? 2. What piece of code is in the epubs to override my device fonts and what should I change it to so that it will stop overriding my device? 3. Same question, but about margins: how do I modify them? 4. Is there a way (please dear god, let there be a way) to automate this for my 350+ epubs or must I do all this by hand? Thank you in advance. |
06-07-2011, 03:11 AM | #2 |
Wizard
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
Perhaps Calibre can do something with the conversion from epub to epub, I don't know. I don't like the code from Calibre...
The fonts are the most easy to remove. Just load the epub in Sigil and remove the font-face and font-family references. That should take care of that. Margins are a bit more difficult. Margins can be set on many levels, @page, body, paragraph and so on. Just search on 'margin-' in the CSS and you schould be able to get most. However, take in mind that no margins at all is not always pleasant to read. That depends on the book. Then of course there can be internal stylesheets in each xhtml file. There also references to the font and margins can be set. Many ways to do things and I thing that in your collection all methods are used. That makes is more difficult to automate things. Again, perhaps you can use Calibre conversion. |
Advert | |
|
06-07-2011, 08:33 AM | #3 | ||
Chasing Butterflies
Posts: 3,132
Karma: 5074169
Join Date: Mar 2011
Location: American Southwest
Device: Uses batteries.
|
Apparently, there is a Calibre plugin for removing the default fonts, so I was able to get that to work, yay.
I'm still running into weirdness on the new font, though. The old, font-embedded books look different from the new, non-font-embedded books, even when using the same font (Charis). The font on the reader looks super-bold and thick. The CSS for my reader font is: Quote:
Quote:
|
||
06-08-2011, 01:09 PM | #4 | |
Nameless Being
|
Quote:
|
|
06-08-2011, 01:27 PM | #5 | |
Chasing Butterflies
Posts: 3,132
Karma: 5074169
Join Date: Mar 2011
Location: American Southwest
Device: Uses batteries.
|
Quote:
I don't feel the flaws of the old system should carry over to the new system. We have the technology for user-defined fonts, so there's no reason not to employ it wherever possible. |
|
Advert | |
|
06-08-2011, 02:09 PM | #6 |
Wizard
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
Sometimes a writer has a specific meaning for using a font. Actually, in my library almost no book has build in fonts from the start.
|
06-08-2011, 02:29 PM | #7 | |
Chasing Butterflies
Posts: 3,132
Karma: 5074169
Join Date: Mar 2011
Location: American Southwest
Device: Uses batteries.
|
Quote:
I'm not immune to the argument that the author should have a say in how their product is presented, but font-choice is so personal. If you look at our Sans Serif / Serif poll, you'll see that some people find one or the other to be ABSOLUTELY EYES-BLEEDING UNREADABLE. Furthermore, there is some evidence that different disabilities (like dyslexia) may respond differently to certain fonts. Given all that, I think it's perfectly acceptable that the author, well, not get to mandate what font their work is read in. They're welcome to make a suggestion, but personal need trumps authorial rights in this case, I think. |
|
06-09-2011, 02:33 AM | #8 |
Member
Posts: 15
Karma: 10
Join Date: Nov 2007
Location: Germany
Device: Sony PRS-300
|
Another solution that might help is to look at rules containing 'font-weight' entries in the produced css - not in the @font-face rules but in general. If some are set to bold/bolder then that might explain the problems you're describing - if so either delete them or set their values to 'normal'.
It's also possible that your html contains inconvenient presentation markup (b, em, h...), although I doubt that since - in my experience - Calibre handles everything with css. If you completely remove the css stylesheet and still have boldness problems then thats a good indicator that either the markup or - as Toxaris mentioned - inline stylesheets are to blame. To get rid of the former you could always override the default element rendering by inserting a Code:
b, em {font-weight: normal; font-style: normal;} For the later have a look at the html files and search for elements which contain style="..." attributes. Finally there's always the option to convert your book using Stanza Desktop - though I would only recommend that as a fallback option since Stanza rigorously removes all presentational markup (i.e. no italics, bold, etc. anymore). |
06-09-2011, 08:13 AM | #9 |
Grand Sorcerer
Posts: 27,547
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
The sad--but honest--news is that there will be no easy automated process that will work for all 350+ of your books. The good news is: once you start rooting around in the CSS and html, it will become easier to spot patterns and methods that people use to put their epubs together. It will get increasingly easier to achieve exactly what you want with practice. But I would never attempt to "fix" 350+ epubs... I only attempt to fix the one I'm reading right now.
|
06-09-2011, 10:20 AM | #10 | |
Chasing Butterflies
Posts: 3,132
Karma: 5074169
Join Date: Mar 2011
Location: American Southwest
Device: Uses batteries.
|
Quote:
It really should be possible to automate the process - there's a finite number of ways to set margins, font, and font size in code, so automating a search-and-change process should not be impossible. Just needs someone who understands the code first. |
|
06-09-2011, 11:09 AM | #11 | |
frumious Bandersnatch
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Quote:
And then, what if the code has this: Code:
.text { margin: 1em 0; } <p class="text">Some normal text</p> <div class="text"><img src="image.png" alt=""/></div> <p class="text">More normal text</p> |
|
06-09-2011, 12:35 PM | #12 |
Chasing Butterflies
Posts: 3,132
Karma: 5074169
Join Date: Mar 2011
Location: American Southwest
Device: Uses batteries.
|
I'm more interested in tweaking the left/right side margins -- several books on my reader look like this tiny little median of text with two large highways of blank space on either side.
|
06-09-2011, 07:16 PM | #13 |
Resident Curmudgeon
Posts: 73,957
Karma: 128903250
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Code:
body { display: block; font-family: "Charis", serif; line-height: 1.1em margin-bottom: 0; margin-left: 0; margin-right: 0; margin-top: 0; widows: 0; orphans: 0 } |
06-09-2011, 07:32 PM | #14 |
Chasing Butterflies
Posts: 3,132
Karma: 5074169
Join Date: Mar 2011
Location: American Southwest
Device: Uses batteries.
|
Thank you -- I'll try that tonight.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
@page { margin-bottom: 5.000000pt; margin-top: 5.000000pt; } | cybmole | Conversion | 15 | 02-12-2011 11:57 AM |
Removing embedded font/overwrite some css? | silentguy | Conversion | 4 | 01-25-2011 12:41 PM |
ttc font file can't be put into font folder | droople | Sigil | 2 | 08-21-2010 10:05 AM |
calibre ignore margin-top and margin-bottom | bender | Calibre | 2 | 12-11-2009 06:58 AM |
LRF2LRF (Font and Margin modifyer) | =X= | LRF | 18 | 07-25-2009 11:20 AM |