1

Here is a detailed explanation of how to use various fonts inside a document in XeLaTeX: How do I use a particular font for a small section of text in my document?

However, there is no MWE to illustrate this. Say I would like to create a single document whose main font is ebgaramond, but inside this document, I want various flowery texts set in, for example, Deutsche Normalschrift (http://www.tug.dk/FontCatalogue/deutschenormalscrift/), or some other font, maybe ten other fonts in the same document.

How can I accomplish this? My request is, a MWE of at least three different fonts (say ebgaramond, Deutsche Normalschrift and Bitstream Charter) which accomplishes this. Is this possible in any case? You may complete the following code if you like:

\documentclass[10pt,twoside]{book}
\usepackage{fontspec}
\setmainfont{ebgaramond}

\usepackage{lipsum}
\begin{document}
    %All this is set in EBGaramond.
    \lipsum[1-8]
    % %Upto this.
    \setingaudyfont{Very long text, maybe.}
    %Again set in EBGaramond. etc etc.

\end{document}

==============Edit===================

Here is what I get when I do this:

\documentclass[10pt,a4paper]{article}
\usepackage{fontspec}
\setmainfont{EB Garamond}
\newfontfamily\deutschenormalscript{URW Chancery L}

\usepackage{lipsum}
\begin{document}
    %All this is set in EBGaramond.
    \lipsum[1-8]
    % %Upto this.
    {\fontspec{Bitstream Charter} \lipsum[5]}
    %Again set in EBGaramond. etc etc.


    {\deutschenormalscript \lipsum[6]}


\end{document}

The result:

Various font problems

  • 2
    I don’t understand what you don’t understand about the post you linked to. It is very detailed, just read it. The parts you need most are the sections “selecting font locally” and “restricting the scope of the selection”: just define a new font with \newfontfamily\deutschenormalscript{Deutsche Normalschrift and type {\deutschenormalschrift Text in Deutsch Normalschrift}. – Arthur Reutenauer Aug 4 '15 at 12:17
  • @Arthur Reutenauer, please see the update. And moreover, it is very difficult to know what name to choose, is it ebgaramond or EB Garamond? etc. Only one of them is correct. How do I see the list of font names? The explanation given in the link above does not work. – usr203050 Aug 4 '15 at 12:28
  • 1
    I think Bitstream Charter is a Type1 font. Unfortunately Type1 font as a native font in xdvipdfmx was implemented by Jiang Jiang a little after the release of TL 2015. If you build xdvipdfmx by using the current sources in the TeX Live repository, you will obtain expected results. – Akira Kakuto Aug 4 '15 at 12:54
  • @Akira Kakuto, another problem is that, it is difficult to find the system font names. For example, we cannot use ebgaramond; we have to use EB Garamond and so on. How can I see the right font names in my system? I am on Ubuntu 15.04. – usr203050 Aug 4 '15 at 12:57
  • 2
    The problem shown in the screenshot has nothing to do with the use of multiple fonts: you can reproduce just using Bitstream Charter. So it is a font-specific problem. Even if it is using type1, I don't think it should be doing this. Plus the type of font I get seems to be the same for EB Garamond. Your other question: I always use otfinfo -i <path to font> for getting the name and otfinfo also has options for getting lists of supported scripts and features. – cfr Aug 4 '15 at 13:08

Your Answer

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

Browse other questions tagged or ask your own question.