Copiar texto de PDF inclui caracteres gregos

Copiar texto de PDF inclui caracteres gregos

Estou tendo um problema em que copio palavras de um PDF (gerado com XeLaTeX), onde o texto copiado inclui caracteres gregos aleatórios.

\documentclass[12pt,a4paper,english]{report}
% setup encoding
\usepackage[utf8]{inputenc}
%set language
\usepackage[british,english]{babel}
\usepackage[T1]{fontenc}
\usepackage{lmodern,cmap}
%setup font
\usepackage{fontspec}
\setmainfont{Calibri}

\begin{document}
{\large A dissertation submitted in partial fulfilment of\\
the requirements for the degree of\\}
\end{document}

(Omiti o texto para simplificar).

Gerar um PDF para o texto acima e copiar o corpo resulta na seguinte string:

A dissertaƟon submiƩed in parƟal fulĮlment of the requirements for the degree of

Se eu remover a inclusão da fonte, copiar e colar funcionará bem, então tenho motivos para acreditar que há um problema com o modo como estou usando a fonte. Alguém tem alguma ideia

Responder1

Não use inputenc, lmoderne cmapcom fontencXeLaTeX ou LuaLaTeX. Mas além disso há um problema com as ligaduras. Eles não são mapeados corretamente para entradas unicode com XeLaTeX. Com LuaLaTeX funciona:

\documentclass[12pt,a4paper,english]{report}
\usepackage[british,english]{babel}

\usepackage{fontspec}
\setmainfont{Calibri.ttf}

\begin{document}
{\large A dissertation submitted in partial fulfilment of\\
the requirements for the degree of\par}
\end{document} 

XeLaTeX:

Uma dissertação

informação relacionada