4

Maybe this has already been asked, but I could not find an answer.

I just switched to XeTeX because I need to use a .ttf font in my project. Everything works fine except that the euro (€) symbol is missing from the font. How can I tell XeTeX to use a different font only for that character?

Someone pointed to ucharclasses but I couldn't understand how to set it up to do what I need (besides, I am not sure it is what I am looking for, as it deals with blocks of text, not single characters)

Here is my current setup:

\usepackage[math-style=ISO, bold-style=ISO]{unicode-math}
\setmainfont{Simoncini Garamond}
\setsansfont{TeX Gyre Heros}
\setmathfont{Garamond-Math.otf}[StylisticSet={7,9}]
7

The simplest solution is to find a font that has a good € glyph, say “Best Font”.

Now add

\usepackage{newunicodechar}

to your list of packages and, after your font settings, the magic formula

\newfontfamily{\eurofont}{Best Font}[Scale=MatchUppercase]

\newunicodechar{€}{{\eurofont €}}

Typing in the document will do. You might want to use an indirection:

\newfontfamily{\eurofont}{Best Font}[Scale=MatchUppercase]

\DeclareRobustCommand{\EUR}{{\eurofont €}}
\newunicodechar{€}{\EUR}

so as to be able also to type \EUR for the glyph.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.