Problema al seleccionar la fuente de TrueType Collection con LuaTeX

Problema al seleccionar la fuente de TrueType Collection con LuaTeX

Me gustaría usar la fuente Gill Sans, que está instalada en /Library/Fonts/GillSans.ttcmi Mac. Según la fontspecdocumentación, debería poder utilizar colecciones TrueType especificando el índice de fuente. La documentación afirma que esto debería funcionar con LuaTeX, pero tengo problemas para que funcione.

La compatibilidad con TrueType Collections solo se ha probado en XeTeX, pero también debería funcionar con una versión actualizada de LuaTeX y el luaotfloadpaquete.

El siguiente documento mínimo funciona en la medida en que usa Gill Sans, y parece posible incluso usar pesos/formas específicas de la fuente definiendo una nueva familia de fuentes, pero no funciona \setmainfontni puede usar comandos como \textbf{},,\textit{}etc., como se puede ver en la captura de pantalla del resultado de la compilación de este documento.

\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}

Resultado de la compilación del documento donde "asdf" aparece en la misma fuente, excepto cuando se cambia a la fuente \SemiBold

¿Alguien sabe cuál podría ser el problema y cómo resolverlo? El registro muestra lo siguiente:

LaTeX Font Warning: Font shape `TU/GillSans(0)/b/n' undefined
(Font)              using `TU/GillSans(0)/m/n' instead on input line 18.

LaTeX Font Warning: Font shape `TU/GillSans(0)/m/it' undefined
(Font)              using `TU/GillSans(0)/m/n' instead on input line 19.

LaTeX Font Warning: Font shape `TU/GillSans(0)/b/it' undefined
(Font)              using `TU/GillSans(0)/b/n' instead on input line 21.

Además, ejecutar el siguiente comando en un shell

luaotfload-tool --find 'Gill Sans SemiBold' -i

devuelve lo siguiente, lo que sugiere que el documento anterior debería funcionar para seleccionar la fuente semi negrita como BoldFont a través del índice 4:

luaotfload | resolve : Font "Gill Sans SemiBold" found!
luaotfload | resolve : Resolved file name "/Library/Fonts/GillSans.ttc", subfont nr. 4


** 1 Gill Sans SemiBold ********************************************************

        ascender: 1487
    averagewidth: 1154
     boundingbox: <table>
                   1: -1162
                   2: -512
                   3: 2279
                   4: 1931
       capheight: 1397
  defaultvheight: 0
       descender: -561
          family: Gill Sans
        fontname: GillSans-SemiBold
        fullname: Gill Sans SemiBold
     italicangle: 0.0
      monospaced: false
    panoseweight: demi
     panosewidth: normal
       pfmweight: 600
        pfmwidth: 5
   platformnames: <table>
           macintosh: <table>
                  family: Gill Sans
                fullname: Gill Sans SemiBold
          postscriptname: GillSans-SemiBold
               subfamily: SemiBold
             windows: <table>
                  family: Gill Sans
                fullname: Gill Sans SemiBold
          postscriptname: GillSans-SemiBold
               subfamily: SemiBold
       subfamily: SemiBold
    subfontindex: 4
           units: 2048
         version: 13.0d1e4
          weight: semibold
           width: normal
         xheight: 934

Estoy usando MacTeX 2020, v3.14/2020-05-06 de luaotfload-tooly v2.7i de fontspec.

Respuesta1

Cuando trabaje con archivos ttc, no debe usar Extensionsino agregar directamente al nombre; de ​​lo contrario , .ttcse detecta demasiado tarde y debe configurar ItalicFont// manualmente:BoldFontBoldItalicFont

\documentclass{article}

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

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

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

{\SemiBold asdf}
\end{document}

información relacionada