How to test what happens when graphics aren't supported (Glulx), and how interpreters handle alt text

How do people test what happens when graphics aren’t supported? Is there a Glulx interpreter that definitely doesn’t support graphics? (It looks like most of the stable Glulx interpreters on IFWiki do support graphics. There are some interpreters that have no multimedia information listed, so I don’t know if they support graphics or not.)

I was trying to figure out how accessibility text appears for images. In the IDE, which supports graphics, that text is not showing up. In an interpreter that does not support graphics–does the alt text automatically display in brackets or something? Is there also a failure message?

What does it look like if there’s no alt text?

Is there a way to turn off interpreter features (or pretend to) for testing purposes?

People usually add a “can you see this image” question that sets a variable.

I think missing graphics support is more likely to be because of the medium, rather than the interpreter. That is to say, it would be someone using a screen reader or something. So, you could try doing that.

But if there’s an interpreter that runs on the command line, that would likely be a good test case as well.

I’m pretty sure graphical applications still render their graphical output even when running on a system that uses a screen reader and lacks a physical screen.

I’m not sure what you’re trying to say there. If there’s no screen, a graphical application cannot render its graphical output, by definition. It may be that, technically speaking, the code still renders it to a “virtual screen”, but I don’t think that counts.

Part of my question here is trying to figure out what interpreters do with Inform 7’s accessibility text (mentioned in chapter 23.9 in the documentation, at least in 6M62). I thought it might show up as sort of a caption under a graphic, but that doesn’t seem to be happening. I don’t know if it’s automatically used at all.

If it doesn’t get automatically used, I wonder if it can be used manually, and if so, how.

The Glulxe interpreter, when built against GlkTerm (or glktermw), does the trick.

(That’s only not included on the wiki list you linked because there isn’t a single executable that page can link to. But it’s widely available in Linux distro package managers, and apparently in Homebrew for Mac OS X. I dunno whether there’s a prebuilt Windows console version somewhere. There are various binaries at the IF Archive, but they might be too old to be useful. It shouldn’t be too harrowing to build from source if you need to, with basic knowledge of doing that sort of thing, due to its minimal dependencies.)

1 Like

The following is wrong, see replies

This is a bit of a tricky case! But here’s what the specs say.

The Glulx VM has no concept of images or graphics at all. Everything it does, it does via text. But a Glulx program can choose an I/O system, and this choice is basically always Glk. Except in a few really weird edge cases (like the Textfyre project), Glulx programs will always be tightly coupled to the Glk interface.

The Glk interface has no way of testing whether a specific image can be drawn or not. It also has no concept of alt text. But a program can ask “are you capable of drawing images in general?” and the particular Glk implementation will say yes or no.[1]

So, when you tell Inform 7 to display an image, what it does is:

  • Ask Glk if it can display images
  • If yes, display the image
  • Otherwise, display the alt text

But that’s entirely on Inform’s side. If the Glk implementation is, say, running in a web browser, it has no way of putting the alt text into the image’s alt attribute: it just tells Inform “yes I can display images”, so Inform never prints the alt text anywhere.

This means that alt text isn’t useful in any interpreter that supports graphics at all, only in interpreters with absolutely no graphics capabilities (like the glkterm version of Glulx shown above). If you want more fine-grained control, you’ll need to do it yourself in Inform 7 code: ask at the beginning “can you see this image (or its alt text)?”, and if the user says no, then print your own descriptions instead of drawing images elsewhere in your code.

This is distinctly not ideal, but it’s the current state of the situation. I might suggest a new Glk call, glk_set_image_alt, which sets the alt-text for the next image printed (as a separate call because there are so many different ways to draw an image now). Implementations for which this is meaningful can then shove it into their <img /> element or whatever, while others ignore it.


  1. Well, technically, you can also ask “are you capable of scaling images?” and “are you capable of arranging images in fancy ways?” and “are you capable of using transparency?”, but none of those are relevant here. ↩︎

1 Like

Hm, does the image description from the Inform 7 source not make its way into the Blorb Resource Description Chunk, thus making it available to graphical interpreters?

I haven’t tried it myself, but the release notes suggest it does.

2 Likes

Ah, I was wrong about that! I didn’t realize that changed as long ago as 6L02, I thought it was an upcoming thing. Good catch!

Yeah, I thought “wasn’t alt text added to some IF format recently?” and it was… in 2014 :old_man::skull:

Thanks!

Do you know if there any interpreters that support graphics and also make use of alt text?

Parchment should I think.

I tried using iplayif to run a sample project on my machine that has an image, and I didn’t see any alt text. I also tried turning off images in my browser, and saw an icon of a broken picture that says “Image 3” next to it, but not the alt text.

Spatterlight (Mac only) claims to as of 1.2.7.

The thread where the Spatterlight developer was talking about adding it says Lectrote does too. (I haven’t checked that.)

Thanks.

I can’t check Spatterlight, but I just checked a sample project with an image in Lectrote 1.5.2, and I don’t see any alt text. I also don’t see any settings related to alt text in the menu.

(I’m also not actually sure where the alt text would be used, so I’m not sure what I should be looking for.)

Oh, yep it’s supported by AsyncGlk, but I didn’t add support to RemGlk-rs yet.

Lectrote supports alt text, in the sense that it adds the alt text to the HTML content displayed by the Electron framework.

I haven’t tested how that interacts with accessibility tools (VoiceOver, etc).

2 Likes

Is that Lectrote or Quixe? (I’m asking because the screenshot says Quixe, and I’m still not having success in getting the alt text to show up in Lectrote.)

Lectrote uses Quixe as a component, I think.
(Similar to how my Gargoyle screenshot’s title bar says “Glulxe”.)

At this point, might be worth examining the Blorb file coming out of your sample project to check whether it actually has Resource Description Chunks?
(And/or using an existing compiled Blorb file which is known to have them; this thread claims to know of some, although I haven’t double-checked myself.)

1 Like