# small-caps figures, anyone?

Is there a good (possibly free) opentype font out there with small-caps figures and small question and exclamation marks; and could I use them with xelatex + fontspec?

Or, better still, is there a workaround I can use with one of the excellent free fonts like Linux Libertine or TeX Gyre Pagella? I need this for my page headers, which I want to typeset in all-smallcaps; therefore it would be useful to have some kind of mechanism I can put in my pagestyle macro. Shrinking all-caps is not the way -- in Linux Libertine, for example, lining numbers and question and exclamation marks are noticably smaller than the capital letters, and anyway, scaled caps don't look that good.

Based on this answer I tried the following, which seems to work within normal text, but not in the pagestyle macro (I'm not very comfortable around \catcode and \lccode, so it's more or less copy and paste and trial and error; maybe it just needs the odd \protect strewn in?):

File mysmallcaps.sty:

\ProvidesPackage{mysmallcaps}
\newenvironment{mylcsc}{%
\catcode\'=\active\begingroup\lccode\~=\'\lowercase{\endgroup\def~{\protect\raisebox{-0.45ex}{\kern0.03em'}}}%
\catcode!=\active\begingroup\lccode\~=!\lowercase{\endgroup\def~{\protect\scalebox{1}[0.75]{\kern0.01em!}}}%
\catcode?=\active\begingroup\lccode\~=?\lowercase{\endgroup\def~{\protect\scalebox{1}[0.75]{\kern0.02em?}}}%
\catcode1=\active\begingroup\lccode\~=1\lowercase{\endgroup\def~{\protect\scalebox{1}[0.8]{1}}}%
\catcode2=\active\begingroup\lccode\~=2\lowercase{\endgroup\def~{\protect\scalebox{1}[0.8]{2}}}%
\catcode3=\active\begingroup\lccode\~=3\lowercase{\endgroup\def~{\protect\scalebox{1}[0.8]{3}}}%
\catcode4=\active\begingroup\lccode\~=4\lowercase{\endgroup\def~{\protect\scalebox{1}[0.8]{4}}}%
\catcode5=\active\begingroup\lccode\~=5\lowercase{\endgroup\def~{\protect\scalebox{1}[0.8]{5}}}%
\catcode6=\active\begingroup\lccode\~=6\lowercase{\endgroup\def~{\protect\scalebox{1}[0.8]{6}}}%
\catcode7=\active\begingroup\lccode\~=7\lowercase{\endgroup\def~{\protect\scalebox{1}[0.8]{7}}}%
\catcode8=\active\begingroup\lccode\~=8\lowercase{\endgroup\def~{\protect\scalebox{1}[0.8]{8}}}%
\catcode9=\active\begingroup\lccode\~=9\lowercase{\endgroup\def~{\protect\scalebox{1}[0.8]{9}}}%
\catcode0=\active\begingroup\lccode\~=0\lowercase{\endgroup\def~{\protect\scalebox{1}[0.8]{0}}}%
}{}
% redefining \ps@headings like this does _not_ work:
\let\@oddfoot\@empty\let\@evenfoot\@empty
\thepage\hfil
\normalfont\small\begin{mylcsc}\MakeLowercase{\leftmark}\end{mylcsc}%
}%
{\normalfont\small\begin{mylcsc}\MakeLowercase{\rightmark}\end{mylcsc}}%
\hfil\thepage%
}%
}


File test.tex:

