View Single Post
Old 04-04-2010, 11:55 PM   #1
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
HTML/CSS for (German) s p a c e d o u t emphasis

I'm working on digitalizing, and converting into a variety of formats, an old public domain text which contains both German text, and the translation thereof into English. The German side, rather than italics, uses wide s p a c i n g for emphasis.

I have a version in LaTeX format that works well, using the soul package for this purpose and it works fine for creating PDF versions. But of course I want others.

I've done most of the work converting this to XHTML and the version I currently have I'm using the CSS letter-spacing property as follows:

Code:
.spacedout {
    letter-spacing: 0.3em;
}
and then in the text
Code:
Wird ein Zeichen nicht <span class="spacedout">gebraucht</span>, so ist es bedeutungslos.
But there are two problems with this.

1. It seems to be handled differently, and non-optimally, by most browsers, and calibre's viewer. Most, for example, seem to generate:

Quote:
Wird ein Zeichen nicht g e b r a u c h t , so ist es bedeutungslos.
thus adding space after every character in the span, including the last one, in this case, adding an unnecessary and unsightly space before the comma.

If this were uniform for all browsers, I'd consider using a negative margin or padding amount at the end of the span to close that gap, but some browsers seem to generate:

Quote:
Wird ein Zeichen nicht g e b r a u c h t, so ist es bedeutungslos.
instead already. (Which also gives me reason not to end the span one character early, which would be sloppy coding anyway.)

But more importantly, this property is not supported in the ePub spec, and while some ePub viewers (such as Calibre's) support it anyway, ADE doesn't, which makes it pretty useless inside an ePub.

So what are my options?
  • I could insert non-breaking spaces between the letters, but this seems messy, and would throw off dictionaries, searches, word counts, etc.
  • I could put tags around each letter and use margins or padding to push them apart. But this would be a pain, and may have similar drawbacks to the above.
  • Can anyone think of anything thing else?
frabjous is offline   Reply With Quote