If I’m trying to display sections of a play in HTML, how would I code it with an eye to screen readers? Not every line would be numbered, and each section would not necessarily start at “line one”.
I could make the entire text an ordered list, but that really messes up the readability. And it doesn’t really deliver the right semantics. I see the line numbers as basically being the same as a background image - they add a lot to the experience, but they’re not necessary. (Also, as I mentioned, the sections wouldn’t necessarily start at “1”, so a new ol for each section would actually be wrong.) (And it would be too much work to get only certain line numbers to be visible.)
For a brief, insane moment I considered making the line numbers one long image, and actually inserting them as a background image. But I would like them to be text, so that if the font size is upped or downed, the numbers go up or down with it.
I’m currently thinking of making two different p’s: one would have the numbers, with the appropriate number of br’s to space them correctly, and the next would have the actual text. Then I would float the line-number-p, in order to display it next to the play text.
But this seems like it would be a really weird thing for someone blind to come across. Any other way to do this?
If you had the line numbers and attached a class or ID value to them, surely you could create an aural / screen media type stylesheet to tell it not to read the numbers out. The whole point of aural speech stylesheets is to control how information is represented by screen reader devices. Stating not to read the information would certainly prove the point! Though I’m not sure how well screen readers obey the commands of such specific media types.
That only works if you can control the line length and guarantee that text will remain on the same line that you envisaged for everyone. Otherwise you’ll end up with 1. And then on the first day there was a very
long line
2. that took up more space than the designer
had allowed
3. because he didn’t think about other people’s
font sizes
and it will be a horrible horrible mess. Plus it’s a dreadful abuse of semantic markup to use a definition list to number your lines.
I think this is one of those features that isn’t going to be practicable with HTML - the level of presentational control you need is not compatible with the flexibility and variability of HTML. At this point, rather than have the headache of setting up something that is virtually impossible, I would just cheat and do it as a PDF!
Like I said, I see line numbers as non-essential, but dang they’d be nice. How would I use a dl? …Use the dd’s for the lines and the dt’s for the numbers (leaving the dt empty when I don’t want a number displayed)?
In this instance I took a “line” as being in the context of a “play” not what is being rendered on the screen. That is, one actor may have a “line” that could be quite a number of lines of text on the screen.
Yes I think a line number could be thought of as a “term”
<dl>
<dt>1</dt><dd>What ever is, is</dd>
<dt></dt><dd>uh. hmmm.</dd>
<dt>3</dt><dd>Pardon?</dd>
</dl>
It might take some fancy CSS to get it looking right, but I’m sure it would be more reliable than using images. It would “zoom” in sync and screen reader users could navigate to <h2>Act 3</h2><h3>Scene 1</h3><dt>3</dt> if they wanted to.