2

I have a few artistic fonts that I use in XeLaTeX with the fontspec package. However, they don't support smallcaps out of the box.

Is there a way to tell LaTeX to "fake" smallcaps by capitalizing everything and scaling the lowercase letters down a bit, similar to how Word or OpenOffice do it?

Minimal example, even though it's pretty obvious:

\documentclass{report}

\usepackage{fontspec}

% Really any font that doesn't include small caps definitions
\newfontfamily\titlefont{Old London Alternate}

\begin{document}
\titlefont \scshape Test Text
\end{document}

The Test Text is not rendered in small caps, as it would be if the font supported small caps.

Thanks for pointing me to this answer, which works fine in general, but has the drawback that it fails on UTF-8 encoded files with non-ASCII characters, which I need to use. If you have an idea how to modify that answer to also support non-ascii characters, please let me know.

4
  • Personally I think that faking small caps is a bad typographic choice, so I'd rather look for a compatible font that offers small caps. However, the answers to this question offer many ways to do it if you really want to.
    – wave
    Mar 30, 2020 at 12:43
  • In TUGboat, we find the default small caps too small for acronyms, so we have defined "big small caps" by using smaller sizes of ordinary caps. The code is in ltugboat.cls (on CTAN), and you are welcome to adapt it. This mode does lack the wider sidebearings usually associated with "designed" small caps. Mar 30, 2020 at 15:03
  • 1
    I found a way to modify it: you need to replace the \def\fauxschelp part up to \begin{document} with the following: \def\fauxschelphelp#1#2\relax{\ifnum`#1=\uccode`#1\relax\scalebox{\Cscale}[1]{#1}\else\scalebox{\Hscale}[\Vscale]{\uppercase{#1}}\fi\ifx\relax#2\relax\else\fauxschelphelp#2\relax\fi}
    – wave
    Apr 2, 2020 at 6:58
  • 1
    The problem with the other solution was that it checks if the character is a lowercase letter simply by checking if its character code is within a certain range (A-Z), which makes all non-ASCII characters be treated like uppercase letters (so they are not capitalized, for example). I changed it to use the uppercase code of the character instead.
    – wave
    Apr 2, 2020 at 7:04

0

Browse other questions tagged .