4

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.

What I see using XeLaTeX. enter image description here

What I see using LibreOffice Writer. enter image description here

4
  • LaTeX is not able to use ttf font. You should use LuaLaTeX or XeLaTeX instead. Commented Sep 18, 2015 at 6:23
  • can you provide the font for a test?
    – user2478
    Commented Sep 18, 2015 at 6:52
  • 1
    Rectangle normally means that xelatex did find the font but that there are no letters in the requested positions so it is quite either a problem with the font itself or xelatex found another one. Use \XeTeXtracingfonts=1 to find out which font is used and check the pdf properties. Commented Sep 18, 2015 at 7:18
  • font: drive.google.com/file/d/0B5OYzdvI2MB5ejJya1BkbjVLLWs/…
    – Christovis
    Commented Sep 18, 2015 at 7:22

2 Answers 2

1

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}

enter image description here

6
  • For me it still doesn't work. I work with Ubuntu 12.04, use Document Viewer 3.4.0 and Okular 0.14.3
    – Christovis
    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.
    – Sverre
    Commented Sep 18, 2015 at 9:53
  • Yes, that's correct. Which version of Evince are you using?
    – Christovis
    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.
    – Sverre
    Commented Sep 18, 2015 at 12:17
  • 1
    That must have been the reason. I have instell TEXLive anew and now it works.
    – Christovis
    Commented Sep 19, 2015 at 19:53
0

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 , ... ]

4
  • 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?
    – Christovis
    Commented Sep 18, 2015 at 6:37
  • @Hiro no warning too? Commented Sep 18, 2015 at 6:38
  • no warnings: [XeLaTeX] 0errors, 0 warnings, 0 badboxes
    – Christovis
    Commented Sep 18, 2015 at 6:40
  • @Hiro : In this case I don't know sorry Commented Sep 18, 2015 at 6:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .