# UTF8 Encoding/Mapping in the pdf with PdfTeX (Application to Fourier Font) [closed]

After many search, I have found how to have a pretty good UTF8 mapping (which give no bad result on Acrobat Pro accessibility checking) for lmodern and amsfonts. The code needed is in the minimal example below (Maybe some of you maybe interested so I commented it a little).

But now, I decided to change my font to the one of the fourier package and I have some difficulties to figure how to get proper UTF8 encoding in the output pdf with this font.

Normally I should add commands like the following:

\pdfglyphtounicode{<IdentifierSymbol>}{<UTF8Code>}


But I don't know where to find what I have called call the <IdentifierSymbol> and <UTF8Code>. I have done many test but without success.

I would greatly appreciate your help.

Here is the minimal example to show the difference of UTF8 mapping when using Fourier fonts instead of Latin Modern font. You can see the difference by copy-pasting the content or by an accessibility check if you have Acrobat Pro.

\documentclass[]{article}

%PdfTeX settings for a correct UTF 8 Mapping
%------------------------------------------------------
\usepackage{ifpdf}
\ifpdf    \input{glyphtounicode.tex}    %Part of modern distribution
%%%\input{glyphtounicode-cmr.tex}     %Additionnal glyph: You must grab it from pdfx package
\pdfgentounicode=1
\else  %Place here the settings for other compilator
\fi

%Encoding + cmap (to get proper UTF8 mapping)
%------------------------------------------------------
\usepackage{cmap}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

%NB: CHANGE lmodern AND fourier TO SEE THE PROBLEM OF MISSING UNICODE CHARACTERS
%     You can see this on Acrobat Pro with acessibility checking or simply by copy-pasting the content.
%     Of course copy paste is not perfect in both case but it is better with lmodern
%------------------------------------------------------
\usepackage{lmodern}
\usepackage{fourier}

%AMS Math + UTF8 mapping of ams symbols
%------------------------------------------------------
\usepackage{amsmath}
\usepackage{amssymb} % I load it after Fourier else I have more incorrect utf8 mapping (with \geqslant for example)
%Correct UTF8 mapping for ams fonts
\ifdefined\pdffontattr% \ifdefined is part of the e-TeX extension, which is part of any modern LaTeX compiler.
\immediate\pdfobj stream file {umsa.cmap}
{\usefont{U}{msa}{m}{n}\pdffontattr\font{/ToUnicode \the\pdflastobj\space 0 R}}
\immediate\pdfobj stream file {umsb.cmap}
{\usefont{U}{msb}{m}{n}\pdffontattr\font{/ToUnicode \the\pdflastobj\space 0 R}}
\fi

%Start document
%------------------------------------------------------
\begin{document}

Issue with mapsto : ${\mathcal F} : \boldsymbol{\eta} \in {\mathbb{R}}^{np}\ \mapsto {\mathcal F}\left(\boldsymbol{\eta} \right)\in \mathbb{R}$

\bigskip
Issue with sqrt : $\sqrt{X}$

\bigskip
Issue with parenthesis : $X \geqslant \left(\frac{1}{2}\right)^2$

\bigskip
Issue with sum : $\sum_{n=0}^\infty X^n$

\end{document}

-

## closed as too localized by Kurt, lockstep, Thorsten, Qrrbrbirlbel, Stefan Kottwitz♦Nov 1 '12 at 20:13

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. If this question can be reworded to fit the rules in the help center, please edit the question.

This is most likely much easier with XeTeX and LuaTeX. Why do you insist on using pdfTeX? –  Martin Schröder Oct 23 '11 at 11:16
Mainly because I have more than 200 tikZ figures and XeTeX don't seem to handle tikZ as well as pdfTeX (Perhaps I am wrong). I like also the mycrotype package which work only on pdfTeX for now. And finally because I guess I will have to solve many other problems/conflicts and I don't have many time for this (it's my PhD thesis and I should finish it soon). –  youyou Oct 23 '11 at 17:31
The latest version of microtype works with LuaTeX. But I understand that you want to finish your thesis first. :-) –  Martin Schröder Oct 23 '11 at 22:10
Thanks. Since I change font from Latin Modern to Fourier, the microtype package makes my documents very slow to compile. I heard the beta version solves some performance issue and I just wanted to install it. Perhaps you can also help me on this. I just have post a new question for the occasion. –  youyou Oct 23 '11 at 23:08