01-15-2010, 03:52 AM | #1 |
Addict
Posts: 343
Karma: 1010002
Join Date: Apr 2008
Location: London. UK
Device: Marvin Reader on iPad Air (via Calibre)
|
ePub to ePub - just replace CSS?
I am experimenting with how to get ePub books to render nicely on my Sony PRS-600. This isn't a problem with format shifted titles as the Calibre conversion with some Custom CSS works nicely.
However, books purchased natively in ePub format are very variable and don't yield nicely to a simple fix. Looking further at a particularly obstinate title (Well of Ascension by Brandon Sanderson) I turned on the debug option and looked at the various stages. It occurred to me that the simplest way to influence the appearance was simply hand editting the CSS in the "input" folder and then rebundling up the book from there. This works nicely and has the advantage that it hasn't been "translated" (just in case that subtly alters something). So... Is it feasible to have 2 extra options in Calibre? Extract CSS - to extract the CSS from an ePub book and pop it into the directory where Calibre stores the book Replace CSS - to reinsert the CSS from that (following edit) into the book? Is there even a standard name/location for CSS? If there was and these two options were available it would dramatically simplify messing with the appearance of an ePub book, without altering the actual book content? Vaguely possible or wildly improbable? |
01-15-2010, 11:08 AM | #2 |
creator of calibre
Posts: 44,351
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Why not just convert from epub to epub. Disable the font size rescaling, and use extra css.
|
Advert | |
|
01-15-2010, 11:27 AM | #3 |
Addict
Posts: 343
Karma: 1010002
Join Date: Apr 2008
Location: London. UK
Device: Marvin Reader on iPad Air (via Calibre)
|
Converting from ePub to ePub doesn't always work for books with oddly named styles - or else I am not able to specify a wide enough scope in my extra CSS snippet.
For instance the book I was fiddling with had about 20 styles named p.* and they didn't get amended? i.e. p.para { font-family:"Times New Roman", serif; font-size:medium; margin-top:0em; margin-bottom:0em; text-align:justify; text-indent:0em; } Could I influence them all with a statement like: p { line-height: 130% font-family:"DroidSerif", serif; } |
01-15-2010, 11:38 AM | #4 |
creator of calibre
Posts: 44,351
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You have to use a selector of at least as high a specificity. So p.para will do the trick.
|
01-15-2010, 12:21 PM | #5 |
Addict
Posts: 343
Karma: 1010002
Join Date: Apr 2008
Location: London. UK
Device: Marvin Reader on iPad Air (via Calibre)
|
OK thanks - I will continue to experiment.
|
Advert | |
|
01-15-2010, 04:19 PM | #6 |
Grand Sorcerer
Posts: 6,216
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
EPUB to EPUB in Calibre
The biggest problem I have found with EPUB to EPUB in Calibre is that I invariably don't get the conversion parameters quite right the first time and have to keep refining them.
With any other source input format this is trivial but with EPUB/EPUB the source is overwritten by the converted output and I therefore have to reimport the original before having another go. None of this is difficult but it is certainly not as convenient as keeping the input source separate from the converted output. Would it be possible for Calibre to retain the original when the input and output formats are the same? Is it worth me raising an "enhancement ticket". |
01-15-2010, 04:29 PM | #7 |
creator of calibre
Posts: 44,351
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
The way the database is setup, preserving the original would be rather difficult to implement. I suppose the GUI could just make a copy of the file before handing of the original to be converted, but that wouldn't really be much more convenient.
|
01-15-2010, 05:07 PM | #8 |
Grand Sorcerer
Posts: 6,216
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
OK, thank you. I just thought I'd ask.
|
01-16-2010, 07:15 AM | #9 | |
US Navy, Retired
Posts: 9,865
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
Quote:
1. select book 2. select edit metadata 3. under available formats I delete the malformed epub. 4. under available formats I add the original epup. This is quicker (and maintains metadata) than removing the book and adding it again via the main menu. Still not the most convenient it could be. |
|
01-16-2010, 02:24 PM | #10 |
Grand Sorcerer
Posts: 6,216
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
|
01-16-2010, 08:48 PM | #11 |
US Navy, Retired
Posts: 9,865
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
|
01-17-2010, 04:21 AM | #12 |
Addict
Posts: 343
Karma: 1010002
Join Date: Apr 2008
Location: London. UK
Device: Marvin Reader on iPad Air (via Calibre)
|
The additional painful bit for me is that I have to transfer the book to the Sony to see if it worked! I may have to bite the bullet and jailbreak the device so that I can edit the location of the default stylesheet. Or maybe Sony will release firmware that allows basic appearance tweaks - change font, change font size, change margins.
[see flying pig] |
01-17-2010, 04:27 AM | #13 | |
US Navy, Retired
Posts: 9,865
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
Quote:
|
|
01-22-2010, 01:04 AM | #14 |
Addict
Posts: 343
Karma: 1010002
Join Date: Apr 2008
Location: London. UK
Device: Marvin Reader on iPad Air (via Calibre)
|
Just because I am not yet familiar enough with the Sony to know how my changes will appear on the PRS-600. The Calibre/ADE/Sony Reader viewers all behave slightly differently in how they render an ePub. As I am trying to tailor the CSS so that it looks great on the Sony, I really need to look at it on that device...
|
01-22-2010, 01:30 AM | #15 | |
US Navy, Retired
Posts: 9,865
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
Quote:
Most of the time I can tell if it got screwed up using Calibre's viewer. Noticing the difference once on the device has a level of attention to detail that is beyond me. If you get a standard set of css settings that work best for you on the 600 past them along. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
PRS-600 Replace DEFAULT epub fonts! (PRS-600) | pepak | Sony Reader | 33 | 08-04-2023 02:31 PM |
Replace DEFAULT epub fonts! (PRS-505) | pepak | Sony Reader Dev Corner | 70 | 01-22-2011 07:20 PM |
converting to epub with my css | fbrzvnrnd | Calibre | 3 | 04-15-2010 02:46 AM |
find and replace, epub | ampsonic | Reading and Management | 3 | 03-02-2010 03:20 AM |
epub, ADE and CSS puzzle | pdurrant | ePub | 3 | 09-03-2009 01:07 PM |