fontspec icon indicating copy to clipboard operation
fontspec copied to clipboard

Cannot use Extension with .ttc files and FontIndex

Open adamliter opened this issue 5 years ago • 0 comments

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

adamliter avatar Sep 03 '20 12:09 adamliter