I'm working on a LaTeX package (in fact it is a document class) that I want to make available for others to install in their texmf directory. In this package I'm setting up a default configuration for the \lstset command with a given font. If I for instance would like to use Droid Sans Mono as the font, the following command works if the font is installed on the system:
\newfontfamily\listingsfont[Scale=0.85]{Droid Sans Mono}
\lstset {
basicstyle=\footnotesize\listingsfont
}
However, if the font is not installed on the system, this would of course fail. Because of this, I would like to distribute the font together with the LaTeX package. I have tested the Path option of fontspec
\newfontfamily\listingsfont[Path=/home/username/texmf/tex/latex/mypackage/,Scale=0.85]{Droid Sans Mono}
which works perfectly fine, except that I would have to know the username beforehand.
Is there a way to specifiy paths relative to my package in fontspec? Or to get the path to the home directory?
(Most users of this package will use Ubuntu as their main OS).
~/texmf/fonts
rather than~/texmf/tex/latex/
putting fonts in the tex/latex area rather messes up the concept of a standardTDS
directory structure.