1

I'd like to use the Gill Sans font, which is installed in /Library/Fonts/GillSans.ttc on my Mac. According to the fontspec documentation, I should be able to use TrueType Collections by specifying the font index. The documentation claims this should work with LuaTeX, but I'm having trouble getting it to work.

Support for TrueType Collections has only been tested in XeTeX, but should also work with an up-to-date version of LuaTeX and the luaotfload package.

The following minimal document works insofar as it does use Gill Sans, and it seems possible to even use specific weights/shapes of the font by defining a new font family, but it does not work to \setmainfont and be able to use commands like \textbf{}, \textit{}, etc., as can be seen in the screenshot of the output from compiling this document.

\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

Does anyone know what the issue might be and how to resolve it? The log shows the following:

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.

Moreover, running the following command at a shell

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

returns the following, which suggests that the above document should work to pick out the semi bold font as the BoldFont via index 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

I'm using MacTeX 2020, v3.14/2020-05-06 of the luaotfload-tool, and v2.7i of fontspec.

1
  • You might also be able to use the display/series name.
    – Davislor
    Sep 3, 2020 at 1:21

1 Answer 1

3

When working with ttc files, you shouldn't use Extension but add .ttc directly to the name, otherwise it is detected too late and you have to set ItalicFont/BoldFont/BoldItalicFont manually:

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .