2

I'm trying to install a custom fontfamily, named Agenda, in my Latex document. I use XeLatex, so i tried to load the font with \fontspec:

Using this code, the font works great:

\documentclass{scrartcl}

\usepackage[utf8]{inputenc} 
\usepackage[T1]{fontenc} 
\usepackage[german]{babel} 
\usepackage[a4paper]{geometry} 
\geometry{verbose,tmargin=10mm,bmargin=10mm,lmargin=10mm,rmargin=5mm} 

\usepackage{fontspec}

\begin{document}
\newfontfamily\bodyfont[]{Agenda}
\defaultfontfeatures{Mapping=tex-text}
\setmainfont[Mapping=tex-text, Color=textcolor]{Agenda Medium}
 hello \textbf{world}
\end{document}

Adding a word with an "umlaut" to the text, like "Änderung" or " "Anderung", I get the error : Type2 Charstring Parser: Parsing charstring failed: (stataus=-1, stack=5).

When I change the font to a windows system font font like Arial:

\newfontfamily\bodyfont[]{Arial}
\defaultfontfeatures{Mapping=tex-text}
\setmainfont[Mapping=tex-text, Color=textcolor]{Arial Regular}

...I get this error:

! fontspec error: "font-not-found"
! The font "Arial Regular" cannot be found.
3
  • 1
    Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. Also add a link to a resource for the font, please. And a suggestion: Do us a favour and change your username to something more telling than "user1234".
    – Speravir
    Mar 25, 2014 at 1:58
  • Oh, I should have searched earlier, the font is not free … makes it hard to help.
    – Speravir
    Mar 25, 2014 at 2:18
  • You will not be able to use this font. Perhaps you can find a newer version or if the license permits it you could try to use e.g. fontforge to repair it. Search the xetex mailing list for more informations: tug.org/mailman/mmsearch/…. Mar 25, 2014 at 9:36

1 Answer 1

7

\newfontfamily is only used for additional fonts, not for the main one.

\documentclass{scrartcl}
\usepackage{fontspec}
\setmainfont[Mapping=tex-text]{Arial}
\newfontfamily\TGPagella[Mapping=tex-text]{TeX Gyre Pagella}
\newfontfamily\Agenda[Mapping=tex-text]{Agenda-Medium}

\begin{document}
hello \textbf{world}

\TGPagella
hello \textbf{world}

\Agenda
hello \textbf{world}
\end{document}

enter image description here

8
  • Great, this works, Thank you! So I can use Arial, if Agenda doesn't works. When I use Agenda with your solution, I get the same error like before. Maybe you have an idea how I can get Agenda to work with the german language?
    – Zalem
    Mar 26, 2014 at 10:50
  • see my edited anwer. I suppose there is no Agenda but only Agenda-Medium and AgendaLight
    – user2478
    Mar 26, 2014 at 12:49
  • No, it still doesnt works, sorry.
    – Zalem
    Mar 26, 2014 at 18:14
  • Do you have the OpenType or TrueType version version of Agenda?
    – user2478
    Mar 26, 2014 at 18:31
  • I have the OpenType of Agenda.
    – Zalem
    Mar 28, 2014 at 8:19

You must log in to answer this question.

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