8

I managed to include symbols inside custom fonts (.ttf):

\documentclass[12pt]{article} 
\usepackage{fontspec}

\newcommand*{\icmobile}{{\fontspec{mat.ttf}\symbol{"E0D4}}}
\newcommand*{\icpin}{{\fontspec{mat.ttf}\symbol{"E55E}}}
\newcommand*{\icmail}{{\fontspec{mat.ttf}\symbol{"E158}}}
\newcommand*{\icarrowr}{{\fontspec{mat.ttf}\symbol{"E5CC}}}

\begin{document}

\icmail \hspace{2mm} my.email@domain.it 


\begin{itemize} 
   \item[\icarrowr] one 
   \item[\icarrowr] two
   \item three \dots{}
\end{itemize}

\end{document}

But I can not vertically align text and symbols.

enter image description here

...as you can see the symbol is always higher than the text.

I'm creating the custom fonts symbols correctly? It's possible to achieve the vertical center alignment between symbol and text?

Thanks in advance.

Luca Sepe
  • 183
  • 1
    Hm \raisebox{-2pt}{\icmail} perhaps. Change the value of -2pt to more appropiate settings. I can't test this since I don't have your fonts! –  Aug 25 '16 at 17:53
  • 1
    @ChristianHupfer works great thanks! If you convert your comment as answer I'll mark as accepted. – Luca Sepe Aug 25 '16 at 17:59

1 Answers1

8

If a 'glyph' or box is too high or low compared to the baseline, it is possible to raise or lower it with \raisebox{dimension value}{content}. Positive values raise the content, negative values shift it down.

The precise value depends on the font size declarations and the details of the symbol actually.

Perhaps it is possible to query the depth of the glyph box.