View Single Post
Old 04-06-2010, 06:52 PM   #14
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
Quote:
Originally Posted by Jellby View Post
Do you mean "properly", as the CSS spec says (no ligatures in spaced-out text), or as Germans like their texts (keep ligatures anyway)? My point is that maybe the letter-spacing is not the typographically optimal option, maybe it is better to substitute it by italics or similar...
I meant per the CSS spec. I'd only want them kept together if I were using blackletter fonts, but I'm not (nor did my original), and if I were I doubt I'd trust the renderer with the ligatures. I'd probably swap in the glyphs in the actual document, searchability be damned. Luckily that's not an issue.

The original publisher, even of the German text, was in England, so maybe that's why. Or maybe it was just past that period.

But apparently I was wrong about how smart Firefox is about this, although the results were strange. Testing this document:

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">

body
{
    font-family: 'Sorts Mill Goudy';
    font-size: 200%;
    letter-spacing: 0.2em;
}

</style>
 <title>LigTest</title>
</head>
<body>
My affinity for affluent fish living in fjords offended the flora.
</body>
</html>
I got different results depending on the font-size. (And not just the font-size selected by the CSS, but it even changed when I used Ctrl-minus and Ctrl-= to zoom in and out.)

Have a look see.



versus



(This is from the same file, just zooming in and out.)

Quote:
It just occurred to me trying with a <span> around every letter (or ligature), and styling this span with left and right margins... that should work pretty much everywhere, I don't think the <span>s add breakpoints or disturb text searching. This, of course, is only worth doing if there are just a few instances of spaced-out text.
I tested the suggestion of using separate span tags with margin-left and margin-right, and the results were better than I expected. Every viewer I tried was smart enough not to break at the wrong point, and the text was still searchable. Unfortunately, I have hundreds of emphasized passages in the document. It shouldn't be too hard to come up with a RegEx to insert them so I don't have to do them by hand, but it's still going to end up with messy code. I'll have to compare what adds more to my filesize too: inserting all these, or embedding another font per charleski's suggestion.
Attached Thumbnails
Click image for larger version

Name:	ligtest.png
Views:	840
Size:	54.4 KB
ID:	49358   Click image for larger version

Name:	ligtest2.png
Views:	862
Size:	48.5 KB
ID:	49359  

Last edited by frabjous; 04-06-2010 at 06:57 PM.
frabjous is offline   Reply With Quote