View Single Post
Old 08-14-2009, 01:39 PM   #54
frabjous
Wizard
frabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameter
 
frabjous's Avatar
 
Posts: 1,213
Karma: 12890
Join Date: Feb 2009
Location: Amherst, Massachusetts, USA
Device: Sony PRS-505
Two oddities about the viewer

I've been experiencing many small problems with the viewer for awhile now, and I've been trying to distill their causes. I've indentified two regular sources of screwiness.

I'm using the Linux version 0.6.5, but I've experienced the same problem with older versions, and, if I recall correctly, the Windows version.

Both are exemplified in the following attempt at a minimal (un)working example. Take the following and save it as an HTML file:

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />
<title>Calibre Ebook Viewer Tester</title>
</head>
<body>
<p>&alpha; Lorem ipsum dolor sit amet, consectetur adipiscing 
elit. &beta; Quisque gravida volutpat neque, sit amet ullamcorper 
sem pharetra ultrices. &gamma; Vivamus vel consectetur 
est. &delta; Aliquam erat volutpat.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque 
non arcu odio, in pulvinar 
ante. <span style="font-style: italic;"></span>(&eta;) Aenean 
elementum tincidunt est id imperdiet. Ut mi justo, vestibulum sed 
iaculis ut, fermentum pharetra diam. (&zeta;) Nam dapibus 
dolor&mdash;&theta;&mdash;sed libero 
aliquet consectetur ac vitae ipsum. Integer fringilla aliquam 
vulputate. [&iota;]<sup>&kappa;</sup> Ut mollis, diam eget feugiat 
tincidunt, nisi libero dapibus ante, vitae commodo turpis diam luctus 
dolor.</p> 
</body>
</html>
Two things to note here (1) HTML 4.0 codes for Greek letters, and (2) a redundant <span = ..> tag for italics that is immediately closed, so shouldn't apply to anything. Redundant tags like this are of course bad form for an HTML author, but they are ubiquitous anyway.

Anyway, these two things seem to regularly result in problems for calibre's ebook viewer.

Anyway, here's what the HTML file looks like in Firefox (as it should):



However, take the same file, put into calibre, and convert it to an ePub. (I'm using whatever the default settings are.) Then View Specific Format > ePub. I usually get something like this:


  • The rest of the paragraph after the redundant tag is in italics; the closing tag is not being respected.
  • Many Greek letters are misplaced, and some even misplace or distort other things around them:
  • The gamma is misplaced onto the word before it.
  • Zeta and the parenthesis after it are placed before where they should be, and the parenthesis that should be before it drifts afterwards.
  • The word "dapibus" and "ante" are mysteriously spaced out, when there's nothing in the code to suggest they should be different.
  • One of the brackets around iota has drifted... the Kappa superscript has drifted too.
  • Some of the lines are not justified with the rest.
Often, resizing the view window will magically fix the Greek letter problems, or change them to different problems, but when there are many on the same page, almost always at least one is misplaced, or causes other things on the same line to be misplaced.

I'm almost positive the problems are with the viewer, not the conversion, since the resulting epub works fine with other software or on my reader. However, it could be some interplay between them.

I guess this could be an issue with my video setup somehow--it has some issues with KDE/Qt-apps running under GNOME, calibre included--but I don't think so.

Update:

I opened up the resulting ePub to see if the problem lies there. In the converted html, the <span style="font-style: italic;"></span> has been changed to <span class="calibre2"/>; I guess having "/>" at the end without a separate </span> isn't enough to close it. so I guess that problem actually is with the conversion, not the viewing of it.

The Greek letters are replaced by their UTF-8 equivalents, but I don't see why that should be a problem.

Last edited by frabjous; 08-14-2009 at 02:01 PM.
frabjous is offline   Reply With Quote