Conversation
62176ee to
e89b89f
Compare
|
Seems like a good addition overall, but I'm wondering whether we should just disallow that option for PDF/UA-1? Since it's really not encouraged to do this normally. |
I'm not very familiar with accessibility best practices, but the two use cases I've seen (code block line numbers, watermarks) might both be considered artifacts. Perhaps we could automatically put unselectable text in However, are all use cases of unselectable text artifacts? I can't think of any exceptions at the moment, but presumably they could exist?... |
Considering that the text is inaccessible when drawn as plain glyphs, it should always be considered an artifact. Failing to mark it as an artifact would imply that it is somehow real content, but since it isn't accessible it wouldn't comply with the PDF/UA-1 spec.
Yeah it feels a little too easy to degrade text this way. I'm wondering whether it may be a better idea to make this a semantic element, to make the consequences more obvious. Something like a more generalized |
Just to throw some ideas out there, how about a new element under the Visualize section, along with
Seems to fit pretty well in our case. We could call it A potential drawback is that we'd lose the most natural way to handle text in SVG images,
The current documentation for |
e89b89f to
6aacbfb
Compare
|
My two cents would be to leave the function as-is and force the user to manually wrap it in an artifact. Furthermore, I am not even sure that it would be allowed in UA either way. It goes against the PDF 2.0 spirit of having the artifacts in tree and being able to tag their insides, should the AT user choose to inspect the artifact. Finally, a document using this feature will for sure fail WCAG 2.2 clause 1.4.5 and documents using the function will thus fail to achieve WCAG AA conformance as well as conformance with standards based on it (e.g. EN 301 549). So that must be documented. |
New parameter: `text(selectable: true)`
6aacbfb to
23905f4
Compare
Okay, I've implemented the check. There are still a few design decisions left to resolve through.
The current wording of the diagnostics could probably be improved as well.
I found this specification on Well-Tagged PDF in PDF 2.0 on the PDF Association website, and it seems to suggest watermarks are a valid use of the artifact tag:
Adobe guidelines also talk about watermarks not being part of the tag tree:
|
23905f4 to
9c37af0
Compare
|
On 1: I would not require it if tagging was disabled.
I am aware that watermarks are a valid use of artifacts, my remark was on outlining the text within: This takes away the user's possibility to inspect the artifact in PDF 2.0. Put differently, what purpose does a "confidential" watermark serve when blind users can prove in court that they could not have been aware of it? |
|
The motivating examples here are line numbers and water marks. Both of these should be emitted as normal, accessible text with an artifact tag and a subtype. There is a Thus, it should be the responsibility of the viewer to turn the text unselectable in these cases instead of us outlining it. This also makes sense in thus far that both line numbers and watermark content can be relevant information for people with vision impairment. Currently, these subtypes are not exposed on In any case, this leaves the actual |
I was looking for a feature like this when I was using icon fonts such as FontAwesome which result in random Unicode sequences when copy & pasting. Using fonts for this (instead of embedding the SVGs) is very convenient because you can more easily adapt size, color and alignment to the document text. However, a better solution than non-selectable text would be to turn it into a path and even add alt-text to it, so I guess it's also not a very strong use case. |
|
I can think of other use cases where text is intended as graphical elements rather than readable content. For example, ASCII diagrams: Here, it might be desirable to make Unicode box-drawing characters unselectable without affecting the labels inside. There is also the treet package that generate tree lists like this: Another more niche example is the "glitch text" effect.
I saw this used in some web novels to add flavor to scenes, but it always makes me wince because of how terrible they are for screen readers. But with unselectable text, maybe it'd be possible to keep the visual presentation without affecting accessibility. |
You can actually make these accessible by adding an alternative description using the #figure(
alt: "Here's an example I'm sure you've seen on the internet at some point rendered with a lot of accents and decorators so it looks spooky",
)[
H̶͉̆e̸̠̚r̸̤̒ẻ̵̩'̸͕͝s̸̝̑ ̷̞̂à̸̹n̸̛̺ ̵̭͆e̷̞̕x̷̩̏ā̵̞m̵̞̃p̷̲̕l̶͇̽e̵̡̓.̵̙̍ ̷̟̀I̸̱͝'̶̹͋m̸̥̅ ̵͚̋s̵̱̕ȗ̷͈r̵͎̊ȅ̵̡ ̷͒ͅy̶͈̐o̶̢̽ṷ̸̓'̶͖͆v̸̫͐è̸͕ ̴͚̚s̵̛̳ë̶̬́e̴̢͌n̶̞̄ ̴̳͝t̴͉͛h̵͕̽i̵̜̇s̴̮̄ ̷̦̍ơ̶ͅn̶͉̽ ̸̛͙t̷͌ͅh̸̦͘ë̷̳́ ̷̬̇í̸͉ǹ̸̼t̴͙͑ë̵̝r̸͕͘n̸̠͝e̶̳̎t̸̝̾ ̵̡̛a̵̫͌t̷̙͛ ̴̳̀s̵̢̊ó̴̜m̷̭̂e̷͔̿ ̴̼̆p̵͍̐ő̵͕ǐ̶̢ň̴͕t̸̙́.̷̗̎
]AT will treat this element as a leaf, i.e. it will read the alt text and, by default, not expose the capability to drill down into the contents. However, the original text stays selectable and can be copied from the PDF. A limitation is that due to #7001, this pattern cannot be used for inline content. IMO, we might need a function to provide an alternative description that is not tightly coupled to figures. This will satisfy WCAG 2.2 Success Criterion 1.1.1 Non-text Content where non-text content is defined to include ASCII art. Also see F72: Failure of Success Criterion 1.1.1 due to using ASCII art without providing a text alternative. |
I also encountered this problem in my icon font use case. |
For this use case, I'd say that we have a multi-layered problem:
TL;DR: Don't outline icon fonts, instead, you need alt text and/or code point reassignment through |
Add a new parameter
set text(selectable: false)that resolves #2249.This particular design was previously proposed in #5789 and #5938 (comment).
This is my first PR in Typst and I'm not very familiar with the codebase. Please let me know if there's anything I missed!
Testing
Manually check the PDFs.
Example Use Cases
Limitations