Skip to content

fontspec declaration failing with xetex unless Extension= key is used #504

@FrankMittelbach

Description

@FrankMittelbach

Description

Specified syntax should work on all engines that can be used with fontspec

Check/indicate

  • Relevant for XeTeX
  • [n/a] Relevant for LuaTeX
  • Issue tracker has been searched for similar issues?
  • [n/a] Links to <tex.stackexchange.com> discussion if appropriate

Minimal example demonstrating the issue

\documentclass{article}
\pagestyle{empty}
\setcounter{page}{6}
\setlength\textwidth{111.0pt}

\setlength\parindent{10pt}

%StartShownPreambleCommands
\usepackage{fontspec}
\setmainfont{Alegreya}
            [ UprightFont    = *-Medium.otf,
              ItalicFont     = *-MediumItalic.otf,
              BoldFont       = *-ExtraBold.otf,
              BoldItalicFont = *-ExtraBoldItalic.otf]
%StopShownPreambleCommands

\begin{document}
This \textbf{text} is typeset in the \emph{family} Alegreya. It
supports \textbf{\itshape bold italic} and \textsc{Small Caps}.
\end{document}

Further details

This example from TLC3 works with LuaTeX but fails to find the OTF fonts with XeTeX. To make it work with XeTeX one has to specify

\setmainfont{Alegreya}[
  Extension      = .otf,
  UprightFont    = *-Medium,
  ItalicFont     = *-MediumItalic,
  BoldFont       = *-ExtraBold,
  BoldItalicFont = *-ExtraBoldItalic
]

instead. This is unfortunate, because in theory different fonts could be in different formats (and per documentation the above syntax should work).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions