Opentype Old-Style Figures

Opentype Old-Style Figures

TUGboat, Volume 26 (2005), No. 3 215 Example 1: Plain X TE EX OpenType and AAT font Fonts selection with old-style figures. \font\fonta="Adobe Garamond Pro:+onum" at 12pt Advanced font features with X TE EX \fonta OpenType old-style figures: 0123456789 — the fontspec package∗ \font\fontb="Apple Chancery: Will Robertson Number Style=Old Styles" at 12pt \fontb AAT old-style figures: 0123456789 Abstract This paper describes the fontspec package for the OpenType old-style figures: X TE EX–LATEX format. This package provides a high level interface for font selection and configuration of AAT old-style figures: 0123456789 OpenType and other fonts. 1 Introduction 2 Motivation X TE EX is an extended TEX program written by Jon- athan Kew, and has been introduced recently in this With X TE EX, users have easy access to a multitude journal [4]. It is currently available only on Apple’s of typefaces in Plain TEX. But writing the font def- Mac OS X, but there is considerable interest (and inition files for LATEX was cumbersome and proved much work to be done!) in making it a cross-platform a fair obstacle for day-to-day use. I started working application. The main advantages it holds over its on a solution, which was originally simply to cre- contemporaries are support for Unicode input and di- ate the .fd files necessary to access every Mac OS X rect access to fonts installed in the operating system. font in LATEX, but I quickly tired of the tedium, No additional support files are necessary in order to disenchanted with this non-general solution to the install such fonts, which are accessed via an extended problem. Furthermore, the scope of font features pro- \font primitive. This primitive also provides access vided by feature-rich fonts quickly demonstrated the to rich font features available in either the Open- NFSS2 insufficient for the task of incorporating every Type format, or the ‘Apple Advanced Typography’ permutation of font features a user might desire. (AAT) format.1 A typical example, in plain X TE EX, Secondly, AAT font features are accessed by of choosing a font with old-style figures in these two referring to a specific string defined on a per-font formats is shown in example 1. basis, with consistency between fonts kept between The fontspec package is an implementation of ‘feature codes’ rather than the value of the string. a high level interface for LATEX users of X TE EX to For example, example 1 uses the strings ‘Number access feature-rich fonts in the framework of the Style’ and ‘Old Styles’ to select lowercase numbers in familiar NFSS. Furthermore, it obviates the need for Apple Chancery, but for Hoefler Text one would write custom-written font definition files required for font ‘Number Case=Lowercase numbers’. Note that such installation. a system works well in a graphical program in which This paper will introduce the fontspec package font features are selected interactively from a list; with some side commentary on the advanced font for- each feature may be described exactly as the font mats it supports. The first half of the paper will cover designer would wish (and this is indeed an advantage the user interface, covering font installation, font se- for more esoteric features). Unfortunately, for a batch lection, and font feature selection. The second half program like X TE EX, this flexibility is a burden. discusses the implementation details, shortcomings, Finally, after version 0.8, X TE EX began using the and future of the package. ICU renderer3 to support OpenType font features in addition to the Mac OS X-native features it supported from the beginning. Now the poor users had to cope with not only a different system for applying font features, but also OpenType’s cryptic abbreviations ∗ Version 1.9 of the package was under construction while this paper was finalised; some additions may yet make it into for them. At this time, fontspec was able to provide the final version, in which case I apologise in advance for the incomplete information here. The package documentation will 2 NFSS, the ‘new font selection scheme’ for LATEX, isn’t always be up to date, of course. actually that new. For readers unfamiliar with its concepts, 1 The AAT format may be considered to be approximately the documentation file fntguide reveals all [12]. equivalent to a combination of the Multiple Master and Open- 3 International Components for Unicode, http://icu. Type formats. sourceforge.net 216 TUGboat, Volume 26 (2005), No. 3 a unified and consistent interface to fonts and their Example 2: NFSS family selection features in both formats, and offer a few other niceties along the way. \fontspec{Hoefler Text} This is an example typeset in Hoefler Text. 3 Font installation \textit{Here is italic.} \textbf{And now bold.} To install a font in Mac OS X, the font file must {\bfseries\itshape Bold italic, of course.} be placed in one of the computer’s Fonts folders \scshape Small caps, if available. \itshape And italic small caps. (user, system, or network). Once a font is installed in \bfseries Even bold italic small caps! Mac OS X it is immediately available to X TE EX. No additional font support files of any kind are required This is an example typeset in Hoefler Text. Here is A for it to be loaded by a \font command. (A LTEX italic. And now bold. Bold italic,of course. user would still need .fd files for loading it with S!"## $"%&, '( ")"'#"*#+. A!" #$%&#' ()%&& '%*(. classical NFSS techniques.) Ease of font access is E!"# $%&' ()*&(+ ,-*&& +*.,! one of X TE EX’s attractions, but no manipulation of the font properties can occur between the stages of obtaining the font and actually using it. Example 3: Choosing the default font families. Compare this to the method TEX and its siblings uses, in which sub-optimal glyphs or kerning in the \setromanfont{Baskerville} font may be rectified with customised font metrics \setsansfont[Scale=MatchLowercase]{Skia} and virtual fonts. In X TE EX, it is much simpler for \setmonofont[Scale=MatchLowercase]{Monaco} a user to install a new font, but it is less flexible if The \textsf{fontspec} package defines greater output quality is desired than the font alone the \verb|\fontspec| command. gives and the user cannot, or may not (due to license restrictions), edit the font file itself. The fontspec package defines the \fontspec command. It has always been a good idea, however, to use a suitably high-quality font from the beginning in order to avoid such hassles. More usefully, the default document fonts (ro- 4 Font selection man, sans serif, and typewriter), are chosen with the following commands, which have the same inter- One of the trickier topics a new user to LATEX faces is font selection, although progress has been made face as \fontspec itself. They are \setromanfont, with the PostScript NFSS bundle [11], and other \setsansfont, and \setmonofont, and provide a freely available fonts, that provide simple4 packages more intuitive interface than such methods as to select them. X TE EX and the fontspec package make \renewcommand\rmdefault{family} . things similarly easy by referring to a font with its Related commands are also available for specifying display name, rather than the cryptic ‘Karl Berry’ the text fonts for use in maths environments (i.e., abbreviation, unnecessary in many cases these days. \mathrm and others). On an individual basis, \fontspec selects font The use of the default-font commands in exam- families: ple 3 also demonstrates the feature for automatic \fontspec[font features]{font name} font scaling, which in this case keeps the lowercase letter heights consistent. Further explanation of the This command loads the specified typeface and de- Scale feature occurs in section 5.1. fines an NFSS family as appropriate with bold, italic, The fontspec package attempts to identify the and small caps shapes (if available) for access with accompanying small caps, bold, and italic faces for a the familiar font-shape changing commands such as selected font, but in the case that it fails or that more \itshape, \textsc, etc.5 An example of selecting the than one is available for use, they may be selected ‘Hoefler Text’ family with these methods is shown in explicitly, with individual font features if desired. example 2. ‘Old-fashioned’ 8-bit fonts with separate small caps 4 Indeed, too simple in some cases. The helvet package may be defined as a complete family in this way, as allows a scaling factor to load the font at any relative size, shown in example 4, which also demonstrates how but almost all other font packages skip this sometimes-vital a Multiple Master font instance can be conveniently ingredient. defined for the bold series. 5 Code inspired by Philipp Lehman’s The Font Installation Guide [6] allows the combination of both italic and small caps Finally, commands may be defined for efficiently shapes. switching between fonts: TUGboat, Volume 26 (2005), No. 3 217 Example 4: Choosing accompanying fonts. Example 5: Selecting number styles by context. \fontspec[SmallCapsFont = {Minion MM Small Caps \fontspec[Numbers={Proportional,OldStyle}] & Oldstyle Figures}, {Skia} BoldFont = {Minion MM Roman}, In 1842, 999 people sailed 97 miles BoldFeatures = {Weight = 1.4}, in 13 boats. \par In 1923, 111 people ]{Minion MM Roman} sailed 54 miles in 56 boats. \vspace{10pt} Minion Roman 123 \\ \textsc{Minion SC 456} \\ \bfseries {\addfontfeatures{Numbers={Monospaced,Lining}} Minion Bold 123 \\ \textsc{Minion Bold SC 456} \begin{tabular}{@{} cccc @{}} Year & People & Miles & Boats \\ Minion Roman 123 \hline Minion SC 456 1842 & 999 & 75 & 13 \\ Minion Bold 123 1923 & 111 & 54 & 56 \\ Minion Bold SC 456 \end{tabular}} In 1842, 999 people sailed 97 miles in 13 boats.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    9 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us