Pissed off with LRF formatting: LRF/LRS clean tool?
Probably many of you have experienced this: you get an ebook, maybe in lit or rtf (or ever lrf itself), convert it to lrf using ebook-convert, and it looks like shit on your ebook reader (not calibre's fault, the original file is already crappy), namely:
- font too big/small
- line spacing keeps changing (sometimes the last line of every paragraph has some extra space on top)
- some parts of the text have weird sizes
- excessive margin top/down
- no spacing between paragraphs or first line indentation.
How do you cope with it?
For the font size thing, I've tried converting with calibre, but it seems to ignore my font size preferences (tried the last version yesterday, still no luck). For now I'm using a little perl script that reduces all font sizes by a factor. But the other problems remain.
I have then converted lrf to lrs and examined the source. Guess what's in there, a gazillion styles and lots of <Span> with custom formatting things within the <P>.
If there is no solution already there I'm thinking about picking an ebook that currently displays correctly, taking the BlockStyle and TextStyle that are used in the majority of the paragraphs, and writing a script that will substitute the most used BlockStyle and TextStyle for those, thus giving all my books a consistant look.
Of course, the whole lot of <Span>s in the text will do their weird things, maybe it's a good idea to remove them...
But of course if there is a tool available I might as well use it; do you guys know of any?
GNU/Linux only, I don't have (or will have) Windows.
Last edited by grimborg; 12-11-2009 at 09:35 AM.