On Sun, 13 Apr 2025 at 00:08, Matthew Bertucci <[email protected]> wrote:
> Hello,
>
> While looking into what it would take to make some LaTeX symbol packages
> PDF/UA compatible, it was pointed out to me that luatex's \pdfextension
> glyphtounicode does not accept the tfm:<tfmname>/ prefix for glyph names
> that is documented in the pdftex manual. This prevents individual font
> packages from defining their own Unicode mappings without overwriting
> the glyph mappings for all fonts. Here's an example using
> OrnementsADF.tfm that has U+2B98 in the "parenleft" slot that produces
> the correct mapping with pdftex but the undesired parenleft mapping
> (U+0028) with luatex.
>
> \ifcsname pdfglyphtounicode\endcsname
> \else
> \def\pdfgentounicode{\pdfvariable gentounicode}
> \def\pdfglyphtounicode {\pdfextension glyphtounicode}
> \fi
> \pdfgentounicode=1
> \font\ADFornaments=OrnementsADF at 10pt
> \pdfglyphtounicode{tfm:OrnementsADF/parenleft}{2B98}
> \ADFornaments\char1
> \bye
>
> If the tfm:OrnementsADF/ prefix is removed, the mapping is correct, but
> this would apply to all fonts. Is this just unsupported in luatex? If
> so, would it be possible to add or emulate the functionality?
>
> Thanks,
> Matthew Bertucci
>
>
texlive/trunk/Build/source/texk/web2c/luatexdir/font/pdfglyphtounicode-readme.txt
(at least from 2020-02-15 13:45:08)
"""
In pdftex there are more heuristics going on when determining the
tounicode mapping:
- more lookups using periods
- a prefix tfm:cmr10/foo -> bar mapping
Because in luatex one can have a callback that just loads the tfm and then
decorates it with tounicodes we don't do this in luatex.
HH
"""
--
luigi