\documentclass{book}
\usepackage{lipsum}
\usepackage{fontspec}
\setmainfont[Numbers=OldStyle, Ligatures=TeX]{Linux Libertine O}
\usepackage{mysmallcaps}
\begin{document}
\chapter{Here comes Orwell's 1984!}
\section{Whatever happened in 336\,\textsc{bc} that made the high priest blush?}%
Can't? Won't! 0123456789\\[3mm]
\begin{mylcsc}Can't? Won't! 0123456789\end{mylcsc}\\[3mm]
\emph{Scaled all-caps:}\\
\lipsum\lipsum
\end{document}
\endinput

• Maybe I'm deaf, dumb, crippled and blind (anybody remember the gread Blood, Sweat & Tears?), but I don't get what you want. If you'd like to have whatever in smallcaps, why don't you just write something like \textscs{bla} and you are done? Jun 17, 2014 at 7:45
• Traditionally, old style figures are used with small caps. Just use the OpenType feature +onum or Figures=OldStyle in the options for fontspec. Jun 17, 2014 at 7:50
• @KeksDose Many fonts do not set "figures" (aka numbers) in a smaller size with \textsc. For example, in CM, the default font, 123 \textsc{123} shows no difference. Jun 17, 2014 at 10:08
• Here's an answer that gives some food for thought: tex.stackexchange.com/questions/171470/… Handmade small caps that uses different horizontal and vertical scaling to achieve a reasonable result. Jun 17, 2014 at 10:17
• Perhaps this answer is of help: tex.stackexchange.com/questions/128767/… Jun 17, 2014 at 14:05

Even among commercial fonts, few have small cap figures and punctuation marks, but the following do, and I’ve used them successfully with luatex and xetex: Augustin, Cartier Book Pro, Jannon 10 Pro, and Neacademia Latin. In the case of Jannon 10 Pro, you have to specify Script=Default in your invocation of fontspec for the feature to work.

Here is a demonstration, from which you can see that Neacademia and Cartier have small cap figures whose ascending and descending parts are tucked in more (Cartier) or less (Neacademia), while the small cap figures in Jannon and Augustin are lining.

\documentclass{article}
\usepackage{fontspec}

\newfontfamily\jannon[
Script=Default,
Contextuals=Inner,
Numbers=OldStyle,
ItalicFeatures={Contextuals={WordInitial,WordFinal}}
]{Jannon 10 Pro}

\newfontfamily\augustin[
BoldFont={Augustin Bold},
BoldItalicFont={Augustin Bold Italic},
BoldFeatures={SmallCapsFont={Augustin Bold Small Caps}},
ItalicFont={Augustin Italic},
SmallCapsFont={Augustin Small Caps}
]{Augustin-Regular}

\newfontfamily\cartier[BoldFont={* Medium}]{Cartier Book Pro}
\begin{document}
\begin{tabular}{rl}
Neacademia Latin & George Orwell, 1984?! \textsc{george orwell, 1984?!}\\
\jannon Jannon 10 Pro & \jannon George Orwell, 1984?! \textsc{george orwell, 1984?!}\\
\cartier Cartier Book Pro & \cartier George Orwell, 1984?! \textsc{george orwell, 1984?!}\\
\augustin Augustin & \augustin George Orwell, 1984?! \textsc{george orwell, 1984?!}
\end{tabular}
\end{document}


• Also WilliamsCaslonText. Jun 18, 2014 at 21:16

Based on some of the links in @Steven's comments to my OP I've come up with not really a solution but a working (for me) workaround (the result needs to be printed or viewed in high resolution/magnification, because the hinting seems to differ considerably from the unadulterated glyphs):

\documentclass{book}
\usepackage[landscape]{geometry}
\usepackage{xltxtra}
\usepackage{fontspec}
\usepackage{newunicodechar}
\newif\ifsc\scfalse
% Get me my capital ß:
\newunicodechar{ß}{\ss}
\let\oldSS\SS
\renewcommand{\SS}{\iffontchar\font"1E9E \symbol{"1E9E}\else \oldSS\fi}
%
\newcommand{\Ziffer}[2]{\ifsc\iffontchar\font#1 \symbol{#1}\else #2\fi\else #2\fi}
\newcommand{\Null}{\Ziffer{"E108}{0}}%
\newcommand{\Eins}{\Ziffer{"E109}{1}}%
\newcommand{\Zwei}{\Ziffer{"E10A}{2}}%
\newcommand{\Drei}{\Ziffer{"E10B}{3}}%
\newcommand{\Vier}{\Ziffer{"E10C}{4}}%
\newcommand{\Fuenf}{\Ziffer{"E10D}{5}}%
\newcommand{\Sechs}{\Ziffer{"E10E}{6}}%
\newcommand{\Sieben}{\Ziffer{"E10F}{7}}%
\newcommand{\Acht}{\Ziffer{"E110}{8}}%
\newcommand{\Neun}{\Ziffer{"E111}{9}}%
%
\setmainfont[Numbers={OldStyle,Proportional}, Ligatures=TeX]{Linux Libertine O}
%
\newcommand{\fakesc}[1]{{%
\sctrue%
LetterSpace=2,
Numbers={Lining, Proportional},
FakeStretch=1.157,
FakeBold=1.01,
}%
\scalebox{0.7}[0.7]{{\MakeUppercase{#1}}}%
}}
\newcommand{\testtext}{(h\Null\Eins\Zwei\Drei\Acht\Neun h)? -- Don't! -- aäbcdefghijklmnoöpqrsßtuüvwxyz}
\begin{document}\noindent
\normalsize normal font\\
\normalfont\LARGE \testtext\\[2mm]
\normalsize caps\,+\,smallcaps, out of the box:\\
\LARGE \textsc{\testtext}\\[2mm]
`