fontspec
fontspec copied to clipboard
Cannot use Extension with .ttc files and FontIndex
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
- [x] Relevant for XeTeX
- [x] Relevant for LuaTeX
- [x] Issue tracker has been searched for similar issues?
- [x] Links to <tex.stackexchange.com> discussion if appropriate:
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}
