ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] Images and Accessibility (ConTeXt LMTX 2025.04.28)
@ 2025-04-29 17:13 Matthias Weber
  2025-04-29 19:20 ` [NTG-context] " Pablo Rodriguez via ntg-context
  2025-04-29 22:50 ` Ulrike Fischer
  0 siblings, 2 replies; 12+ messages in thread
From: Matthias Weber @ 2025-04-29 17:13 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Dear All, 

I am starting a new thread as requested.

I can confirm that 


> 
> the following should work with current latest (from yesterday,
> LuaMetaTeX 2.11.07 20250427 + ConTeXt LMTX 2025.04.28 14:29):
> 
>  \enabledirectives [backend.usetags=testing]
>  \setuptagging[state=start]
>  \setupstructure[state=start]
>  \setupbackend
>    [format=PDF/A-3a]
>  \setupbackend[format=pdf/ua-1]
>  \setupexternalfigures[location=default]
>  \starttext
>  \externalfigure[hacker][label={this is an image}]
> 
>  \startparagraph
>    a
>  \stopparagraph
>  \stoptext

produces a PDF that passes the accessibility check in the current Adobe Acrobat. In particular, it passes the alternate text checks.
Hovering over the image shows the alternate text in Acrobat.
However, VoiceOver (on the Mac) does not read the alternate text; it completely ignores the existence of the image.
In Preview, no alternate text is shown or read. So it seems that the only benefit is that readers with vision can see an alternate text...

I don’t have access to a Windows machine, so I cannot test what other screen readers can do with this document.


Thanks,

Matthias
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [NTG-context] Re: Images and Accessibility (ConTeXt LMTX 2025.04.28)
  2025-04-29 17:13 [NTG-context] Images and Accessibility (ConTeXt LMTX 2025.04.28) Matthias Weber
@ 2025-04-29 19:20 ` Pablo Rodriguez via ntg-context
  2025-04-29 21:17   ` Matthias Weber
  2025-04-29 22:50 ` Ulrike Fischer
  1 sibling, 1 reply; 12+ messages in thread
From: Pablo Rodriguez via ntg-context @ 2025-04-29 19:20 UTC (permalink / raw)
  To: ntg-context; +Cc: Pablo Rodriguez

On 4/29/25 19:13, Matthias Weber wrote:
> Dear All, 
> 
> I am starting a new thread as requested.

Hi Matthias,

> I can confirm that 
> [...]
> produces a PDF that passes the accessibility check in the current> Adobe Acrobat. In particular, it passes the alternate text checks.
> Hovering over the image shows the alternate text in Acrobat.

I think that alternate texts are primarily intended to be read aloud.

In fact, the older PDF specification (the only one publicly avaiblable)
describes them as (third row from
https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/PDF32000_2008.pdf#page=567):

   An alternate description of the structure element and its
   children in human-readable form, which is useful when extracting
   the document’s contents in support of accessibility to users with
   disabilities or for other purposes.

Displaying the alternate text when hovering the image is not in support
of accessibility (I think), but just for other purposes.

> However, VoiceOver (on the Mac) does not read the alternate text; it
> completely ignores the existence of the image.
> 
> In Preview, no alternate text is shown or read. So it seems that the> only benefit is that readers with vision can see an alternate
> text...

Sorry, could it be possible that both programs might not comply with
accessibility as PDF requires it?

Or do both programs read aloud the alternative text for the
»Bundesadler« from
https://www.recht.bund.de/bgbl/1/2025/104/regelungstext.pdf?__blob=publicationFile&v=3?

Your final comment on the only benefit is not clear to me.
Visually-impaired living beings (not especially humans) may find easier
listening to sound or voices than seeing in general.

> I don’t have access to a Windows machine, so I cannot test what
> other screen readers can do with this document.

I think the Accessibility Directive requires reading programs to comply
by making them accessible (sorry, bad wording, but I guess it is clear
what I mean [let me know if it is not]).

I hope it helps,

Pablo
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [NTG-context] Re: Images and Accessibility (ConTeXt LMTX 2025.04.28)
  2025-04-29 19:20 ` [NTG-context] " Pablo Rodriguez via ntg-context
@ 2025-04-29 21:17   ` Matthias Weber
  2025-04-30 15:45     ` Pablo Rodriguez via ntg-context
  0 siblings, 1 reply; 12+ messages in thread
From: Matthias Weber @ 2025-04-29 21:17 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Pablo,

I was merely reporting what Previews and Acrobat on the Mac do with the current image accessibility provided by ConTeXt.
I have no idea whether that is enough for vision-impaired people. It might be that there are screen readers available that do a perfect job. At some point I will need to produce documents that are accessible. For that my documents will have to pass a test (to which I don’t have access before submitting the document…). I have no idea whether “passing the test” means that the document is usable for someone with vision impairment. Of course I would like that to be the case, too, but my abilities to test for any of that are limited.

I tried  the first page from https://www.recht.bund.de/bgbl/1/2025/104/regelungstext.pdf?__blob=publicationFile&v=3?.

It passes Acrobat’s accessibility check, hovering over the image produces the alternate text, letting Acrobat read the document ignores the Bundesadler. 
When I use VoiceOver in Preview, it detects the image group and speaks the alternate text. But VoiceOver does not seem to be able to read the rest of the page. When, on the other hand, I let Preview read the entire page, it ignores the Bundesadler. 

