1

I am using tocloft and fontspec to reformat a table of contents.

I have this code:

\newfontface\Verdana{Verdana1}[
   Path=fonts/,
   Extension=.ttf,
   BoldFont=Verdana1b,
   BoldFeatures={SmallCapsFont={Verdana1b}}
]
\usepackage[titles]{tocloft}
\renewcommand\cftchapfont{\normalfont\fontsize{10}{12}\Verdana\selectfont\sc\bfseries\expandafter}

This is the result. Note the size of the chapter number, vs the size of the page number.

Result

If in the other hand, I switch\bfseries to \bf I get only a bold text with correct chapter number size; and if I use only \sc I also get a correct chapter number size, but not bold.

I have a solu^whack working:

% THESE TWO LINES HAVE A TWISTED HACK
\renewcommand\cftchappresnum{\fontsize{17}{12}\selectfont}
\renewcommand\cftchapaftersnum{\fontsize{10}{12}\selectfont.}

But then, it looks acceptable.

If you have any idea why this happen, and how to fix it, I am welcome.

  • 2
    \normalfont\fontsize{10}{12}\Verdana\selectfont\sc is the same as \normalsize\sc as the old latex2.09 compatibility commands such as \sc always select a fixed font not adapting to the current font family. presumably you want \scshape (but not all families have bold small caps) – David Carlisle Aug 27 '17 at 19:56
  • @DavidCarlisle you are right. Just now I noticed that is Times, not Verdana. Using \scshape does nothing, although I added a small caps variant using fontforge. – Alberto Aug 27 '17 at 20:10
1

As David Carlisle pointed out, \sc was ignoring the font family. Using \scshape needs a font with that feature, a thing I did using FontForge.

My main issue was the way to configure correctly the fontface. This is the result that is working for me:

\newfontface\Verdana{Verdana1}[
   Path=fonts/,
   Extension=.ttf,
   BoldFont=Verdana1b,
   BoldFeatures = {Letters=SmallCaps},
]
\usepackage[titles]{tocloft}
\renewcommand\cftchapfont{\normalfont\fontsize{10}{12}\Verdana\selectfont\bfseries\scshape\expandafter}

So, Verdana1b.ttf has the bold font with small caps, but it seems that if I do not specify in its features the existence of SmallCaps, it will not be loaded.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.