I have already looked at the various threads that are suggested (based on the title of my question), but am not certain of the answer, because I am not using pdflatex or old Type 1 fonts.

I use LuaLaTeX exclusively. Open Type fonts loaded via fontspec. Always encoded utf-8. TeXLive 2016 or later. My documents are sometimes PDF/X, but are never PDF/A.

For the past year, I have loaded glyphtounicode.tex plus additional information (ligatures) in my own addendum. But I wonder if that is necessary, or even useful? It does not hurt. However, if the information provided by glyphtounicode.tex is irrelevant (given the way I compile), then I would rather avoid loading an unnecessary input.

I am not worried about relatively unusual situations, such as pre-Han Chinese or Bronze Age Indo-European.

  • it's not useful at all with opentype fonts is it? (as far as my understanding of what it's doing goes) (as written it won't work with luatex unless you have defined \pdfglyphtounicode Dec 4 '17 at 20:22
  • @DavidCarlisle I didn't think it was useful, but I needed reassurance. As for the definition, I must have it defined somewhere by default, since I don't get an error. Just because there is no problem "for me" does not always mean that there is "no problem," as I have often discovered.
    – user139954
    Dec 4 '17 at 20:25
  • yes well whether or not it's doing anything useful depends on what it's defined to do: it's a pdftex primitive undefined in recent luatex releases so if you've defined it by \def\pdfglyphtounicode#1#2{} it's not doing any harm, and if you have defined it to be anything else, it depends what that definition is. Dec 4 '17 at 20:29
  • @DavidCarlisle Ah. \pdfglyphtounicode is indeed undefined. So, the various \pdfglyphtounicode commands have been ignored, all along. I would expect an error, but apparently something else intercepts the error. Presumably the file(s) with that macro are not loaded, if the command is undefined. No problem! Since you have answered my question, please provide an answer I can accept.
    – user139954
    Dec 4 '17 at 20:46
  • 1
    No you have defined it (or loaded luatex85 in which case I defined it:-) or you would get an error. Dec 4 '17 at 20:48

the purpose of glyphtounicode.tex is to provide unicode mappings (via the glyph name) for characters that have been accessed from non-unicode fonts, so that searching for unicode strings in the resulting pdf can still work. However this isn't an issue if you use unicode encode fonts anyway.

In addition the pdftex primitive \pdfglyphtounicode used in the file is not defined by default in luatex (although an equivalent macro could be defined).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy