Opentype Math Font Development: Progress and Challenges 304 Tugboat, Volume 33 (2012), No
Total Page:16
File Type:pdf, Size:1020Kb
302 TUGboat, Volume 33 (2012), No. 3 OpenType math font development: by typesetting engines which happen to know about Progress and challenges* math, while other engines will safely ignore it. Finally, it is helpful to understand how Uni- Ulrik Vieth code math, OpenType math, fonts and typesetting Abstract engines work together. Unicode math, by itself, only defines the en- A main reason for the development of the LuaTEX coding of mathematical input. It does not define and X TE EX engines has been to provide support for any semantics of how a math formula is arranged or Unicode and OpenType font technology, which im- spaced. That is a matter left to the font technology plies support for Unicode math and OpenType math (OpenType) and the typesetting engine (LuaTEX or as well. One important ingredient is the develop- X TE EX or MS Office). ment of full-featured OpenType math fonts, which In Unicode, each math symbol is usually repre- are needed to replace traditional math fonts. In this sented only once, regardless of how many sizes may paper, we review recent progress in OpenType math be needed for proper typesetting. Letters of math font development as well as the many challenges alphabets are the exceptions: since a font change in faced by font developers of OpenType math fonts. math usually also conveys a different meaning, each variation of a letter has a separate slot. 1 Introduction OpenType, as a font technology, provides the In this paper, we will discuss technical details of glyphs and metric information for mathematical out- OpenType math font development, so we will as- put. OpenType math fonts are encoded based on sume that readers have some familiarity with the ba- Unicode, but they can extend beyond the scope of sic concepts of Unicode math and OpenType math Unicode by taking advantage of the private use area. font technology. Where Unicode math defines only a single slot When we speak about Unicode math, we re- for each symbol, OpenType math provides lookup fer to an effort that was undertaken between 1998 mechanisms for multiple sizes of glyph variants or and 2002 by a group of scientific and technical pub- glyph substitutions for constructed symbols. lishers to get math symbols and alphabets accepted Where Unicode math does not define any pro- into the Unicode standard. As a result of this ac- visions for the semantics of math, OpenType math tivity, hundreds of math symbols as well as dozens provides a table to store the font metric information of math alphabets have been added to Unicode, and controlling the spacing, but leaves interpretation of have become part of the official standard ever since these parameters to the typesetting engine. Unicode 3.2 was released in 2002 [1, 2]. In the end, it all depends on having an Open- From a technical point of view, Unicode math is Type math-capable typesetting system to take ad- nothing special, just a convenient term for a subset vantage of the information in OpenType math fonts of Unicode that is relevant for typesetting math. and to properly arrange math formulas. When we speak about OpenType math, we re- When OpenType math was first introduced, MS fer to an extension of the OpenType font format [3] Office 2007 was the only available OpenType math that was developed by Microsoft when they intro- engine, but both X TE EX and LuaTEX have since im- duced support for math typesetting in Office 2007 plemented OpenType math capabilities [8, 9]. [4, 5]. As a result of this, a new optional MATH While X TE EX provides only a partial implemen- table has been added to the OpenType font format, tation, LuaTEX aims to provide a full-featured Open- which is used to store all the additional information Type math engine. (As of 2012, work on improv- needed for proper typesetting of math, such as font ing math typesetting in X TE EX has been ongoing, metric parameters controlling the spacing of math so hopefully both engines will eventually be able to as well as additional lookup mechanisms of glyph produce the same quality of math typesetting.) variants [6, 7]. From a technical point of view, OpenType math 2 Progress in OpenType math fonts does represent an extension of the OpenType font When OpenType math was introduced, only a single format, but it uses a well-defined extension mecha- math font was available: Cambria Math, which was nism, so the optional MATH table will only be seen developed by Tiro Typeworks on behalf of Microsoft and bundled with MS Office 2007. In some sense, * First submitted for publication in the Proceedings of the the situation was reminiscent of the early days of 5th ConTEXt Meeting 2011 (to appear). Updated and revised for BachoTEX 2012. Updated and revised again for TUGboat. TEX, when Computer Modern was the only available Reprinted with permission. math font in METAFONT format. Ulrik Vieth TUGboat, Volume 33 (2012), No. 3 303 In recent years, several more OpenType math while to consider the question: What is the basis for fonts have been added, so by the time of writing the OpenType math font development? first revision of this paper (September 2011) we had First, there is a specification of the OpenType at least 4 math fonts available as released versions: MATH table, developed by the Microsoft typogra- • Cambria Math, by Tiro Typeworks on behalf phy group. The specification is officially considered of Microsoft [11], experimental and is available only on request, so it has remained unpublished for years, despite the fact • Asana Math, by Apostolos Syropoulos [12], that it has been widely adopted as a de facto stan- • XITS Math, by Khaled Hosny, derived from the dard by typesetting engines and font tools. STIX fonts [13, 14], Next, there is a reference implementation of an • Latin Modern Math, by the GUST e-foundry OpenType math font, Cambria Math, developed by [15, 16] (released in June 2011). Tiro Typeworks on behalf of Microsoft. This font is In the meantime, several additional choices of math widely available, and can be viewed with font editors fonts that were under development have been com- such as FontForge, making it easily possible to study pleted and released as well: how it is constructed and what it contains. Finally, there is a reference implementation of • Minion Math, by Johannes Küster [17], an OpenType math typesetting engine, namely MS • Lucida Math, by Khaled Hosny on behalf of Office, developed by the Microsoft Office group. Un- TUG, designed by Bigelow & Holmes [18, 19] like the specification, which is at least somewhat (released in March 2012), open, the reference implementation is completely • TEX Gyre Pagella Math, by the GUST e-foundry closed and off-limits, so it is impossible to see how [20] (released in June 2012), the specification is actually implemented. • TEX Gyre Termes Math, by the GUST e-foundry Given this scenario, developers of OpenType [20] (released in October 2012). math fonts or engines face the problem of determin- Finally, two more math font projects are under de- ing what defines the reference behavior and what velopment or have been announced: may be needed to make their fonts behave correctly with different typesetting engines. • Neo Euler, by Khaled Hosny on behalf of DANTE, First, the OpenType math specification may designed by Hermann Zapf [21, 22], not be perfect, leaving some gray areas open to ques- • Maxwell Math, by Tiro Typeworks [23]. tions or interpretations. For example, there is hardly Given all these recent and ongoing font projects, any description when to apply italic correction. we now have OpenType math font support for a Next, the reference OpenType math font may number of popular text typefaces, such as Latin not be perfect either. For example, it may have Modern, Times, Palatino, Lucida Bright, and Min- some incorrect parameter settings, which may con- ion, although some of these are non-free, but subject fuse some engines when interpreting the parameter to the usual industry proprietary licensing. values literally. In some sense, the situation is now reminiscent Finally, the reference OpenType math engine of the early days of PostScript font support for TEX, may not be perfect either. For example, it may when choices of math fonts were still very few, but have interpreted the specification in certain ways, several popular typefaces were already supported. or it may have included some workarounds to patch An interesting note is that these fonts have been certain problems in the reference font. developed by relatively few teams and individuals: In LuaTEX, the implementation of the math en- Tiro Typeworks (Cambria, Maxwell), the GUST e- gine has followed the specification as much as possi- foundry (Latin Modern, TEX Gyre), and Khaled ble, but in case of doubt, it has chosen to follow the Hosny (XITS (with STIX), Neo Euler, Lucida), in reference implementation. OpenType math fonts addition to the solo efforts by Johannes Küster (Min- developed and tested with LuaTEX should work with ion Math), and Apostolos Syropoulos (Asana Math). MS Office equally well, although they may not work We may conclude that OpenType math font de- quite as well with earlier versions of X TE EX. velopment remains a very challenging task, that has been mastered by only a few. 4 OpenType math development challenges Development of OpenType math fonts is challenging 3 References for OpenType math for many reasons. Besides the inherent complexity, Before we consider the challenges faced by font de- the size of the project is also a factor. Typical exam- velopers of OpenType math fonts, it may be worth- ples of OpenType math fonts may include between OpenType math font development: Progress and challenges 304 TUGboat, Volume 33 (2012), No.