If copy and paste does not work it means the PDF is not created to allow this. The font program is not used in text extraction. The PDF specification gives the rules on how to extract text using the encoding and ToUnicode CMap, and relies on these being correct.
You are free to read an embedded font program (which may be in type 1, TrueType, CFF, or OpenType format), analyse the font tables, and try to do a better job of creating the ToUnicode map. There is an API to read the font data (via Cos layer) but parsing the font data is up to you.