# Unicode symbols with XeLaTeX and Lato font

I'm trying to print the ✔ symbol using XeLaTeX and directly from the code (i.e. putting the symbol into the source code directly and not using some \macro). I have the following MWE:

\documentclass{article}

\usepackage{fontspec}
\setmainfont{Lato}

\begin{document}
This is a test: ✔
\end{document}


But it doesnt work:

xelatex test.tex


However, using Libertine font (with \usepackage{libertine}) works OK.

Is there a way to do it?

Thank you very much in advance.

• looks as if your font doesn't contain the symbol, so you will have to switch to another font for it. – Ulrike Fischer Apr 22 at 10:26
• The log file says Missing character: There is no ✔ in font Lato Regular/OT, so you'll have to find a font which contains that glyph. – Phelype Oleinik Apr 22 at 10:26

## 1 Answer

The font has no glyph for that character (you can see it from the “missing symbol” glyph or from the message in the log file).

Use a font that provides it. Here I use Libertinus Serif.

\documentclass{article}

\usepackage{fontspec}
\usepackage{newunicodechar}

\setmainfont{Lato}
\newfontfamily{\libertinus}{Libertinus Serif} % a font that has ✔
\newfontfamily{\iosevka}{Iosevka}

\newunicodechar{✔}{%
\begingroup
\iffontchar\font✔ \else \libertinus\fi ✔%
\endgroup
}

\begin{document}

This is a test: ✔

\iosevka

This is a test: ✔

\end{document}


You might want to have the symbol not to change based on the current conditions. Then use

\documentclass{article}

\usepackage{fontspec}
\usepackage{newunicodechar}

\setmainfont{Lato}
\newfontface{\libertinus}{Libertinus Serif} % a font that has ✔
\newfontfamily{\iosevka}{Iosevka}

\newunicodechar{✔}{%
\begingroup
\normalfont\libertinus ✔%
\endgroup
}

\begin{document}

This is a test: ✔

\iosevka

This is a test: ✔

\end{document}
`

I use the Iosevka font just to see the difference in the two situations.