I created a font for 12 letters, since this is all I need. Having created the font as .ttf I double click on it and press install. With \fontspec I want to see how the font looks like, but I get only the rectangle frame, meaning that the letters are not defined. But when I use LibreOffice I can use my newly installed self made font. I guess I am making a stupid mistake somewhere, but could someone help me find it.
2 Answers
Your font works just fine. Here's a complete example. As you can see I specify the path where I downloaded your font as I have no intention of installing a font that only has five letters and big problems with spacing ... :)
\documentclass{article}
\usepackage{fontspec}
\setmainfont{Untitled1}[Path=L:/fonts/downloads/]
\begin{document}
BEACH
\end{document}
-
For me it still doesn't work. I work with Ubuntu 12.04, use Document Viewer 3.4.0 and Okular 0.14.3 Commented Sep 18, 2015 at 9:47
-
1@Hiro "Document Viewer" is Ubuntu's name for Evince, right? The pdf produced above looks fine in Evince here.– SverreCommented Sep 18, 2015 at 9:53
-
Yes, that's correct. Which version of Evince are you using? Commented Sep 18, 2015 at 10:34
-
2@Hiro I don't think the problem here is the version of Evince. My guess is that you're running an outdated version of
fontspec
. Please provide more details in your question (you can edit it) about your TeX distribution.– SverreCommented Sep 18, 2015 at 12:17 -
1That must have been the reason. I have instell TEXLive anew and now it works. Commented Sep 19, 2015 at 19:53
If you have install the font on the path that XeLaTeX will search for any font you should be able to use the font:
\documentclass{article}
\usepackage{fontspec} %to be able to change the font
\setmainfont{Your font name here.ttf}
\begin{document}
The quick brown fox jumps over the lazy dog.
\end{document}
Your pdf viewer should also be able to use the font.
Edit: from fontspec package documentation:
To load a font that is not in one of the default search paths, its location in the filesystem must be specified with the Path feature: \setmainfont{texgyrepagella}[ Path = /Users/will/Fonts/ , UprightFont = *-regular , BoldFont = *-bold , ... ]
-
I have installed into the right location since I don't get any error messages when running XeLaTeX. And could it be a problem with the pdf viewer if I can see the font the LibreOffice? Commented Sep 18, 2015 at 6:37
-
-
-
ttf
font. You should use LuaLaTeX or XeLaTeX instead.