[XeTeX] Superscript and Small Caps problem

Andy Lin kiryen at gmail.com
Fri Aug 19 10:37:08 CEST 2011


Superscripts: xltxtra uses real super-/subscripts by default if the
font supports it, and fakes them if the font doesn't. The reason it
used to work for Times New Roman, ironically, is because the font
didn't actually support OpenType superscripts, so it would be faked.
The reason why it doesn't work for Linux Libertine is because it does
support OpenType superscripts, so the feature is enabled, but the font
doesn't actually contain superscript glyphs for 'lú'. To fix this:
Change
\newcommand{\dtm}[1]{{\textsuperscript{\sffamily#1}}}
to
\newcommand{\dtm}[1]{{\rmfamily\fakesuperscript{#1}}} %\sffamily was a
typo, right? I've reversed the order out of personal preference; it's
less likely to break this way.

Small caps: Charis SIL is one of the rare fonts that has a small
capital version of the h breve. I forget if there's any official
support for fake small caps like with LaTeX, but you can fake the
small caps version by using the capital version by using the following
code (adjust the parameters FakeStretch, FakeBold, and Scale for
appearance).
Add
\newcommand{\fakesc}[1]{{\addfontfeatures{FakeStretch=1.1,FakeBold=1.1,Scale=0.8}\MakeUppercase{#1}}}
Change
\newcommand{\smn}[1]{{\sffamily\scshape#1}}
to
\newcommand{\smn}[1]{{\sffamily\fakesc{#1}}}

The downside to using either of these codes is that it will always
fake the superscript/small caps, even if the font has the proper
glyph. I'm sure someone can hack together a fix that will swap the
definitions(between fake and real) based on the Unicode range, but I'm
not quite there.

HTH,
Andy



More information about the XeTeX mailing list