With pdftex it is possible to restrict a \pdfglyphtounicode
declaration to a specific tfm. So in the following example the A
from cmr10 is mapped to B, but the A from cmss10 is untouched:
\pdfgentounicode=1
\pdfglyphtounicode{tfm:cmr10/A}{0042}
A \font\test=cmss10 \test A
\bye
This is useful, e.g., to setup unicode mappings for older symbol
fonts which often (mis)use standard glyph names.
With luatex this doesn't work. Only the "general" mapping is honored
here:
\pdfvariable gentounicode =1
\pdfextension glyphtounicode {C}{0044}
\pdfextension glyphtounicode {tfm:cmr10/A}{0042}
C A \font\test=cmss10 \test C A
\bye
Would it be possible to extend luatex to support the tfm: syntax
too? Or is there an alternative to change tounicode mappings?
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