PreTeXtBook / pretext

PreTeXt: an authoring and publishing system for scholarly documents
https://pretextbook.org
Other
266 stars 208 forks source link

Accessibility features for icons #959

Open rbeezer opened 6 years ago

rbeezer commented 6 years ago

We now have some support for icons at #948. Do we need something like an image description to augment the character/icon for better accessibility?

Alex-Jordan commented 6 years ago

My initial reaction is no, if there is the corresponding unicode character name and we provide appropriate access to that. I imagine a screen reader encountering these and saying "gear character" or something. But this warrants end user research.

rbeezer commented 6 years ago

I've collected the Unicode names in the source as comments. They could be attributes in PTX source. Is there a way to make those strings available in a span, such as "alt"? It'd be trivial to implement for HTML and EPUB (and Jupyter).

On 09/16/2018 02:17 PM, Alex Jordan wrote:

My initial reaction is no, if there is the corresponding unicode character name and we provide appropriate access to that. I imagine a screen reader encountering these and saying "gear character" or something. But this warrants end user research.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rbeezer/mathbook/issues/959#issuecomment-421835209, or mute the thread https://github.com/notifications/unsubscribe-auth/ABy2cgZ95Cw5a-lpgTIBaf4LOUgR8m1Lks5ubr_egaJpZM4WrC4g.

rbeezer commented 6 years ago

Some answers here it seems, but I've not studied them carefully:

https://fontawesome.com/how-to-use/on-the-web/other-topics/accessibility

Alex-Jordan commented 6 years ago

I believe "alt" is not a recognized span attribute.

You are requiring icons that have a unicode counterpart, no? The simplest thing that occurs to me is for that unicode character to be in the HTML and let the screen reader's dictionary translate it. (If it fails, that is more of a failure on the part of the screen reader than the HTML source.)

In your example, I see <span class="fas fa-cog"></span>. But why not <span class="fas fa-cog">&#x2699;</span> and have the CSS replace the visual with what it currently does?

Side effect: there will be something showing there even before the CSS has been processed.

davidfarmer commented 6 years ago

The PreTeXt markup is semantic. If the character chosen by PreTeXt reserves that semantic information, then that is all we need. But if the character is chosen for its appearance, then we need to supply the meaning in another way.

This is the situation for the "menu" button in the current html. It looks like three horizontal lines, but (if I recall correctly) it is some Chinese character that has an unrelated meaning.

On Sun, 16 Sep 2018, Alex Jordan wrote:

My initial reaction is no, if there is the corresponding unicode character name and we provide appropriate access to that. I imagine a screen reader encountering these and saying "gear character" or something. But this warrants end user research.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.[AAM6LL_4NVlTlJ4LLEFsqzb2zmMSdRdKks5ubr_egaJpZM4WrC4g.gif]

rbeezer commented 6 years ago

it is some Chinese character that has an unrelated meaning.

"TRIGRAM FROM HEAVEN" and that is the Unicode character being supplied right now by PreTeXt.

Similarly, the Unicode character "FLOPPY DISK" is being used for a "File Save" icon, so it needs help as well.

Alex-Jordan commented 6 years ago

To me it is looking now like we should not rely on unicode being read correctly by screen readers. There are too many of them to test that they are all enhanced enough to read them properly. We could just print regular words, hidden by the CSS that is replacing the span content with the AF character.

Assuming that, then the question is do authors provide that phrase, or does PTX enforce particular words/phrases for each icon it has adopted? (Or a hybrid; PTX default that can be written over.)

davidfarmer commented 6 years ago

I think the only way to have things be correct and maintainable is if PreTeXt has a bunch of built-in icons, like

and , and those behave correctly with no input from the author.

If it turns out that there are real cases where an author needs to be able to create a new icon, we can deal with it then.

rbeezer commented 6 years ago

On 09/16/2018 06:14 PM, David W. Farmer wrote:

I think the only way to have things be correct and maintainable is if PreTeXt has a bunch of built-in icons, like

and , and those behave correctly with no input from the author.

Agreed, PTX should provide the strings as part of defining an icon.

I am being a bit less semantic than David suggests (but moreso than my first inclination). For example, CoCalc uses a wrench for project settings and a gear for account settings (or vice versa), simultaneously.

If it turns out that there are real cases where an author needs to be able to create a new icon, we can deal with it then.

Yes, I'm very much prepared to add more, given justification and use-cases. The Unicode is just for EPUB and Jupyter. I am optimistic that Font Awesome will provide a good alternative for HTML, which should be our main accessibility focus.