[XeTeX] Problem with font features in tables
Peter Dyballa
Peter_Dyballa at Web.DE
Wed Feb 4 01:04:08 CET 2009
Am 03.02.2009 um 19:34 schrieb Michael Lynch:
> \newcommand{\abbracr}[ 1
> ]{{\addfontfeatures{LetterSpace=5.0,Letters=SmallCaps}
> \MakeTextLowercase{#1}
> }}
>
> The second, to be used in some headings, should make the text upper
> case and
> select lining figures:
>
> \newcommand{\fullcaps}[ 1
> ]{{\addfontfeatures{Letters=Uppercase,Numbers=Uppercase}
> \MakeTextUppercase{#
> 1}}}
These two are not good! Every time you use any of these commands a
new font instance is created – and in another thread it was found
that only a few thousand fonts are allowed. It's better to first
declare these two font instances and then create commands that re-use
them over and over again:
\newfontfamily\abbr[LetterSpace=5.0,Letters=SmallCaps]{Constantia}
\newfontfamily\fulc[Letters=Uppercase,Numbers=Uppercase]{Constantia}
\DeclareRobustCommand{\abbracr}[1]{{\abbr\MakeTextLowercase{#1}}}
\DeclareRobustCommand{\fullcaps}[1]{{\fulc\MakeTextUppercase{#1}}}
>
> However, for my document, they are both used for the first time in
> a table.
> The problem occurs when my "fullcaps" command has not been used in
> the body
> text first. If I run it on my sample document (Test.tex), it does not
> produce "full caps" numerals as I'd expect. If however, I include a
> \phantom{\fullcaps{}} command prior to the first table, it works as
> I'd
> like! This isn't a problem to do, and seems to have no effect on
> the final
> layout, but I wondered if anyone could explain why it does this?
>
I either don't understand what you are describing here or you are not
understanding what a line
\fullcaps{2007a} & a \\
in a table environment will do. In the above example the fullcaps
feature is only applied for the first cell – not the whole line! Does
this explain what you get?
Or did you forget what Will Robertson wrote on page 17 of his
fontspec manual on numbers?
“The synonyms Uppercase and Lowercase are equivalent to Lining and
OldStyle, respectively.”
Since, IMO, numbers are neither upper nor lower case I'd recommend to
use the terms "Lining" or "OldStyle."
--
Greetings
Pete
When in doubt, use brute force.
– Ken Thompson
More information about the XeTeX
mailing list