View Single Post
Old 01-20-2010, 05:17 PM   #1
Loccy
Junior Member
Loccy began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Dec 2009
Device: Cool-ER
EPUB (CSS) tweaker app

Hi all,

A week or so I posted about how frustrating it was that, when using Calibre to convert from LIT format, you have no control about the justification of your final EPUB - depending on the LIT it'll either be left justified or fully justified, but you get no ability to choose your preferred option. The sound of tumbleweeds drifting by was deafening (translation: no-one appeared to care based on the lack of responses I got to my post).

In the end I threw together the attached Java app and am posting here in case others also find it useful. Basically, it'll open up an EPUB and let you edit the CSS directly, then let you save the changes, saving you the aggro of extracting the EPUB and repacking it afterwards. In the simple editor the more "interesting" attributes (ie. the ones I find myself changing most often) are bolded, to assist the user when scanning down them:

text-align:
font-size:
and text-indent:

Those of you not CSS savvy, basically if you look for any references to text-align: left and change them to text-align: justify, that should do the trick. On some LIT conversions I've seen double paragraph indentation happen - usually this is because there's a base style called section AND individual styles for the paragraphs, both with an indent. If you remove the text-indent line from the section style, that'll resolve the double indent.

This has not been tested to any great degree so you are advised to back up any EPUBs first! It's also only been tested on a Mac (but it's Java, so should run OK on pretty much anything).

To use, download the file, BUT DO *NOT* EXTRACT THE ZIP. Instead, rename it from epub-tweaker.zip to epub-tweaker.jar. If you have Java you should then be able to run it by double-clicking, and load an EPUB from the File menu.
Attached Files
File Type: zip epub-tweaker.zip (13.4 KB, 1472 views)
Loccy is offline   Reply With Quote