Related to "Ð vs Đ": Wrong mappings when copying from PDF with \pdfgentounicode with newtx.
I have even tried changing /Eth
to /Dcroat
in lm-ec.enc
and tested new MWE using lmodern
and ðÐđĐ; the outcome of copying the content from PDF was expected - everything was correct except Eth.
I thought of using \pdfmapfile
or something similar, but having local modified copy of encoding file in the build folder, next to the source code (e.g. modified lm-ec.enc
, and any other respective T1 (EC) encoding files for the used fonts) gives the wanted behavior.
Instead of changing whole core font encoding definition files for used fonts (e.g. lm-ec.enc
) or using their local copy with such change, is there any way of telling something like:
- let the current font's slot 208 be
/Dcroat
- let the slot 208 for all fonts be
/Dcroat
in the preamble without redefining all other slots (e.g. within /enclmec[...] def
)?
EDIT:
I want to get /Dcroat
out of this MWE on copy/paste action (not /Eth
), redefining only one slot in the font encoding definition file(s): 208 - as both Icelandic "Eth" (\DH
) and Croatian "D with stroke" (\DJ
) are mapped to it.
\documentclass{article}\usepackage{lmodern}\usepackage[T1]{fontenc}\usepackage[utf8]{inputenc}\usepackage[croatian]{babel}\input{glyphtounicode}\pdfgentounicode=1\begin{document}Đ % Croatian% I understand that mapping of Icelandic Eth would also be affected with such change, have no problem with that\end{document}
EDIT2:I am aware that redefining glyphtounicode
's \pdfglyphtounicode{Eth}{00D0}
to \pdfglyphtounicode{Eth}{0110}
would produce the same, but my intention is to intervene "one step earlier".