What would help is if someone with access to a screen reader  like JAWS or NVDA can report what it does with the compiled example in ConTexT.

I am having similar issues with having formulas read on the Mac. I can see the XML attachments in Acrobat, but what Acrobat or Preview do with them is horrendous.

And as for my final comment about the “only benefit”: It seems to me that the two programs I tried on the Mac are bringing no benefit to the vision-impaired. That’s said, but nothing ConTeXt can help with. It just makes everything more complicated, because I have no means of telling whether what I am trying to do to make documents accessible is effective in any way.

Matthias

> On Apr 29, 2025, at 3:20 PM, Pablo Rodriguez via ntg-context <ntg-context@ntg.nl> wrote:
> 
> On 4/29/25 19:13, Matthias Weber wrote:
>> Dear All, 
>> 
>> I am starting a new thread as requested.
> 
> Hi Matthias,
> 
>> I can confirm that 
>> [...]
>> produces a PDF that passes the accessibility check in the current> Adobe Acrobat. In particular, it passes the alternate text checks.
>> Hovering over the image shows the alternate text in Acrobat.
> 
> I think that alternate texts are primarily intended to be read aloud.
> 
> In fact, the older PDF specification (the only one publicly avaiblable)
> describes them as (third row from
> https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/PDF32000_2008.pdf#page=567):
> 
>   An alternate description of the structure element and its
>   children in human-readable form, which is useful when extracting
>   the document’s contents in support of accessibility to users with
>   disabilities or for other purposes.
> 
> Displaying the alternate text when hovering the image is not in support
> of accessibility (I think), but just for other purposes.
> 
>> However, VoiceOver (on the Mac) does not read the alternate text; it
>> completely ignores the existence of the image.
>> 
>> In Preview, no alternate text is shown or read. So it seems that the> only benefit is that readers with vision can see an alternate
>> text...
> 
> Sorry, could it be possible that both programs might not comply with
> accessibility as PDF requires it?
> 
> Or do both programs read aloud the alternative text for the
> »Bundesadler« from
> https://www.recht.bund.de/bgbl/1/2025/104/regelungstext.pdf?__blob=publicationFile&v=3?
> 
> Your final comment on the only benefit is not clear to me.
> Visually-impaired living beings (not especially humans) may find easier
> listening to sound or voices than seeing in general.
> 
>> I don’t have access to a Windows machine, so I cannot test what
>> other screen readers can do with this document.
> 
> I think the Accessibility Directive requires reading programs to comply
> by making them accessible (sorry, bad wording, but I guess it is clear
> what I mean [let me know if it is not]).
> 
> I hope it helps,
> 
> Pablo
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki     : https://wiki.contextgarden.net
> ___________________________________________________________________________________

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [NTG-context] Re: Images and Accessibility (ConTeXt LMTX 2025.04.28)
  2025-04-29 17:13 [NTG-context] Images and Accessibility (ConTeXt LMTX 2025.04.28) Matthias Weber
  2025-04-29 19:20 ` [NTG-context] " Pablo Rodriguez via ntg-context
@ 2025-04-29 22:50 ` Ulrike Fischer
  2025-04-30  3:19   ` Wolfgang Schuster
  2025-04-30 16:06   ` Pablo Rodriguez via ntg-context
  1 sibling, 2 replies; 12+ messages in thread
From: Ulrike Fischer @ 2025-04-29 22:50 UTC (permalink / raw)
  To: ntg-context

Am Tue, 29 Apr 2025 13:13:39 -0400 schrieb Matthias Weber:

> Dear All, 
> 
> I am starting a new thread as requested.
> 
> I can confirm that 
> 
> 
>> 
>> the following should work with current latest (from yesterday,
>> LuaMetaTeX 2.11.07 20250427 + ConTeXt LMTX 2025.04.28 14:29):
>> 
>>  \enabledirectives [backend.usetags=testing]
>>  \setuptagging[state=start]
>>  \setupstructure[state=start]
>>  \setupbackend
>>    [format=PDF/A-3a]
>>  \setupbackend[format=pdf/ua-1]
>>  \setupexternalfigures[location=default]
>>  \starttext
>>  \externalfigure[hacker][label={this is an image}]
>> 
>>  \startparagraph
>>    a
>>  \stopparagraph
>>  \stoptext
> 
> produces a PDF that passes the accessibility check in the current Adobe Acrobat. In particular, it passes the alternate text checks.
> Hovering over the image shows the alternate text in Acrobat.
> However, VoiceOver (on the Mac) does not read the alternate text;

The pdf produced by context maps every structure to NonStruct, that
means there is no tagging structure, it only fools the accessibility
check. You can and should not claim that this an ua-1 file. You can
check the structure by uploading your pdf to
https://texlive.net/showtags, that will produce an xml from the
structure.

I don't know if the missing structure is the reason that VoiceOver
fails, as I'm on windows, but you could try with a LaTeX document.
Go to https://texlive.net/ngpdf and compile there this example:

\DocumentMetadata{tagging=on}
\documentclass{article}
\usepackage{graphicx}
\begin{document}
some text

\includegraphics[alt=an image with a duck]{example-image-duck}
\end{document}

After the compilation you can download the pdf and compare the
reading.

I made a fast check with Adobe + NVDA: it reads the actual text of
your image, but it doesn't announce that there is graphic. So for
the context file you get simply 

    this is an image

while the LaTeX file is read as

   graphic an image with a duck.




-- 
Ulrike Fischer 
http://www.troubleshooting-tex.de/

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [NTG-context] Re: Images and Accessibility (ConTeXt LMTX 2025.04.28)
  2025-04-29 22:50 ` Ulrike Fischer
@ 2025-04-30  3:19   ` Wolfgang Schuster
  2025-04-30 16:06   ` Pablo Rodriguez via ntg-context
  1 sibling, 0 replies; 12+ messages in thread
From: Wolfgang Schuster @ 2025-04-30  3:19 UTC (permalink / raw)
  To: ntg-context

[-- Attachment #1: Type: text/plain, Size: 2242 bytes --]

Am 30.04.2025 um 00:50 schrieb Ulrike Fischer:
> Am Tue, 29 Apr 2025 13:13:39 -0400 schrieb Matthias Weber:
> 
>> Dear All,
>>
>> I am starting a new thread as requested.
>>
>> I can confirm that
>>
>>
>>>
>>> the following should work with current latest (from yesterday,
>>> LuaMetaTeX 2.11.07 20250427 + ConTeXt LMTX 2025.04.28 14:29):
>>>
>>>   \enabledirectives [backend.usetags=testing]
>>>   \setuptagging[state=start]
>>>   \setupstructure[state=start]
>>>   \setupbackend
>>>     [format=PDF/A-3a]
>>>   \setupbackend[format=pdf/ua-1]
>>>   \setupexternalfigures[location=default]
>>>   \starttext
>>>   \externalfigure[hacker][label={this is an image}]
>>>
>>>   \startparagraph
>>>     a
>>>   \stopparagraph
>>>   \stoptext
>>
>> produces a PDF that passes the accessibility check in the current Adobe Acrobat. In particular, it passes the alternate text checks.
>> Hovering over the image shows the alternate text in Acrobat.
>> However, VoiceOver (on the Mac) does not read the alternate text;
> 
> The pdf produced by context maps every structure to NonStruct, that
> means there is no tagging structure, it only fools the accessibility
> check. You can and should not claim that this an ua-1 file. You can
> check the structure by uploading your pdf to
> https://texlive.net/showtags, that will produce an xml from the
> structure.
> 
> I don't know if the missing structure is the reason that VoiceOver
> fails, as I'm on windows, but you could try with a LaTeX document.
> Go to https://texlive.net/ngpdf and compile there this example:
> 
> \DocumentMetadata{tagging=on}
> \documentclass{article}
> \usepackage{graphicx}
> \begin{document}
> some text
> 
> \includegraphics[alt=an image with a duck]{example-image-duck}
> \end{document}
> 
> After the compilation you can download the pdf and compare the
> reading.
> 
> I made a fast check with Adobe + NVDA: it reads the actual text of
> your image, but it doesn't announce that there is graphic. So for
> the context file you get simply
> 
>      this is an image
> 
> while the LaTeX file is read as
> 
>     graphic an image with a duck.

Hi Ulrike,

you should try the ConTeXt example with the attached tag name mapping 
Pablo sent to the list a while ago.

Wolfgang

[-- Attachment #2: lpdf-tag-imp-testing.lmt --]
[-- Type: text/plain, Size: 13839 bytes --]

if not modules then modules = { } end modules ['lpdf-tag-imp-testing'] = {
    version   = 1.001,
    comment   = "companion to lpdf-tag.mkiv",
    author    = "Hans Hagen & Mikael Sundqvist",
    copyright = "PRAGMA ADE / ConTeXt Development Team",
    license   = "see context related readme files"
}

-- You can enable this at your own risk by saying:
--
-- \enabledirectives[backend.usetags=testing]
--
-- which will try to satisfy the sloppy mapping in pdf. You can also use this file to
-- roll out your own variant. We also use this file for testing so there coule be subtle
-- changes over time.

return {
    name      = "old school pdf tagging",
    version   = "1.00",
    comment   = "This is our crappy level two mapping, sort of an example.",
    author    = "Hans Hagen",
    copyright = "ConTeXt development team",
    mapping   = {

        -- Part      : no structure
        -- Sect      : structure
        -- NonStruct : skip level
        -- Sub       : line with lbl numbers

        document           = { pua = "ua1", pdf = "Document"   },
        documentpart       = { pua = "ua1", pdf = "NonStruct"  },

        division           = { pua = "ua1", pdf = "Part"       },
        paragraph          = { pua = "ua1", pdf = "P"          },
        subparagraph       = { pua = "ua1", pdf = "P"          },
        p                  = { pua = "ua1", pdf = "P"          },
        highlight          = { pua = "ua1", pdf = "Span"       },
        ornament           = { pua = "ua1", pdf = "Span"       },
        textdisplay        = { pua = "ua1", pdf = "Div"        },
        placeholder        = { pua = "ua1", pdf = "Span"       },

        ["break"]          = { pua = "ua1", pdf = "Div"        },

        construct          = { pua = "ua1", pdf = "Span"       },
        constructleft      = { pua = "ua1", pdf = "Span"       },
        constructright     = { pua = "ua1", pdf = "Span"       },
        constructcontent   = { pua = "ua1", pdf = "NonStruct"  },

        sectionblock       = { pua = "ua1", pdf = "Part"       },

        section            = { pua = "ua1", pdf = "Sect"       }, -- Part
        sectioncaption     = { pua = "ua1", pdf = "NonStruct"  },
        sectiontitle       = { pua = "ua1", pdf = "H"          },
        sectionnumber      = { pua = "ua1", pdf = "Lbl"        },
        sectioncontent     = { pua = "ua1", pdf = "NonStruct"  },

        itemgroup          = { pua = "ua1", pdf = "L"          },
        item               = { pua = "ua1", pdf = "LI"         },
        itemtag            = { pua = "ua1", pdf = "Lbl"        },
        itemcontent        = { pua = "ua1", pdf = "LBody"      },
        itemhead           = { pua = "ua1", pdf = "NonStruct"  },
        itembody           = { pua = "ua1", pdf = "NonStruct"  },

        items              = { pua = "ua1", pdf = "Div"        },
        itemsymbols        = { pua = "ua1", pdf = "Div"        },
        itemsymbol         = { pua = "ua1", pdf = "Span"       },
        itemtexts          = { pua = "ua1", pdf = "Div"        },
        itemtext           = { pua = "ua1", pdf = "Span"       },

        description        = { pua = "ua1", pdf = "Sect"       },
        descriptiontag     = { pua = "ua1", pdf = "Lbl"        },
        descriptioncontent = { pua = "ua1", pdf = "NonStruct"  },
        descriptionsymbol  = { pua = "ua1", pdf = "Lbl"        },

        verbatimblock      = { pua = "ua1", pdf = "Part"       },
        verbatimlines      = { pua = "ua1", pdf = "Part"       },
        verbatimline       = { pua = "ua1", pdf = "Code"       },
        verbatim           = { pua = "ua1", pdf = "Code"       },

        lines              = { pua = "ua1", pdf = "Part"       },
        line               = { pua = "ua1", pdf = "Code"       },
        linenumber         = { pua = "ua1", pdf = "Span"       },

        synonym            = { pua = "ua1", pdf = "Span"       },
        sorting            = { pua = "ua1", pdf = "Span"       },

        register           = { pua = "ua1", pdf = "Part"       },
        registerlocation   = { pua = "ua1", pdf = "Span"       },
        registersection    = { pua = "ua1", pdf = "Part"       },
        registertag        = { pua = "ua1", pdf = "Span"       },
        registerentries    = { pua = "ua1", pdf = "Part"       },
        registerentry      = { pua = "ua1", pdf = "Part"       },
        registercontent    = { pua = "ua1", pdf = "Span"       },
        registersee        = { pua = "ua1", pdf = "Span"       },
        registerpages      = { pua = "ua1", pdf = "Span"       },
        registerpage       = { pua = "ua1", pdf = "Span"       },
        registerseparator  = { pua = "ua1", pdf = "Span"       },
        registerpagerange  = { pua = "ua1", pdf = "Span"       },

        table              = { pua = "ua1", pdf = "Table"      },
        tablerow           = { pua = "ua1", pdf = "TR"         },
        tablecell          = { pua = "ua1", pdf = "TD"         },
        tableheadcell      = { pua = "ua1", pdf = "TH"         },
        tablehead          = { pua = "ua1", pdf = "THEAD"      },
        tablebody          = { pua = "ua1", pdf = "TBODY"      },
        tablefoot          = { pua = "ua1", pdf = "TFOOT"      },

        tabulate           = { pua = "ua1", pdf = "Table"      },
        tabulaterow        = { pua = "ua1", pdf = "TR"         },
        tabulatecell       = { pua = "ua1", pdf = "TD"         },
        tabulateheadcell   = { pua = "ua1", pdf = "TH"         },
        tabulatehead       = { pua = "ua1", pdf = "THEAD"      },
        tabulatebody       = { pua = "ua1", pdf = "TBODY"      },
        tabulatefoot       = { pua = "ua1", pdf = "TFOOT"      },

        list               = { pua = "ua1", pdf = "TOC"        },
        listitem           = { pua = "ua1", pdf = "TOCI"       },
        listtag            = { pua = "ua1", pdf = "Lbl"        },
        listcontent        = { pua = "ua1", pdf = "NonStruct"  },
        listdata           = { pua = "ua1", pdf = "NonStruct"  },
        listpage           = { pua = "ua1", pdf = "Lbl"        },
        listtext           = { pua = "ua1", pdf = "Span"       },

        delimitedblock     = { pua = "ua1", pdf = "BlockQuote" },
        delimited          = { pua = "ua1", pdf = "Quote"      },
        delimitedcontent   = { pua = "ua1", pdf = "NonStruct"  },
        delimitedsymbol    = { pua = "ua1", pdf = "Span"       },

        subsentence        = { pua = "ua1", pdf = "Span"       },
        subsentencecontent = { pua = "ua1", pdf = "Span"       },
        subsentencesymbol  = { pua = "ua1", pdf = "Span"       },

        label              = { pua = "ua1", pdf = "Span"       },
        number             = { pua = "ua1", pdf = "Span"       },

        float              = { pua = "ua1", pdf = "Part"       },
        floatcaption       = { pua = "ua1", pdf = "Caption"    },
        floatlabel         = { pua = "ua1", pdf = "Span"       },
        floatnumber        = { pua = "ua1", pdf = "Span"       },
        floattext          = { pua = "ua1", pdf = "Span"       },
        floatcontent       = { pua = "ua1", pdf = "NonStruct"  },

        image              = { pua = "ua1", pdf = "Figure"  },
        mpgraphic          = { pua = "ua1", pdf = "Figure"  },

        formulaset         = { pua = "ua1", pdf = "Part"       },
        formula            = { pua = "ua1", pdf = "Formula"       },
        formulacaption     = { pua = "ua1", pdf = "Span"       },
        formulalabel       = { pua = "ua1", pdf = "Span"       },
        formulanumber      = { pua = "ua1", pdf = "Span"       },
        formulacontent     = { pua = "ua1", pdf = "NonStruct"  },
        subformula         = { pua = "ua1", pdf = "Part"       },

        link               = { pua = "ua1", pdf = "Link"       },
        reference          = { pua = "ua1", pdf = "NonStruct"  },

        navigation         = { pua = "ua1", pdf = "NonStruct"  },
        navigationbutton   = { pua = "ua1", pdf = "NonStruct"  },
        navigationmenu     = { pua = "ua1", pdf = "NonStruct"  },
        navigationmenuitem = { pua = "ua1", pdf = "NonStruct"  },
        navigationaction   = { pua = "ua1", pdf = "NonStruct"  },
        navigationpage     = { pua = "ua1", pdf = "NonStruct"  },

        margintextblock    = { pua = "ua1", pdf = "Aside"      },
        margintext         = { pua = "ua1", pdf = "NonStruct"  },
        marginanchor       = { pua = "ua1", pdf = "Span"       },

        linetext           = { pua = "ua1", pdf = "NonStruct"  },

        -- no math here

        ignore             = { pua = "ua1", pdf = "NonStruct"  },
        private            = { pua = "ua1", pdf = "NonStruct"  },
        metadata           = { pua = "ua1", pdf = "Part"       },
        metavariable       = { pua = "ua1", pdf = "Span"       },

        mid                = { pua = "ua1", pdf = "Span"       },
        sub                = { pua = "ua1", pdf = "Span"       },
        sup                = { pua = "ua1", pdf = "Span"       },
        subsup             = { pua = "ua1", pdf = "Span"       },

        combination        = { pua = "ua1", pdf = "Table"      },
        combinationpair    = { pua = "ua1", pdf = "TR"         },
        combinationcontent = { pua = "ua1", pdf = "TD"         },
        combinationcaption = { pua = "ua1", pdf = "TD"         },

        publications       = { pua = "ua1", pdf = "Part"       },
        publication        = { pua = "ua1", pdf = "NonStruct"  },
        pubfld             = { pua = "ua1", pdf = "Span"       },

        citation           = { pua = "ua1", pdf = "Span"       },
        cite               = { pua = "ua1", pdf = "Span"       },

        narrower           = { pua = "ua1", pdf = "Part"       },

        block              = { pua = "ua1", pdf = "Part"       },

        userdata           = { pua = "ua1", pdf = "Part"       },

        quantity           = { pua = "ua1", pdf = "Span"       },
        unit               = { pua = "ua1", pdf = "Span"       },

        verse              = { pua = "ua1", pdf = "Part"       },
        versetag           = { pua = "ua1", pdf = "Lbl"        },
        verseseparator     = { pua = "ua1", pdf = "Span"       },
        versecontent       = { pua = "ua1", pdf = "NonStruct"  },

    },

    -- This is a hack to get around the specifications "We can't expect an
    -- application to keep track of nested H's (but otherwise expect very complex
    -- things things to be properly dealt with)". A typical example of bugs
    -- becoming features, standards being not really standards as they get
    -- adapted, etc. That said: it is up to the user to decide what to do but
    -- don't blame us for the resulting less optimal structure.

    -- Because we don't want to spoil the otherwise rather clean structure in
    -- ConTeXt, this kicks in very late in the backend. We might extend this
    -- hackery but there are limits to what is desired. After all, in over a
    -- decade of pdf tagging nothing significant happened (we're speaking 2024)
    -- nor proper viewer support showed up and we can anyway expect LLM's to deal
    -- with proper tags anyway some day.

    overloads = {

        -- criterium : parent    : use parent "detail"
        --             parents   : use first in parent "parents" list
        --             otherwise : look at self "detail"

        -- We need violate the proper structure by getting a Hn on the title so we
        -- have to backtrack to what we're in, thereby also denying the proper
        -- section instance. Don't ask. The plural "parents" will make sure we
        -- consult the first in the chain and not the instance that is encoded in
        -- "detail".

        sectioncaption = {
            criterium = "parents",
            mapping   = {

                part                         = { pua = "ua1", tag = "section_title_1",  pdf = "H1"  },

                chapter                      = { pua = "ua1", tag = "section_title_2",  pdf = "H2"  },
                title                        = { pua = "ua1", tag = "subject_title_2",  pdf = "H2"  },

                section                      = { pua = "ua1", tag = "section_title_3",  pdf = "H3"  },
                subject                      = { pua = "ua1", tag = "subject_title_3",  pdf = "H3"  },

                subsection                   = { pua = "ua1", tag = "section_title_4",  pdf = "H4"  },
                subsubject                   = { pua = "ua1", tag = "subject_title_4",  pdf = "H4"  },

                subsubsection                = { pua = "ua1", tag = "section_title_5",  pdf = "H5"  },
                subsubsubject                = { pua = "ua1", tag = "subject_title_5",  pdf = "H5"  },

                subsubsubsection             = { pua = "ua1", tag = "section_title_6",  pdf = "H6"  },
                subsubsubsubject             = { pua = "ua1", tag = "subject_title_6",  pdf = "H6"  },

                subsubsubsubsection          = { pua = "ua1", tag = "section_title_7",  pdf = "H7"  },
                subsubsubsubsubject          = { pua = "ua1", tag = "subject_title_7",  pdf = "H7"  },

                subsubsubsubsubsection       = { pua = "ua1", tag = "section_title_8",  pdf = "H8"  },
                subsubsubsubsubsubject       = { pua = "ua1", tag = "subject_title_8",  pdf = "H8"  },

                subsubsubsubsubsubsection    = { pua = "ua1", tag = "section_title_9",  pdf = "H9"  },
                subsubsubsubsubsubsubject    = { pua = "ua1", tag = "subject_title_9",  pdf = "H9"  },

                subsubsubsubsubsubsubsection = { pua = "ua1", tag = "section_title_10", pdf = "H10" },
                subsubsubsubsubsubsubsubject = { pua = "ua1", tag = "subject_title_10", pdf = "H10" },

            },
        },
    },

}

[-- Attachment #3: Type: text/plain, Size: 511 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [NTG-context] Re: Images and Accessibility (ConTeXt LMTX 2025.04.28)
  2025-04-29 21:17   ` Matthias Weber
@ 2025-04-30 15:45     ` Pablo Rodriguez via ntg-context
  0 siblings, 0 replies; 12+ messages in thread
From: Pablo Rodriguez via ntg-context @ 2025-04-30 15:45 UTC (permalink / raw)
  To: ntg-context; +Cc: Pablo Rodriguez

On 4/29/25 23:17, Matthias Weber wrote:
> Hi Pablo,
> 
> I was merely reporting what Previews and Acrobat on the Mac do with
> the current image accessibility provided by ConTeXt.

Hi Matthias,

the issue here may be that there might be be software not being able to
read aloud PDF/UA documents properly.

> I have no idea whether that is enough for vision-impaired people. It
> might be that there are screen readers available that do a perfect job.
> At some point I will need to produce documents that are accessible. For
> that my documents will have to pass a test (to which I don’t have access
> before submitting the document…). I have no idea whether “passing the
> test” means that the document is usable for someone with vision
> impairment. Of course I would like that to be the case, too, but my
> abilities to test for any of that are limited.

A perfectly opaque process, the one you mention for accesibility
testing. Far from ideal (to say the least).

> I tried  the first page from https://www.recht.bund.de/bgbl/1/2025/104/regelungstext.pdf?__blob=publicationFile&v=3.
> 
> It passes Acrobat’s accessibility check, hovering over the image
> produces the alternate text, letting Acrobat read the document
> ignores the Bundesadler.

Sorry, I understood the opposite, namely Acrobat read aloud the
alternate text for the image
(https://mailman.ntg.nl/archives/list/ntg-context@ntg.nl/message/K5EHLCFPVSOI6VQ4ORIY4SCH424BWYGV/).

The PDF document should be the same as then, so what is different now?

As for other software, I’m totally ignorant. As far as the PDF/UA is ok,
this is fine for me.

This isn’t that I do not care, but something more complex.

> I am having similar issues with having formulas read on the Mac. I
> can see the XML attachments in Acrobat, but what Acrobat or Preview
> do with them is horrendous.

PDF/UA-1 or PDF/UA-2? Maybe in PDF/UA-2 alternate text is chosen above
MathML by the screen reader.

> And as for my final comment about the “only benefit”: It seems to me
> that the two programs I tried on the Mac are bringing no benefit to the
> vision-impaired. That’s said, but nothing ConTeXt can help with. It just
> makes everything more complicated, because I have no means of telling
> whether what I am trying to do to make documents accessible is effective
> in any way.

I think there are ways. As for your Preview and VoiceOver, users can
request (and even demand) from Apple to comply with the EU Accessibility
Directive. If that doesn’t work, users can also inform their national
authority (or even the Commission) about non-compliant programs.

Of course, first you have to be sure that the programs have issues with
documents (other than the ones generated by ConTeXt; the recent ones
from the »Bundesgesetzblatt« would be fine in Germany). Then, there
should be a relatively detailed list of glitches in accessibility.

Of course, this is my opinion. And I agree, it‘s a hassle. But I think
it may be the only way to get it in some cases (companies not caring
enough to comply).

Just in case it might help,

Pablo
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [NTG-context] Re: Images and Accessibility (ConTeXt LMTX 2025.04.28)
  2025-04-29 22:50 ` Ulrike Fischer
  2025-04-30  3:19   ` Wolfgang Schuster
@ 2025-04-30 16:06   ` Pablo Rodriguez via ntg-context
  2025-05-01  9:25     ` Ulrike Fischer
  1 sibling, 1 reply; 12+ messages in thread
From: Pablo Rodriguez via ntg-context @ 2025-04-30 16:06 UTC (permalink / raw)
  To: ntg-context; +Cc: Pablo Rodriguez

On 4/30/25 00:50, Ulrike Fischer wrote:
> 
> The pdf produced by context maps every structure to NonStruct, that
> means there is no tagging structure, it only fools the accessibility
> check. You can and should not claim that this an ua-1 file. You can
> check the structure by uploading your pdf to
> https://texlive.net/showtags, that will produce an xml from the
> structure.

Many thanks for your reply, Ulrike.

This is an already known issue. The compilation requires
https://mailman.ntg.nl/archives/list/ntg-context@ntg.nl/message/YEWPKPJSPTGL7YG7HCDZJTDJA462ADQP/attachment/4/lpdf-tag-imp-testing.lmt.

Many thanks for both url references. They are really helpful.

> I don't know if the missing structure is the reason that VoiceOver
> fails, as I'm on windows, but you could try with a LaTeX document.
> Go to https://texlive.net/ngpdf and compile there this example:
> 
> \DocumentMetadata{tagging=on}
> \documentclass{article}
> \usepackage{graphicx}
> \begin{document}
> some text
> 
> \includegraphics[alt=an image with a duck]{example-image-duck}
> \end{document}

Weird. Validating the output against veraPDF-1.29.39, it only checks
PDF/A-1b (not PDF/UA-2).

> After the compilation you can download the pdf and compare the
> reading.

Matthias, do your programs read aloud the LaTeX document suggested by
Ulrike.

Many thanks to both of you,

Pablo



___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [NTG-context] Re: Images and Accessibility (ConTeXt LMTX 2025.04.28)
  2025-04-30 16:06   ` Pablo Rodriguez via ntg-context
@ 2025-05-01  9:25     ` Ulrike Fischer
  2025-05-01 10:24       ` Pablo Rodriguez via ntg-context
  0 siblings, 1 reply; 12+ messages in thread
From: Ulrike Fischer @ 2025-05-01  9:25 UTC (permalink / raw)
  To: ntg-context

Am Wed, 30 Apr 2025 18:06:04 +0200 schrieb Pablo Rodriguez via
ntg-context:

> Weird. Validating the output against veraPDF-1.29.39, it only checks
> PDF/A-1b (not PDF/UA-2).

verapdf started as a PDF/A validator, and generally if both
standards are present it check A. 

You can use verapdf -f ua1  to force UA validation. Use verapdf
--help for more options. 


-- 
Ulrike Fischer 
http://www.troubleshooting-tex.de/

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [NTG-context] Re: Images and Accessibility (ConTeXt LMTX 2025.04.28)
  2025-05-01  9:25     ` Ulrike Fischer
@ 2025-05-01 10:24       ` Pablo Rodriguez via ntg-context
  2025-05-11 11:49         ` juh+ntg-context--- via ntg-context
  0 siblings, 1 reply; 12+ messages in thread
From: Pablo Rodriguez via ntg-context @ 2025-05-01 10:24 UTC (permalink / raw)
  To: ntg-context; +Cc: Pablo Rodriguez

On 5/1/25 11:25, Ulrike Fischer wrote:
> Am Wed, 30 Apr 2025 18:06:04 +0200 schrieb Pablo Rodriguez via
> ntg-context:
> [...]
> verapdf started as a PDF/A validator, and generally if both
> standards are present it check A.

Many thanks for your reply, Ulrike.

> You can use verapdf -f ua1  to force UA validation. Use verapdf
> --help for more options. 

Well, I prefer the GUI and I had set it to validate both versions of
PDF/UA (having different results).

But that was just a comment, my main point was whether /Figure had a
right /Alt value.

Many thanks your help,

Pablo
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [NTG-context] Re: Images and Accessibility (ConTeXt LMTX 2025.04.28)
  2025-05-01 10:24       ` Pablo Rodriguez via ntg-context
@ 2025-05-11 11:49         ` juh+ntg-context--- via ntg-context
  2025-05-11 14:20           ` Hans Hagen
  2025-05-11 15:28           ` Ulrike Fischer
  0 siblings, 2 replies; 12+ messages in thread
From: juh+ntg-context--- via ntg-context @ 2025-05-11 11:49 UTC (permalink / raw)
  To: ntg-context; +Cc: juh+ntg-context

Dear all,

this was a very interesting thread, thanks a lot.

After your recent discussion about accessibility I poke around a little 
and found that LibreOffice is doing a nice job. I was quite surprised as 
I rarely use it. I randomly created some documents, exported to pdf and 
tested against verapdf. They all validate. (I am tempted to use 
LibreOffice for some small pdf documents we publish on our website.)

Accessibility is a hard job and people like me are happy if some 
validators are showing green success lines. But you never know, if it 
really makes things better.

Anyway, I tried the settings of minimal examples shared here in some of 
my real world works, but there still remains one error in verapdf.


With this I only get one error:

\setupbackend
   [format={pdf/a-2a},
    profile={default_cmyk.icc,default_rgb.icc,default_gray.icc}]

\setuptagging
   [state=start]

\enabledirectives
    [backend.usetags=mkiv]


Specification: ISO 19005-2:2011, Clause: 6.2.4.3, Test number: 3	
DeviceCMYK shall only be used if a device independent DefaultCMYK colour 
space has been set or if a DeviceN-based DefaultCMYK colour space has 
been set when the DeviceCMYK colour space is used or the file has a 
PDF/A OutputIntent that contains a CMYK destination profile	Failed
310 occurrences 	Show


Any clue where to look?
TIA
juh
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [NTG-context] Re: Images and Accessibility (ConTeXt LMTX 2025.04.28)
  2025-05-11 11:49         ` juh+ntg-context--- via ntg-context
@ 2025-05-11 14:20           ` Hans Hagen
  2025-05-11 15:28           ` Ulrike Fischer
  1 sibling, 0 replies; 12+ messages in thread
From: Hans Hagen @ 2025-05-11 14:20 UTC (permalink / raw)
  To: ntg-context

On 5/11/2025 1:49 PM, juh+ntg-context--- via ntg-context wrote:
> Dear all,
> 
> this was a very interesting thread, thanks a lot.
> 
> After your recent discussion about accessibility I poke around a little 
> and found that LibreOffice is doing a nice job. I was quite surprised as 
> I rarely use it. I randomly created some documents, exported to pdf and 
> tested against verapdf. They all validate. (I am tempted to use 
> LibreOffice for some small pdf documents we publish on our website.)
> 
> Accessibility is a hard job and people like me are happy if some 
> validators are showing green success lines. But you never know, if it 
> really makes things better.

a lot of this also depends on the complecity of structure

> Anyway, I tried the settings of minimal examples shared here in some of 
> my real world works, but there still remains one error in verapdf.
> 
> 
> With this I only get one error:
> 
> \setupbackend
>    [format={pdf/a-2a},
>     profile={default_cmyk.icc,default_rgb.icc,default_gray.icc}]
> 
> \setuptagging
>    [state=start]
> 
> \enabledirectives
>     [backend.usetags=mkiv]
> 
> 
> Specification: ISO 19005-2:2011, Clause: 6.2.4.3, Test number: 3
> DeviceCMYK shall only be used if a device independent DefaultCMYK colour 
> space has been set or if a DeviceN-based DefaultCMYK colour space has 
> been set when the DeviceCMYK colour space is used or the file has a PDF/ 
> A OutputIntent that contains a CMYK destination profile    Failed
> 310 occurrences     Show
> Any clue where to look?

just comment the profile line and rely on the built in logic

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [NTG-context] Re: Images and Accessibility (ConTeXt LMTX 2025.04.28)
  2025-05-11 11:49         ` juh+ntg-context--- via ntg-context
  2025-05-11 14:20           ` Hans Hagen
@ 2025-05-11 15:28           ` Ulrike Fischer
  1 sibling, 0 replies; 12+ messages in thread
From: Ulrike Fischer @ 2025-05-11 15:28 UTC (permalink / raw)
  To: ntg-context

Am Sun, 11 May 2025 13:49:49 +0200 schrieb juh+ntg-context--- via
ntg-context:

> Dear all,
> 
> this was a very interesting thread, thanks a lot.
> 
> After your recent discussion about accessibility I poke around a little 
> and found that LibreOffice is doing a nice job. I was quite surprised as 
> I rarely use it. I randomly created some documents, exported to pdf and 
> tested against verapdf. They all validate. (I am tempted to use 
> LibreOffice for some small pdf documents we publish on our website.)

Passing validation doesn't garanty accessibility. 
If a figure has no alternative text, validation for UA-1 will fail.
But if all your figure have as alternative text "blablablub", it
will pass.

> 
> Accessibility is a hard job and people like me are happy if some 
> validators are showing green success lines. But you never know, if it 
> really makes things better.

Well you can test that. Get nvda and then let the PDF read to you. 

> With this I only get one error:

> Specification: ISO 19005-2:2011, Clause: 6.2.4.3, Test number: 3	

ISO 19005 is about PDF/A, Archivability. That has nothing to do with
accessibility. You must call verapdf with the -f switch and choose
ua-1, ua-2, wt1r, or wt1a if you want to validate accessibility. 
(assuming that you have a current verapdf).


-- 
Ulrike Fischer 
http://www.troubleshooting-tex.de/

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2025-05-11 15:33 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-29 17:13 [NTG-context] Images and Accessibility (ConTeXt LMTX 2025.04.28) Matthias Weber
2025-04-29 19:20 ` [NTG-context] " Pablo Rodriguez via ntg-context
2025-04-29 21:17   ` Matthias Weber
2025-04-30 15:45     ` Pablo Rodriguez via ntg-context
2025-04-29 22:50 ` Ulrike Fischer
2025-04-30  3:19   ` Wolfgang Schuster
2025-04-30 16:06   ` Pablo Rodriguez via ntg-context
2025-05-01  9:25     ` Ulrike Fischer
2025-05-01 10:24       ` Pablo Rodriguez via ntg-context
2025-05-11 11:49         ` juh+ntg-context--- via ntg-context
2025-05-11 14:20           ` Hans Hagen
2025-05-11 15:28           ` Ulrike Fischer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).