3

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}{%
    \addfontfeature{Letters=UppercaseSmallCaps,Letters=SmallCaps,LetterSpace=2,WordSpace=1.2,Numbers=Lining}%
    \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?}}}%
    \catcode`1=\active\begingroup\lccode`\~=`1\lowercase{\endgroup\def~{\protect\scalebox{1}[0.8]{1}}}%
    \catcode`2=\active\begingroup\lccode`\~=`2\lowercase{\endgroup\def~{\protect\scalebox{1}[0.8]{2}}}%
    \catcode`3=\active\begingroup\lccode`\~=`3\lowercase{\endgroup\def~{\protect\scalebox{1}[0.8]{3}}}%
    \catcode`4=\active\begingroup\lccode`\~=`4\lowercase{\endgroup\def~{\protect\scalebox{1}[0.8]{4}}}%
    \catcode`5=\active\begingroup\lccode`\~=`5\lowercase{\endgroup\def~{\protect\scalebox{1}[0.8]{5}}}%
    \catcode`6=\active\begingroup\lccode`\~=`6\lowercase{\endgroup\def~{\protect\scalebox{1}[0.8]{6}}}%
    \catcode`7=\active\begingroup\lccode`\~=`7\lowercase{\endgroup\def~{\protect\scalebox{1}[0.8]{7}}}%
    \catcode`8=\active\begingroup\lccode`\~=`8\lowercase{\endgroup\def~{\protect\scalebox{1}[0.8]{8}}}%
    \catcode`9=\active\begingroup\lccode`\~=`9\lowercase{\endgroup\def~{\protect\scalebox{1}[0.8]{9}}}%
    \catcode`0=\active\begingroup\lccode`\~=`0\lowercase{\endgroup\def~{\protect\scalebox{1}[0.8]{0}}}%
}{}
% redefining \ps@headings like this does _not_ work:
\def\ps@mynewheadings{%
    \ps@headings
    \let\@oddfoot\@empty\let\@evenfoot\@empty
    \def\@evenhead{%
        \thepage\hfil
        \normalfont\small\begin{mylcsc}\MakeLowercase{\leftmark}\end{mylcsc}%
    }%
    \def\@oddhead{%
        {\normalfont\small\begin{mylcsc}\MakeLowercase{\rightmark}\end{mylcsc}}%
        \hfil\thepage%
    }%
}
\pagestyle{mynewheadings}

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]
    \emph{Small-caps with homemade corrections:}\\
    \begin{mylcsc}Can't? Won't! 0123456789\end{mylcsc}\\[3mm]
    \emph{Scaled all-caps:}\\
    \scalebox{0.65}[0.65]{\addfontfeature{Numbers=Lining, LetterSpace=4}\MakeUppercase{Can't? Won't! 0123456789}}\\[12mm]
    \lipsum\lipsum
\end{document}
\endinput
9
  • 3
    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?
    – Keks Dose
    Commented 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.
    – ChrisS
    Commented 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. Commented Jun 17, 2014 at 10:08
  • 1
    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. Commented Jun 17, 2014 at 10:17
  • 1
    Perhaps this answer is of help: tex.stackexchange.com/questions/128767/… Commented Jun 17, 2014 at 14:05

2 Answers 2

7

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}
\setmainfont[Contextuals=Alternate]{Neacademia Latin}

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

output of the code above

1
  • 1
    Also WilliamsCaslonText.
    – Manuel
    Commented Jun 18, 2014 at 21:16
1

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%
    \addfontfeature{%
        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]
    \normalsize homemade smallcaps (please compare at high resolution):\\
    \LARGE \fakesc{\testtext}\\[2mm]
\end{document}
\endinput

As you can see, the resulting font works better for my purpose than the original caps+smallcaps. There's considerably less bristling -- OK, there's still ÄÖÜ and Q and J, but they are much less intrusive than in the original c+sc shape. !?() and ' behave very well. If I don't use \scalebox but an existing or custom-made extra fontsize command, the result would even hyphenate (which I don't need).

To Do: I've got the feeling that not all fonts that use symbols "E108 through "E111 use these positions to put their full cap numerals. So I guess I'll need some kind of test to generalize this and make it harmless where it doesn't apply.

You must log in to answer this question.

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