fontspec icon indicating copy to clipboard operation
fontspec copied to clipboard

Specify Small Caps for both upright and bold fonts

Open ambs opened this issue 8 years ago • 7 comments

I have this configuration:

\newfontface\VerdanaFont{Verdana1}[
   Mapping=tex-text,
   Path=fonts/,
   Extension=.ttf,
   BoldFont=Verdana1b,
   SmallCapsFeatures = { Letters=SmallCaps },
]

It works great for upright, upright with small caps, and bold. But when I try a bold small caps, I can't get them to work. In the other hand, if I do:

\newfontface\VerdanaFont{Verdana1}[
   Mapping=tex-text,
   Path=fonts/,
   Extension=.ttf,
   BoldFont=Verdana1b,
   SmallCapsFeatures = { Letters=SmallCaps },
   BoldFeatures = {Letters = SmallCaps},
]

then I have small caps in bold, but no upright bold.

What am I missing? Thank you

ambs avatar Aug 28 '17 20:08 ambs

Reading through the manual, this should work:


\newfontface\VerdanaFont{Verdana1}[
   Mapping=tex-text,
   Path=fonts/,
   Extension=.ttf,
   BoldFont= Verdana1b,
   BoldFeatures = {
     SmallCapsFeatures = {Letters=SmallCaps }},
   SmallCapsFeatures = { Letters=SmallCaps },
]

But not yet :-)

ambs avatar Aug 28 '17 20:08 ambs

Thanks, looks like you may have stumbled across an edge case. I’ll look into it...

wspr avatar Aug 29 '17 00:08 wspr

I can share privately the fonts in case you need to test.

ambs avatar Aug 29 '17 10:08 ambs

Regarding fonts, is it possible to repeat the test using something like texgyrepagella-regular.otf ? It makes it much easier for me to write standardised tests if the font is in TeX Live.

Just to confirm, you know that you shouldn’t need to write

SmallCapsFeatures = { Letters=SmallCaps }

for most fonts? If the small caps are there then fontspec should automatically detect and activate them.

wspr avatar Aug 29 '17 12:08 wspr

Yes, looking to the docs it seemed that command was not required, but given things were not working, I tried everything I got. Will try to reproduce with a TeX Live font.

ambs avatar Aug 29 '17 12:08 ambs

Ok, when trying to prepare a simple test case, I found out a way to make my fonts work. Maybe it was my fault right from the beginning, but given there is no example with this kind of detail in the documentation (or at least I did not find it while going through it), I never tested this configuration before reporting:


\newfontface\VerdanaFont{Verdana1}[
   Mapping=tex-text,
   Path=fonts/,
   Extension=.ttf,
   SmallCapsFont = Verdana1,
   SmallCapsFeatures = {Letters=SmallCaps},
   BoldFont= Verdana1b,
   BoldFeatures = {
     SmallCapsFont = Verdana1b
   },
]

Curiously, \textsc and \scshape doesn't behave the same way. I had the first working without the SmallCapsFeatures line, but the second did not.

If I may suggest, at least to add an example like this:

\fontspec{Alegreya-Regular}[
Path = /usr/share/texlive/texmf-dist/fonts/truetype/huerta/alegreya/,
Extension = .ttf,
BoldFont = Alegreya-Bold,
SmallCapsFont = AlegreyaSC-Regular,
BoldFeatures = {
  SmallCapsFont = AlegreyaSC-Bold,
}
]

It will make it (more) clear you can specify a small caps font inside the bold features.

Thank you for your help and work on fontspec!!

ambs avatar Aug 29 '17 12:08 ambs

I think this hierarchy is documented in v2.7c, on page 16 of the manual (at the top). So this issue may be closed.

RuixiZhang42 avatar May 27 '19 05:05 RuixiZhang42