latex3 / fontspec

Font selection in LaTeX for XeTeX and LuaTeX
http://latex3.github.io/fontspec/
LaTeX Project Public License v1.3c
276 stars 33 forks source link

Cannot use Extension with .ttc files and FontIndex #431

Open adamliter opened 4 years ago

adamliter commented 4 years ago

Description

I'm not sure if this is a bug or the intended behavior, but it does not seem to be possible to use the Extension keyword with a .ttc file and using the *Features keywords with FontIndex when trying to set the main font.

Check/indicate

Minimal example demonstrating the issue

The following document does not correctly set the bold, italic, and bold italic fonts for me, even though I am able to directly set a bold font by defining a new font and using the UprightFeatures keyword.

\documentclass{article}

\usepackage{fontspec}
\setmainfont[
  Ligatures=TeX,
  Extension=.ttc,
  UprightFeatures={FontIndex=0},
  BoldFeatures={FontIndex=4},
  ItalicFeatures={FontIndex=2},
  BoldItalicFeatures={FontIndex=5}]{GillSans}

\newfontfamily\SemiBold[
  Ligatures=TeX,
  Extension=.ttc,
  UprightFeatures={FontIndex=4}]{GillSans}

\begin{document}
\textbf{asdf}
\textit{asdf}
asdf
\textbf{\textit{asdf}}

{\SemiBold asdf}
\end{document}

Output from compiling document where "asdf" appears in the same font, except when switching to the \SemiBold font