Getting DocBook alt. text to work with apache fop

196 views Asked by At

I'm currently in the process of writing a larger DocBook document, and while it looks decent enough, I've been asked to improve the accessibility of it. After reading the documentation I figured, "that looks simple enough, I'll just add an <alt> element in there and that'll fix everything!" ...Needless to say this wasn't the case.

The way I've been including the keys images up 'till now;

<inlinemediaobject>
    <imageobject>
        <imagedata format="png" fileref="figs/key-down.png"/>
    </imageobject>
    <alt>down</alt>
</inlinemediaobject>

I opted for a graphic element over using <keycap> in this case as it makes the keys in the document look closer to the real thing. However just to cover all my bases I'm currently testing the following, but that didn't work either:

<keycap><alt>down</alt>&#x25bc;</keycap>

The screen reading software still can't read my alt-text.

Do I need to do any other type of configuration to get this to work in screen reading software, aside from simply running fop with the -a flag?

1

There are 1 answers

1
user5348283 On

I agree that making a document accessible is much more than just adding alt text. However, it's a good start, so to answer your question, I think that instead of you need to use the textobject element, for example:

<inlinemediaobject>
    <imageobject>
       <imagedata format="png" fileref="figs/key-down.png"/>
    </imageobject>
    <textobject>
        <para>Icon: key down</para>
    </textobject>
</inlinemediaobject>

Of course, this is two years later, but maybe it will help other viewers.