I want to know how does LaTeX figures out if the Eurosymbol (€) is a glyph of a given T1 font. I tried \iffontchar but it seems the value is not unique.
AFAIK it's not a standard symbol of the 256 characters, so I'm interested in the algorithm.
Please note: I'm not interested in using the € symbol if my font doesn't has the glyph. I just want to catch the error and make it relax or redefine if glyph not in font. I'm also not interested in using opentype font.
Also the answer should work for PDFLaTeX, LuaLaTeX and XeLaTeX.
Here is what I wrote so far when I came across this:
\documentclass[11pt,a4paper]{article}
\usepackage{iftex}
\ifPDFTeX
\input glyphtounicode
\pdfgentounicode=1
\usepackage[utf8]{inputenc}
\else
\ifLuaTeX
\input glyphtounicode
\pdfgentounicode=1
\usepackage[utf8]{luainputenc}
\else
\ifXeTeX %XeTeX T1 german special char fix
\usepackage{newunicodechar}
\newunicodechar{ß}{\ss}
\newunicodechar{ä}{\"{a}}
\newunicodechar{ü}{\"{u}}
\newunicodechar{ö}{\"{o}}
\newunicodechar{Ä}{\"{A}}
\newunicodechar{Ü}{\"{U}}
\newunicodechar{Ö}{\"{O}}
\newunicodechar{§}{\textsection}% I think it's okay because standard character... but
%\newunicodechar{€}{here it should check if eurosymbol in t1 font and if not let him relax (print nothing)}
\renewcommand{\SS}{\iffontchar\font"1E9E \symbol{"1E9E}\else SS\fi}
\fi
\fi
\fi
\usepackage[ngerman]{babel}
\usepackage[left=3.5cm,right=3cm,bottom=3.5cm]{geometry}
\usepackage[default,t1,osf,semibold]{raleway}
\usepackage{microtype}
\begin{document}
Office 0123456789 äüöÄÜÖß \texteuro € \textmu
\end{document}
Update
Using textcomp package works and gets an unfaked glyph from the font. So this is solved.
But I'm still interested in how I should define the %\newunicodechar{€}{} for fonts which don't have the special letters.
XeLaTeXexpert, but do you not need one of the packagestextcomp,fourier,marvosym, for example for\texteuro? – Jul 16 '14 at 21:06\textcomp. – Jul 16 '14 at 21:09\usepackage[utf8]{luainputenc}with LuaTeX: Usefontspecinstead. – Martin Schröder Jul 17 '14 at 10:55