2

I'm new to LaTeX and all that stuff, but due to the fact, that I may be using it in the future at university, I just try to get along with it.

To test, I want to have a story in a pretty book. On the web, I found a template for doing so and actually I got pretty far. Unfortunately, I can't change the font, everything I try just results in 1. no change at all or 2. the same font everywhere.

As requested, here is a MWE:

\documentclass[twoside,12pt,german]{book}
\usepackage[german]{babel}
\usepackage{fontspec}

\setmainfont{Handwriting - Dakota}

\begin{document}
This is a test.
\end{document}

These are the error messages I get:

  • LaTeX Font Warning: Some font shapes were not available, defaults substituted.
  • LaTeX Font Warning: Font shape EU1/Handwriting-Dakota(0)/m/sl' undefined (Font) usingEU1/Handwriting-Dakota(0)/m/n' instead on input line
  • Error 256 (driver return code) generating output; file xetest.pdf may not be valid.

No .pdf-file is created.

  • Note that it would be better to use the Acorn package rather than defining \initfamily that way as the package sets the font up with \DeclareRobustCommand and DeclareTextFontCommand which is less fragile and more in keeping with the way fonts are generally configured for LaTeX. You don't need to \input the font definition file in this case, either. Also, don't say \renewcommand{\familydefault}{pplj}. In any case, this is going to override the earlier \setmainfont. In general, you are mixing different ways of setting fonts so they will compete and not do what you expect. – cfr Aug 23 '15 at 14:27
  • 1
    @Sverre: I'm providing a clear example on what I do in LaTeX and how it should look. As I said, I am a beginner an I want to learn. Saying to me that I should not use code, that I don't understand is absurd. As far as I know is one of the basic ideas of LaTeX to use templates and to adapt them to your own needs. That's what I try to do. – yoshegg Aug 23 '15 at 14:42
  • @cfr: Thank you very much, I don't understand everything of your answer, but I will continue my research on these things. – yoshegg Aug 23 '15 at 14:42
  • The point is not to tell us what you do in LaTeX by providing us with all the code you're using. You should only provide the code that's relevant to the problem you're experiencing. Please read about minimal working example. – Sverre Aug 23 '15 at 14:45
  • 1
    I installed the Dakota Font as ttf, which seems free for non commercial use. I get the same warning, but not the same error. So let's reopen this question and find out, why yoshegg gets an error. The font, by the way, includes german umlauts. – Keks Dose Sep 5 '15 at 14:31
3

‘Handwriting - Dakota’ is a typeface included in OS X in an Apple-proprietary format called a font suitcase, which dates back to the classic Mac OS.

LuaTeX and XeTeX have their own code for accessing font files, separate from the operating system, and cannot use these typefaces or any like it (like Hoefler Text) unless you buy them again from their original producers in OpenType format or another font format which TeX understands.

  • I don't have a mac, but imho Hoefler Text works fine with lualatex and xelatex -- the fontspec manual has various examples with this font. – Ulrike Fischer Aug 23 '15 at 15:14
  • Thank you very much. Do you know a way of using this font anyway? I don't have to use LuaTeX or XeTeX, any running alternative would be ok. – yoshegg Aug 23 '15 at 15:15
  • @UlrikeFischer As I said, the fonts can be used, but not in the forms they come from Apple in. Hoefler Text can also be purchased from the foundry in a fontspec-compatible format. – dpk Aug 23 '15 at 15:19
  • @yoshegg If you can find it in OTF or TTF format, you should be able to use the font. Google might help here, but I’m not sure how legal the various sites offering it for free are. – dpk Aug 23 '15 at 15:21
  • Ok, I assume I just have to use a different font. I have found it in this format, but only the apple one has the german umlauts that I need. – yoshegg Aug 23 '15 at 15:24
0

To change your font, just change \setmainfont to a different font:

\documentclass{book}
\usepackage{fontspec}
    \setmainfont{FreeSerif}

\begin{document}
This is in another font than ``Handwriting -- Dakota''.
\end{document}

Note that your "error" messages are not errors, just warnings. They tell you your font lacks certain properties (I can't run your MWE since I have no access to your font).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.