[XeTeX] Defective superiors
John Was
john.was at ntlworld.com
Tue Jun 5 07:46:21 CEST 2007
Hi
This is probably more for plain TeX users.
Some recent listings have reminded me that many commercially supplied fonts come with a defective range of superior letters in the Expert Set - sometimes just one or two letters of the alphabet. One is therefore forced to transform the letters of the ordinary font electronically, even if that is not the right thing to do typographically because of the relative weights of thick and thin lines (but the distortion is I think not so bad when shrinking as opposed to magnifying).
One workaround is to use the TeXBook's 'scaled' command, which will at least ensure that everything you can do in the full-sized version of the font (accents, special letters etc.) is also available in the reduced version, and to get the letters in the appropriate position (for superior and inferior) an easy \cs can be used (see below). It's then just a matter of working out the best scaling, which will vary from font to font. If you find that in 10-pt type the ideal scale factor is 600, then in 8pt (say for footnotes) it will be 480 and so on.
Thus:
\font\suprom = "MinionPro-Regular" scaled 600
\font\supit = "MinionPro-Italic" scaled 600
\def\sup#1{\leavevmode \smash{\raise 0.3em
\hbox{\ifitalic\supit #1\else \suprom #1\fi}}}
\def\inf#1{\leavevmode \smash{\lower 0.12em
\hbox{\ifitalic\supit #1\else \suprom #1\fi}}}
(The \smash is insurance in case TeX widens the interlinear space inadvertently. Actually 600 is a bit small for MinionPro - about 675 would be right. Only whole numbers are allowed in the scaling.)
I always use an \ifitalic command, set to \italictrue whenever I am in {\it }, which allows such automatic selection - otherwise you can of course have separate \romansup#1 and \italicsup#1 commands if these are more convenient. I rarely use bold or bold italic superiors, but the \if...\else...\fi commands could obviously be expanded if required, provided bold and bolditalic have e.g. \boldtrue and \bolditalictrue every time these fonts are in use, allowing automatic selection of the four types of superior/inferior rather than just two.
Hope this is of some use to somebody!
Best
John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://tug.org/pipermail/xetex/attachments/20070605/6bfdd5c1/attachment.html
More information about the XeTeX
mailing list