# How to handle TTF fonts with strange names with XeLaTeX?

I am trying to use this font http://www.dafont.com/ecran-monochrome.font?fpp=100, called "Écran Monochrome" in XeLaTeX.

As you can see it has a strange name, both because the accent and the space. XeLaTeX seems to be confused by this and it doesn't compile this document:

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Écran Monochrome}
\begin{document}
123
\end{document}


The question is how do I specify this font in the document? I tried many variants of this name, like removing the accent, the capitalization and the space (see below for current error messages.)

Gives the error:

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! fontspec error: "font-not-found"
!
! The font "Écran Monochrome" cannot be found.
!
! See the fontspec documentation for further information.
!
! For immediate help type H <return>.
!...............................................


The TTF is well installed and usable from other applications (like LibreOffice in Linux.)

\$ fc-list | grep cran
/home/user/.local/share/fonts/ecran-monochrome---monochrome-display.ttf: écran monochrome / monochrome display:style=Regular

-
Alternative solution: Use font file name instaed. Say, \setmainfont{ecran-monochrome---monochrome-display.ttf} –  Leo Liu Apr 5 '14 at 6:44

The Leo Liu's comment is actually a solution. We can use a file name of the font to load the font with the fontspec package. The similar problem is when a font is not actually installed or cannot be installed due to the user's limited rights on the computer and we still wish to use the font. We use ExternalLocation option for this purpose, I enclose an example where font was unzipped in the working directory and it hasn't been installed.

\documentclass{article}
\pagestyle{empty}
\usepackage{fontspec}
\setmainfont[ExternalLocation={./}]{ecran-monochrome---monochrome-display.ttf} % Écran Monochrome
\begin{document}
123
\end{document}


-
So, if the font is installed in user space (such as ~/.fonts or ~/.local/share/fonts/) then still XeLaTeX won't detect it? Where should it be detected? Do I have to tell XeLaTeX to update the database? After all was it a problem with the name of the font or the installation? –  alfC Apr 5 '14 at 9:36
@alfC XeLaTeX is browsing common font directories, it shouldn't be a problem. It is updating font database regularly. Well, we could run fc-cache -vf on our own, if needed. –  Malipivo Apr 5 '14 at 9:47
Ok, I tried that, the only way I can make it work is to put the full path (ExternalLocation) even if it well installed (in userspace, such as ~/.fonts). –  alfC Apr 5 '14 at 10:07
@alfC Hm, that is strange, both ~/.fonts and ~/.local/share/fonts are folders to be searched and they are a part of the font database. –  Malipivo Apr 5 '14 at 10:25
@alfC Is the font's name Écran Monochrome or écran monochrome? –  cfr Apr 5 '14 at 14:29