<<

Mathematical Mathematical and Scientific Typesetting Solutions from

Edited by Ross Mills & John Hudson with contributions by Richard Lawrence and Murray Sargent 4 Foreword 5 About this 6 Introduction & acknowledgements 9 Historical perspectives on the of 23 Features of the Math 26 support and set 27 Overview of the math table

Dedicated to Donald E. Knuth 29 Size-specific OpenType -styles 30 Flattened accents and dotless forms

Microsoft may have patents, patent applications, , , or other 31 Variants and assemblies intellectual property rights covering subject matter in this . Except as expressly provided in any written license agreement from Microsoft, the furnishing 33 Math of this document does not give you any license to these patents, trademarks, 35 Italics correction copyrights, or other intellectual property. 36 Accent attachment 37 Cambria Math on screen © 2007 Microsoft Corporation. All rights reserved. 39 Mathematical input and layout Microsoft, Windows, ClearType, and Cambria are either registered trademarks or trademarks of theirMicrosoft respective Corporation owners. in the and/or other countries. 48 Mathematical sample settings The names of actual companies and products mentioned herein may be the 55 Conclusion

Printed in Canada. Foreword About this book Geraldine Wade, font development manager managers, mathematicians and scientists, and font developers who Thishave bookintroduced introduces the highest the work qualities of the teamof mathematical of software typesettingengineers and to as vital today as it has been throughout the history of modern sciences. TheIndeed, need quality for well-designed, and optimal well-executed composition mathematical for math setting typesetting are is is placed in an historical perspective highlighting the long tradition of currently even more crucial, due to the importance of mathematics the latest generation of Microsoft® Office and other products. This work

collaboration between mathematicians and typographers to express in About this book and science in our everyday lives and the use of in the written form mathematical concepts and formulae. preparation of including mathematical expressions with ™ Math font implementation for mathematical typesetting, rather than on the math layout engine important as in print; so there’s an added dimension to the work software,The book and focuses is intended on the as Cambria an introduction for mathematicians and necessaryintricate structures. to produce Additionally, a font or set reading of fonts on that screen will be is becomingboth legible as and scientists as users of the font, and for designers and font developers beautiful in both mediums. interested in understanding the general principles of Microsoft’s Bringing math and design needs together to make a fully functional product that typesets math well is a challenge and an opportunity that ultimately enriches both disciplines. Math symbols and expressions whichapproach will to be mathematical made available typesetting in other formats. and the Itfeatures is written of the as aCambria general contain a rich visual vocabulary waiting to be explored by the Mathoverview, font. in The order book to does be accessible not provide to those detailed whose technical interest documentation, is in the quality of the results of mathematical typesetting, rather than the that can represent the needs of a mathematician are an minutiae of how those results are achieved. typographer.invaluable aid The to quality art and mathematical skill necessary typesetting to make a andset of increased well designed comprehension for the reader and student. In this project we believe we have made a step along the path toward The book concludes with a specimen of mathematical formulae improving mathematical typography for our customers worldwide. typeset in 2007, using the new math layout functionality and the Cambria Math font.

 | Foreword Introduction

Mathematics is a . Like other it has dialects and symbols spill outward and upward across the , dance around specialist vocabularies, and it evolves to express new ideas and to lines and braces, jump up from their baselines and nestle beside name new objects and concepts. It also has its own writing that, like many of the world’s writing systems, has borrowed symbols beauty that frequently seems more open and expansive than the stiff from the of other languages and also invented new theirrows companions.or columns of A letters page of that well-set characterize most has writing a particular systems. visual But

particular need to express complex ideas in concise ways, has resulted of control required to accurately size and position each element is insymbols. an especially The evolving productive nature writing of the system. language Mathematical of mathematics, and not its verythis expansiveness great, and the renderingand apparent of the fluidity mathematical is hard-won. notation The measure in typeset only write according to established orthographical conventions, but form has long been a major challenge to typographers, printers and the developers of typesetting equipment. But as the historical section

frequentlyalso their relative invent newsize andconventions spatial relationships. to express original Vertical ideas. and horizontalCrucially, aims of mathematicians and those of typographers, in expressing as notarrangement, only the visual enclosure symbols within have other significance symbols—which in the writing may system,grow or but of this booklet reveals, there is also a natural affinity between the shrink relative to their contents—, changes in size or weight: all these fruitful collaboration between mathematicians, typographers and elements make the of mathematics among the most designers.clearly as possible ideas and concepts. This has resulted in a long and dynamic and, for the typesetter, most challenging in the world. Bringing together the skills and knowledge of mathematicians, researchers, scientists, programmers, text layout and font engineers, project managers, type designers and testers—acknowledged theThe very poet-typographer solid form of typeset Robert text Bringhurst has been, andcalls remains, writing “thea challenge solid form of language”. Reducing the ideas of mathematicians and scientists to Microsoft’s typesetting solutions is a testament to both individual and page or, increasingly, on the computer screen may seem quite liberated corporateoverleaf—was commitment. a major undertaking. The successful implementation of for authors, editors and typographers. The result, seen on the printed

and fluid compared to the written forms of most other languages: the  | Introduction Introduction |  Acknowledgements Historical perspectives Math layout handler

(developers); Vivek Garg, Eliyezer Mary Kohen Wang (initiator); and Greg Heino Andrei (testers). Burago, Sergey is to make high quality math setting available to users familiar with Genkin, Victor Kozyrev, Igor Zverev, Alexander Vaschillo and Anton Sukhanov One of the goals of Microsoft’s new mathematical typesetting solutions Cambria Math font

common word-processing programs, and to make it fast to learn Historical perspectives (developers); Geraldine Jelle WadeBosma, and Robin Greg Nicholas, Hitchcock Steve (managers); Matteson Vivek and Ross Garg the handling of complex mathematical typography into the existing (tester).Mills (designers); Ross Mills, John Hudson, Mike Duggan and Andrei Burago and easy to get high quality results. Another goal is to incorporate and other common resources, so it can be utilized by a broad range of Math font program and editor applications,architecture of not OpenType limited to® thefont arrangement technology, the and RichEdit layout of equations library RichEdit Sergey Malkin (developer). on paper. In this approach, Microsoft is building on its strengths and experience in text processing and font technology, but it is also Murray Sargent, Sasha Gil, Mikhail Baranovsky, Hon-Wah Chan and José building on centuries of work by mathematicians, scientists, educators, Oglesby (developers); Zane Mumford (manager); Isao Yamauchi, Greg Heino, Microsoft Word typographers and printers who have sought to give visual expression to Yuriko Rosnow and Parag Palekar (testers). mathematical concepts. (testers). Ethan Bernstein, Said Abou-Hallawa, Ali Taleghani and Bryan Krische (developers); Jennifer Michelstein (manager); Jason Rajtar and Yi Zhang Microsoft Math Calculator typesetting is a history of distinguished collaboration, involving some Kelly (tester). of theAs the greatest following names overview in mathematics shows, the as historywell as ofmany mathematical anonymous Jinsong Yu (developer); Ben Kunz (manager); Luke technicians, typesetters and printers. Office Art Handwriting Segue to Features of the Cambria Math Font of the Cambria Math Features Segue to

Microsoft Research developers, testers and project Many thanks to Barbara Beeton ( managers (Asia, Redmond, Belgrade) AMS), Asmus Freytag, Ron Whitney, Richard Lawrence, and for their advice and very helpful discussions, and to Paula B. Croxon for editorial consultation on this book.

 | Introduction Historical perspectives on the typography of mathematics matter, which is arranged into words and so as to aid craft of rightly disposing printing Richard Lawrence So a typeface fit to the subject matter does not distract from that “Typography may be defined as the purpose; of so controlling the and often beautiful, marriage of form and function. typematerial as to in aid accordance to the maximum with specific the comprehension.Mathematicians The have result a keen is almost sense invariably of beauty anand aesthetically the importance pleasing, reader’s comprehension of the text.” Thematerial typesetting for the andprinter printing is now of largely mathematics up to the is todayauthor much or editor, easier and than First it has ever been. In the , preparation of press-ready principles of tpography, of utility in notation. An argument or idea clearly and concisely Stanley Morison, of preparation is complemented by the remarkable quality of the expressionexpressed will of those garner ideas the ondescription paper may of also“beautiful”. be described But the as concept beautiful. 1951 typesetting:can be produced both onare, a ofpersonal course, computer. related to Thisthe ingenuity comparative and ease abilities of of mathematicalWritten mathematics beauty isis appliedan exceptional, more widely perhaps than unique, just to language:ideas. The unnecessary work, a good notation computer programmers, but they are also a testament to the skills of “Bysets relieving it free to the concentrate brain of all on more the type designers and typographers who prepare typefaces for the very … [mathematicians] have to express values, quantities and relationships by symbols advanced problems, and in effect exacting use they get in mathematics. which differ basically from those of the , in that they have no phonetic increases the mental power of the value. … In the mathematician’s world they still use sign language. … a soundless human race.” In the and typesetting, mathematics holds a world in which the most complex and delicate statements can be made, to anyone in the world who can read them without any trouble about the language barrier. peculiar place. It is both the material most feared by typesetting An introduction to mathematics, craftsmen and the inspiration for some of their greatest technical The Monotype Recorder, Alfred North Whitehead, achievements. It is the subject matter that has perhaps inspired the MathematicalArthur Phillips, arguments have to be written 40, 1956 in this silent language: most intense collaborations between authors and printers, yet it is 1947 it would be very taxing indeed to complete many mathematical discussions without pencil and paper or their equivalent. Given the subtle and perplexing nature of much mathematics, the details of the typographeroften one of the and least mathematician commercially that rewarding has, at least for inpublishers. recent times, Through drawn written form are clearly going to be important to the task of conveying theall this two history, together though, in overcoming there has common been an problems.affinity of purpose between Good typography is transparent and does not place itself between the reader and comprehension: rather it silently aids understanding. theand argument a mathematician without examining introducing the opacity same piece or distraction. of mathematics The aims may of not the mathematician are then the same as the typographer. A typographer

10 | Historical perspectives Historical perspectives | 11 have an equal understanding of its meaning, but they are likely to have the compositor must pay close attention to the spacing of the sorts an equal appreciation of the aesthetics of its presentation: both seek to make it visually easy to follow and aesthetically pleasing. adjacent sorts came from separate typefoundries and may be cast on insubtly both different dimensions. sizes This of body. would have been particularly difficult when The difficulty of mathematical typesetting It is here that the far subtler matter of also enters the readily understood as part of an otherwise ordinary word in most in their , and compositors picture. A with a particular quirky design may be tolerated and What used to make mathematics difficult for the typesetter and “…as gentlemencareful in following should be it, very that exact no page of text. In mathematics it is necessary for the reader to be able to expensive for the publisher? One obvious answer is incomprehension alterations may ensue after it is typography: it may even add “color”, enlivening the greater without any idea of what is being conveyed. composed; since changing and al identify each and every sort reliably in isolation, and also to distinguish of theHowever, subject compositors matter. The (typesetters)difficulty of knowing with a bare how minimum to arrange of type is tering work of this nature is more schooling used to successfully typeset foreign languages in ignorance of troublesome to a compositor than- family of typefaces is a boon to mathematical typesetting and to the can be imagined by one that has not whether it is in italic, sans , bold or plain roman. A well-designed tolerable knowedge of printing.” in types designed for typical text work is unlikely to be completely their meaning. There are two substantial physical difficulties in setting The ’s comprehensionsatisfactory, although of the that reader; is exactly “making what do” happened with what for is mostalready of theavailable mathematics. The first is the extraordinary diversity of individual grammar, the many sizes required. Each sort in each style had to be literally at Caleb Stower, history of mathematical printing. hand.characters Marshalling or “sorts” all inthe various sorts required styles (bold, was italic,a logistical sans serif,problem etc.) and and in 1808 the days of metal type, ensuring an adequate supply of each sort was an gebra only, double price. When in Hand typesetting of mathematics Handset mathematical type. Above, industrial enterprise with considerable material expenses. “Algebraiclines or paragraphs, work, in treatises to be charged on al- the as printed and, below, a diagram of the pieces of metal type per hour, or about treble price.” the invention of casting movable (reusable) type in metal: individual and spacing material necessary. The second difficulty is that unlike conventional text, mathematics is by time at the rate of 60 cents The “invention of printing” in Europe around the year 1450 was really (From L.A.Legros and J.C.Grant: arrangement of sorts. In the days of metal type, this was a considerable Typographical printing surfaces. not linear in its construction: an equation depends on a two-dimensional The printers’ price, mechanical challenge, which demanded all the ingenuity the typesetter Theodore L. De Vinne, Longman, Green, and Co., London, 1871 lettersof type andwere signs then were assembled cast in byhand-held hand into moulds lines, andas raised the lines surfaces into on a 1916.) conveniently sized rectangular of metal. These individual pieces could muster. To create a really good piece of mathematical typography 12 | Historical perspectives Historical perspectives | 13 La Géométrie of using italic letters to denote quantities of interest: printers mathematicalparagraphs and printing pages whichwould were have thenbeen printed. from such Once type printed, set by thehand. René Descartes, in of 1637, started the current practice type could be reused to typeset fresh lines and pages. The earliest in conjunction with . It was some time before many printershad started had to roman use italic and typeitalic in type the castlate tofifteenth the same century, body sizebut notthat As mathematicians began to develop their subject, so they withneeded the to latter find exploringnew notation what to the express former their had discovered to offer in theknowledge. way of There is evidence of interplay between printer and mathematician, wouldprinter fit faced together greater conveniently. demands to assemble complicated expressions As notation and calculations became more complicated, so the Algebranew type: styles and symbols. In 1647, the English mathematician William Oughtred recognized the benefits of good notation in his from individual pieces of type. They began to devise or suggest Which Treatise being written not in the usuall synthetical manner, nor … we propose one that is similar to an Italic l inverted, and whose with verbous expression, but in the inventive way of Analitice, and with labor-savingfigure takes notation:in the whole depth of its body; which then would have the symboles or notes instead of words, seemed unto many very hard; though resemblance; viz. l l l indeed it was but their owne diffidence, being scared by the newness of The printer’s grammar, the delivery; and not any difficulty in the thing it selfe. For this specious 3 5 12 63 16 30. and symbolicall manner, neither racketh the memory, nor chargeth John Smith, 1755 the phantasie with comparing and laying things together; but plainly Maxwell in his Electromagnetic theory, presenteth to the eye the whole course and processe of every operation and anotherIn 1893, type Oliver style Heaviside when seeking popularized a notation the forwork vectors: of James Clerk argumentation. and was the “discoverer” of Maxwell employed German or Gothic type. This was unfortunate choice, being by itself sufficient to prejudice readers against vectorial analysis. … advance, a move from words that clearly referred to concrete things “Mathematical, algebraical, and Some of them are so much alike that a close scrutiny of them with a glass The ‘symboles or notes instead of words’ were a considerable geometrical characters” in J. Johnson, is need to distinguish them unless one is lynx-eyed. … Rejecting Germans Typographia or the printers’ instructor. and Greeks, I formerly used ordinary Roman letters to mean the same roman letters to denote his quantities, a practice that can be traced Longman et al., London, 1824. to symbols that represent abstractions. Oughtred used capital as Maxwell’s corresponding Germans. … Finally I found salvation in Johnson, ibid. , and introduced the use of the kind of type so called I believe,

back to at least 1544 and the German mathematician Michael Stiffel. Clarendons

14 | Historical perspectives Historical perspectives | 15 for vectors (Phil. Mag., August, 1886), and have found it thoroughly Improving mathematical typography suitable.

by low contrast between thick and thin strokes, heavy slab serifs Onepublisher early attemptthey cut topunches improve and mathematical made sorts to typography match their involved existing types were a relatively recent type style, characterized the Inland Typefoundry of St Louis in 1900. At the suggestion of a notational problem, a solution now part of mathematical orthodoxy. uniform widths and the alignment of different typefaces on the and generous width. They provided a convenient solution to a Oldstyle No.11 type. They also rationalized the setting of sorts to the hand compositor much easier. It is therefore unclear why more Sometimes a mathematician would come to the rescue of the printersbody of the and type. publishers These innovationsdid not take made advantage the mechanical of this work, work but of it printer. A bar over several characters is a very effective and easy- was largely neglected. to-understand notation when symbols are to be linked, For purely mechanical reasons, though, it is difficult to place bars over or under alternative: and the Monotype system for composing metal type mechanically. characters in typesetting. Leibniz suggested a printer-friendly When one or both of the factors are compounded of several letters, they A more successful attempt involved are distinguished by a line over them; … Leibnitz, Wolfius, and others, ’s printer, John distinguish the compound factors, by including them in parenthesis FollowingJohnson, was an audaciouspresented raidwith by the the problem Oxford of University setting mathematics Press into the thus ++ . “enemy territory” of Cambridge in March 1928, OUP J. Johnson, Typographia or the Printers’ Instructor, (푎 + 푏 − 푐) 푑 However, the effect of the mathematician raiding1824 the printer’s for a newly founded physics series and its first Cambridge-based reserves of type, while providing solutions to notational problems, Typical handset maths from D. A. Low, A previouslyauthor, P. A. set M. Dirac.in oldstyle A pair types of mathematical provided a training journals ground. acquired Johnson pocket-book for mechanical engineers. tended not to produce very harmonious typography. It can be roseat about to the the challenge same time and from set aabout small researching Cambridge apublisher typeface andto use. Longmans, Green and Co., London, 1915. Inland Typefoundry’s improvements to oldstyle type for mathematical typesetting already had a large investment in modern types and matching (excerpt from Old style type on bookwork, matchingdifficult enough sorts. to express a mathematical idea in symbols without HisGreeks choice and was special Monotype’s sorts for Modern its dictionary Series work. 7, possibly Johnson because did not OUP just privately printed, St Louis, 1902.) the visual distraction of those symbols being a rag-bag of ill-

16 | Historical perspectives Historical perspectives | 17 commission new mathematical sorts to match the existing holdings of , he also sought to formalize the rules of mathematical typesetting. authors, from force of circum of sorts, but the peculiar spacing requirements of mathematics and “Printing-housestances, have had proprietors to be content and as Series 569. The parent Times face was well provided with a range - OUP with many characters imperfectly made, obtained from different With the assistance of a small panel ofThe mathematicians, Printing of Mathematics he codified the sources, designed by different thebody highly and each innovative equation technicalities was broken of down the 4-line into four system lines. made With special the rules of mathematicalet al. typesetting. These were eventually published by men and at different periods, demands. At the system’s heart, a 10 face was cast on a 6 point Johnson’smatters of successor, spacing, emphasizing Charles Batey the in great importance in mathematical [T. W. The Monotype Chaundy 1950]. More than half of the Oxford rules are given over to introduction of the Monotype 4‑line system in 1959 hot-metal typesetting typesetting not just of choosing the correct sort, but also its correct varying often over fifty years.” Recorder, disposition in relation to others. Old style type on bookwork, providehad reached benchmarks its “technological that are still zenith” used [David today. Saunders, The details of Monotype’s 4-line Carl Schraubstadter, system for setting mathematics. 1902 New Series 10, 1997]. This and the previous Oxford system The eclipsing of hot-metal systems typesetting.The Oxford Even rules though were manydeveloped elements for use of anwith equation Monotype could keyboards beand keyboarded casters. This in was this thesystem, first mechanizationthe assembly of of the mathematical elements required skilled handwork. But with good training and the typographically by Monotype, but increasingly they wanted a less inherent precision and controllability of the Monotype machinery, Mathematiciansexpensive way of and composing scientists mathematics may have been that well-served was more directly the results were exceptionally good compared to what went before. under their control. Publishers also wanted an inexpensive alternative method to compose mathematics in order to make more specialist composition of mathematics. Aexpensive new standard both inof operationmathematical and intypography training. With had beenan increase set. in The skilled handwork of the Oxford method made it slow and and ephemeral publications viable. Technology new to printing was interchangeabilitypressed into service. gave The access IBM golfball to the range typewriter of special and sortsVarityper needed; both good andscientific increase publishing what could and bein mathematicalaccomplished workdirectly in particular,from the keyboard. the Monotype Modern Series 7 type typistsoffered orstrike-on the mathematicians typesetting with themselves interchangeable could operate type heads.the machine, The Monotype Corporation started to investigate ways to reduce handwork employed by OUP for mathematical reducing labor charges dramatically. Huge compromises had to be made typesetting. in typographical quality, with very limited variations in character widths Using the American Patton Method as inspiration, the Monotype 4-line system was born. The highly popular Times typeface was adapted 18 | Historical perspectives Historical perspectives | 19 and spacing, but immediacy and cost reduction were important driving forces. trickier problems of mathematical spacing and layout in specialist control. That computing power could be harnessed to some of the

lithographicPhototypesetting, printing whichbecame had more first popular. been developed Photosetting in the machines 1940s, started programs and routines. The Linotron 404 and, more importantly, 202 to appear as an common method of composition in the 1960s as offset machines from Linotype used a high-definition cathode ray tube to project a digitally generated image onto photosensitive paper or film generatedcould be made. lines Mostof type early from photosetters film masters, were using limited a photographic in the number process of under microprocessor control. The 202 set the standard for quality to set the type on rolls of paper or film from which lithographic plates mathematical composition from its introduction in 1978. TEX sorts carried on their film masters, making them unsuitable for anything but the simplest mathematical work. An exception was the Monophoto machine from Monotype. Its film masters were carried in individual Despitedisgusted these one advancesmathematician in professional that he seized typesetting, the moment, the poor and the mathematicaland interchangeable setting. photomatrices. Coupled with an adaptation of typographical standards of the populist strike-on composition so the 4-line system, great flexibility and good quality were achieved for newprocessing technology and typesetting of raster-based system laser capable output, of tomathematical completely change work. Digital structure of type used meantThe thatadvent a huge of photocomposers range of special withsorts digital could ratherbe accessed than photographiceasily Intriguingly,how mathematicians Knuth’s explanation work. Donald of Knuththe working developed principles TeX as in a termsword- of in the Linotron 202. masters opened a new era in mathematical typesetting. Digital storage boxes and glue, the boxes being the sorts and the glue amounts of , shows similarity to the physical workings of the Monotype and created almost as easily. Digital storage also meant computer

tomachine, operate, with it needs which information Knuth was aboutfamiliar. the The chosen fixed-size typeface. of a Knuthbox dictates was thorougha certain size in his for research the character and also to occupydeveloped the abox program (or vice for versa). drawing For TeX Linotron composition of mathematics. was

typefaces, . The typeface he chose to run with TeX 20 | Historical perspectives Historical perspectives | 21 x x The Cambria Math font

mathematics . was a resounding success with mathematicians r r y , similar to the Modern Series 7 of traditionally set and scientists for a variety of reasons, not least of which was being free z software. quicklyT developedeX a base of very active and devoted users Typographic elements in TEX; are who cooperated to improve and extend it, and it produces results of defined as boxes. the x-y distance is Asexisting the previous typographic section elements records, and the extending history of existing mathematical typefaces typesetting to remarkableTe Xquality and consistency which can be reliably reproduced the glyph height, the y-z is its depth. incorporatehas often mingled specialised symbols. with In expedience, this aspect, findingMicrosoft new has uses broken for Where the two meet is the reference point (r). logical” order when building equations: an advantage over traditional and Monotype historically sought to improve the typographic quality typesettingon a variety programs,of printers. which It also tended allows to data require entry data in a entry“mathematically to follow withof mathematical tradition. While setting the by Inland adapting Typefoundry, existing types, Oxford Microsoft University has Press Cambria Math the mechanical constraints of the technology and which made no mathematical sense. Printers were initially very slow to make use of its commissioned a new typeface, Cambria Math, designed from the outset with the needs of mathematics in mind. The new type was also designed was alien to them. But ’s overwhelming success with authors means TEX character boxes are ‘glued’ rendering, acknowledging the increasing thatpotential: mathematical it bypassed typesetters all their existinghave had systems to learn and how its to data-entry use it and orderapply together to form word boxes (dotted toimportance perform well of electronic on screen publishing and to leverage and information the benefits exchange. of Microsoft’s their accumulated typographicTeX and design experience to it. line). acclaimed ClearType®

image setters and computing power, he was free to work from scratch to supportThe following mathematical section looks typography. at key features of the Cambria Math font, Starting, as Knuth did, with no more than access to digital raster including extensions of the OpenType Layout format and new font tables TEX word boxes are glued together allowed him to build a logical and very robust structure aimed at solving to form line boxes (double-line) and withoutthe problem, constraints and of any pre-existing programs or systems. This line boxes are glued together to form mathematical typesetting. boxes. The ‘glue’ between T X is certain to influence all future developments in any of these boxes can be stretched e or compressed to alter character spacing, word spacing etc. and to aid in paragraph justification.

22 | Historical perspectives Features of the Cambria Math font For more information about the ClearType Font and the The Cambria Math font is an extension of Cambria, a four-style font ClearType rendering system, see the Microsoft publication Now read this. days, the setting of mathematics has posed problems for the typesetter family designed by Jelle Bosma as part of the Microsoft ClearType Font Customthat have type been for answered mathematical by the typesetting manufacture is nothing of new typographicnew. Since its early Collection. Cambria, like other members of the collection, was designed For general information about to take advantage of Microsoft’s ClearType rendering system, which OpenType, see the Microsoft devising new symbols to express concepts has placed considerable isbeen designed carefully to improvedesigned the to beexperience clearly legible of screen at the reading. small sizesThe weight and Typography website: www.microsoft.com/typography/ demandcharacters. on Thethe makersinventiveness of type, of although mathematicians the cost andof scientists in and proportion of the letters, numerals and symbols in Cambria have weighed against the relatively small returns on specialist publishing subpixel rendering and positioning. has limited the actual number of fonts available for mathematical work. ��� low resolutions of the screen environment, enhanced by ClearType’s (the visual representations of the abstract characters encoded in changed this situation, and if anything the variety of typefaces available Development of the Cambria Math font involved design of additional Theis reduced, advent sinceof computer most mathematical typesetting for texts mathematics have been producedhas not, so in far, and the inclusion of advanced information in the font to be used by the ��� text), revision of some of the existing glyphs from the original Cambria, application- and font-specific formats. standards, the Microsoftfor supporting math complex layout handler. scripts This(e.g. information includes new, math- The recent inclusion of a large number of characters for mathematical specific features within the OpenType Layout table inarchitecture the font containing already used publishing in and corresponding ISO ��� values to be interpreted by the math ) handler and during high layout. quality typography, specification of the MathML by the World Wide and addition of a newly specified table govern math positioning, preferred scaling Webbroader Consortium, access and and increased the inclusion exchangeability of mathematical of mathematical typesetting texts. tools factors and substitution of glyph variants, e.g. for growing parentheses in mainstream software such as Microsoft Office, opens the door to The values in the math facilitate the typesetting of mathematics in new environments and for ����� Thesenew media. welcome developments also invite the design of new typefaces to orare braces; incorporated they are into font-specific the math handler, and are whichset by thealso type has thedesigner capability or font to ������� technician.make positioning Additional, decisions non font-specific by analysing rules the glyphs for positioning presented and to it. spacing 24 | Features of Cambria Math Features of Cambria Math | 25 �+1 Character support and glyph set Overview of the math table

For more information about the A selection of math constants: mathematical characters in Unicode, are made up of a number of discrete tables, some required and some Math The character repertoire for Cambria Math was established by the refer to Unicode Technical Report 25: TrueType and OpenType are examples of “sfnt format” fonts, which Axis Height www.unicode.org/reports/tr25/ mathematicalsymbols as well characters as alphanumeric which have characters been defined in the inwide the range Unicode of style table communicates between the math font and the Accent Base Height standard. These include a large number of operators and other optional. This format is easily extensible by the addition of new tables. Flattened Accent Base Height encountered in mathmatical text (bold, italic, script, , sans serif, math handler. It contains data related to horizontal spacing, vertical Subscript Shift Down positioning,The new matglyphh variants and assemblies, preferences for elements Subscript Top Max Subscript Drop Min etc.). In Cambria Math, an extensive subset of these characters were Superscript Shift Up addedsettings to into the textspan-European in a wide rangemultilingual of languages character written set of in the the original , detailedsuch as rules in this which small are booklet, “drawn” but by many the handler, of them specialare illustrated math kerning, in the Superscript Shift Up Cramped Cambria fonts, enabling the seamless intergration of mathematical and additional global parameters. These are too many to be exhaustively Superscript Bottom Min pages that follow and give some idea of both the general methodology Superscript Baseline Drop Max and the level of control available to math font developers. Sub-Superscript Min Gap Greeknumber and of Cyrillicunencoded scripts. variant glyphs, which are accessed through Superscript Bottom Max With Subscript In addition to the characters defined table in rules. Unicode, Most there of these is also are a variantlarge Space After Script sizes of a base character for stretching around large equations or over The information in the math table can be categorized into font-level Upper Limit Gap Min OpenType Layout features or math values, glyph-level values, and glyph lists. Font-level values are stored Upper Limit Baseline Rise Min e.g. superscript and subscript positioning; Lower Limit Gap Min parentheses and radicals, as well as accents of different widths that can linespacingas “constants”, within in which stacked the equations; font developer axis heightis able forto set vertical more alignment; than Lower Limit Baseline Drop Min and under strings of text. For instance, there are several sizes of , fiftybar, ruleparameters and vinculum related thickness; to gap allowances between elements such Stack Top Shift Up glyphs include scaling forms tuned for use as superscripts or subscripts, as text and bars; and many others. Stack Top Display Style Shift Up andsit over dotless wide versions characters of i orand over j characters multiple forcharacters. use with Other accents unencoded above. Stack Bottom Shift Down Stack Bottom Display Style Shift Down correction, which helps refine positioning of superscripts; accent Stack Gap Min attachment,Glyph-level which values allows apply the to developerindividual toglyphs define and preferred include positioningitalics Stack Display Style Gap Min The original Cambria Regular font contained 992 glyphs, already of accents (rather than relying on automatic centering); and math Stretch Stack Top Shift Up making it a “large font” by many standards. The Cambria Math font contains an additional 2,900 glyphs.

26 | Features of Cambria Math Features of Cambria Math | 27 kerning, which gives fine control over relative horizontal spacing of Size-specific OpenType script-styles glyphs at different vertical alignments. When a or numeral is mechanically scaled, for example for use Glyph lists provide character variant and assembly information. In as a superscript, the strokes that make up the glyph are reduced in weight, while the internal spaces of the form are pinched. It is preferable simple terms, these indicate a base Unicode character and a list of for glyphs to become more robust as they are reduced in size, and for variants for that character and/or ways to assemble the character from their proportions and spacing to become more generous, so that they multiplea glyphs. or stack The grows variant in the list vertical is accessed direction by the and math is enclosed handler whenin a determining the best glyph to use in a given situation. For instance, as delimeters, e.g. parentheses, taller versions of the delimeter can be used. harmonise well with nearby full-size glyphs. � charactersIn Microsoft they mathrepresent, fonts, andsize-specific are then scaled“script” for and use “script-script” as super or variant glyphs are designed at full size relative to the base Unicode table font Thefor more math information handler measures about variantsthe height and or assemblies.] width of an equation and then � selects the best match the variant list or assemblies list. [See pages 29–30 subscript forms according to factors specified in the math � � constants. When displaying a character as script or script-script, the 푎 � � � math handler calls a new OpenType Layout feature, , which performs a glyph substitution of the appropriate size-specific glyph. The � and second feature alternates employs respectively. an enumerated lookup type, so the same feature may include both script and script-script variants, mapped as the first ℎ � � � script-script � The adjustments to weight and proportion desirable for the script and script scriptscript-script variants styles were are shortened not necessarily so exponents linear relative would be to morethe base compact glyph. base � � In the case of Cambria Math, the ascenders and capital height of the 푥 � � � are taller to aid legibility at very small sizes. � and work better for inline formulae, but in the script-script style they 28 | Features of Cambria Math � 퐸Features� of Cambria � Math | 29 � �� � � � 푥 Flattened accents and dotless forms Variants and assemblies

Two additional new OpenType Layout features have been introduced for Thedesigned math andfont then format listed allows in the the designer table to as define variants sets of a mathematical typesetting: one is Flattened Accents , the other is baseof both glyph. vertical and horizontal glyph variants. These are �������� Dotless Forms . math The feature accesses variant accent forms which have been (parentheses, braces, brackets, etc.) or radical signs, lowercasedesigned to letters, sit above so allow capitals for ormore other compact tall letters. linespacing These accents and vertical are whichVertical should variants match are the most height often of expression used to “grow” they delimiterscontain. vertically shorter than regular accents designed for use with x-height deployed by the math handler is set in the e.g. . `` Horizontal variants can be defined for characters such as gaps in stacked equations. The height at which flattened accents are shown at right. math table and the ofover- various and under-delimiters widths or over multiple and arrows glyphs, or vectors,e.g. . ����� feature lookup simply maps accents which have ai and“flattened” j, in all theirvariants, as � They can also be used to extend an accent over glyphs 푤� 푊 given expression, then checks the table glyph��� lists The feature maps dotted characters andThe selects math the handler variant measures whose height the width or width or height most of closely a forms, to variants with no dot. These are used when an accent needs to math be placed above the character. Arbitrary accent positioning over base Math font contains up to eight different variants for some glyphsaccent is centeredcontrolled over via the base‘accent glyph. attachment’ values set in the math �������� characters.corresponds to the size of the expression. The Cambria table­ glyph-level values; if no accent attachment values are set, then the 횤횥 퐼�퐽� If the math handler determines that all the available variants are too small, it then proceeds to assembly

glyphs, i.e. information for the character. Assemblies are sub-character ı � 횤 횥 � � � � � � � � � � � � � � two or more “pieces” that are assembled by the 30 | Features of Cambria� � Math � � � � � � � � � � � � � � Features of Cambria Math | 31 Variants: Math kerning the expression. A Unicode character, such as a math handler to represent the character that needs to be resized to fit parenthesis: In typical text setting, adjustments to improve spacing by moving glyphs ( closer or further apart, called kerning, generally involve only horizontal

Assemblies typically consist of top and bottom or left and right pieces, is mapped to a series of glyph kerning value applied whenever two particular glyphs are next to one

andstraight, medial so elementssections. Theybuilt arefrom designed assemblies, to align especially with one braces, another lack and the to variants: relationships.another. In mathematical These adjustments setting, thecan relationshipbe easily managed between by adjacenta single elegantsmoothly curvature connect. of The the connections variant forms, and but medial they sectionsare very areversatile necessarily and � � � � � � � glyphs may involve complex horizontal and vertical relationships, because sections may overlap they can adapt very closely to the size of especially when glyphs are scaled and positioned for use in superscript an expression. ( or subscript roles. table lists for a given character and additional information is provided to specify how much The assembly pieces are listed in the math → and subscript glyphs to nestle against adjacent glyphs while ensuring ������� Microsoft’s math font format uses “cut-ins” to enable superscript references this information and adjusts the positioning of the pieces to Assemblies: as glyphs are moved vertically relative to each other an appropriate matchoverlap the one height piece or can width have of with an expression.its adjoining piece. The math handler If the largest of the variants is not tall or wide enough, an assembly thathorizontal sufficient relationship distance isis maintained.maintained. The cut-ins are stepped, so that can be constructed from a series of table individual parts: Cut-in values are defined by the font developer in the math 1 betweenand may beany specified adjacent for quadrant each quadrant: on two glyphs, upper-left, e.g. upper-right, lower- ( left and lower-right. This allows for optimal spacing in relationships be either positive or negative, so may move glyphs closerupper-right together to or ( 2 → furtherlower-left, apart. as in a base to superscript relationship. The cut-in values can � → ⎛ ⎛ → 3 → spacing. In the illustrations here and overleaf, the yellow lines indicate ( ⎜ ⎜ Where two sets of cut-ins meet, they may interract, affecting the �

→ → 32 | Features of Cambria Math ⎝ 퐿Features of Cambria푇 Math | 33 ⎝ � � � � � � � � � �⇒ 퐿 푇 Italics correction

right-side cut-ins on the base glyph, and the orange lines indicate left- side cut-ins on the corresponding quadrants of script style glyphs. too close to or even colliding with following upright or superscript Theglyphs. angle In oforder italics to ensureor other that slanted a reasonable glyphs may minimum result indistance them appearing is deemsEach to quadrant be appropriate, may have taking multiple into cut-ins,account defined the font at constants different that heights, and the cut-ins may be as coarsely or finely defined as the font developer maintained, the Left, without italics correction; the glyph when itmat is followedh table contains by an upright glyph-level character, values e.g. for a delimeter“italics or right, with italics correction. determinean envelope scaling around and the vertical glyph shape positioning or, if desirable, rules for glyphs.allowing Some part glyphsof operator,correction”. or Theby a italics superscript. correction value is added to the advance width of themay outline have only to extend a single beyond cut-in, the while cut others in (as inmay the have illustration many, creating on the Italics correction is also used for positioning limits on n preceding page, where the descending tail of the subscript pierces the � � -ary operators, 푓 particularly integrals, as shown at right. Note that in this case, horizontal edge of the cut-in). table font constants, may be dynamically adjustment is defined according to the italics corrections value rather Since the vertical position of superscript and subscript glyphs, base glyphs. Because the integral sign can grow and limits may be more thancomplex by the than cut-in shown kerning here, usedinvolving for superscript more than andone subscriptsline and requiring relative to initially defined in the math based on glyph 훿 훿 dynamic vertical adjustment, the italics correction value provides a adjustedshapes. In dependent the example of ofthe the contents superscript of a formula in the or illustrations, equation, cut-ins if it were providedesirable flexible to lower control the superscript of horizontal it would relationships encounter a change in the 퐴 flexibleto the right mechanism by one half to ensure of the italicsa consistent correction relationship value of betweenthe integral the glyph, of the L (as shown at right). limits.and the The lower position limit isof shifted the upper to the limit left is by determined the same amount.by shifting In thisthe limitway, �� cut-in envelope, which would prevent it from collidingi.e. with the � a consistent angle is maintained. adjustments to ensure optimal relationships between glyphs even at low resolutionsEach cut-in on canscreen, also where have device rounding correction errors onvalues; the coarse size-specific pixel grid might otherwise cause glyphs to be too close or too far apart. 퐿 � ��� 34 | Features of Cambria Math 퐿 Features of Cambria Math | 35 Accent attachment Cambria Math on screen Base characters in mathematical typesetting may carry accents, which may not correspond to in natural language orthographies, takes advantage of discreet red, green and blue subpixels in liquid crystal ClearTypedisplays ( is a Microsoft text rendering technology for screen which particularly important in the case of italics, when simply centering the and which need to be correctly positioned relative to the base. This is i.e. accent glyph on the advance width of the base result in the accent being LCDs). To render text on screen, glyph outlines in the font must too far left, far from its ideal location relative to the top of the base glyph. normallybe “rasterised”, used for text,fitted and to ain grid the ofrelatively pixels to low give resolution the best representation of screen displaysof the glyph as contrasted shape at a withgiven print size andmedia, resolution. the pixel At grid the is small very sizescoarse. An italic letter hinted for black & basis. If a pair of base and accent glyphs do not contain an accent With traditional black and white or greyscale rendering, it is often white display. The outline is distorted attachmentAccent attachment entry in the is specifiedtable, then in the the math math handler table on defaults a glyph-to-glyph to ˜ by hint instructions to turn on or off impossible to render details or even give a reasonable impression of a specific pixels. space and the optical center of a glyph seldom match exactly, and centering the accent on the glyph. Since the absolute center of a glyph of text on screen by addressing individual subpixels during rasterisation, because so many glyphs have asymmetric shapes that call for the accent 퐴� 퐴� 퐝� 퐝� particular typeface design. ClearType significantly improves the display effectively tripling the resolution in one direction (usually horizontal). At to be off-center, most glyphs will have accent attachment positions ` consistent stroke color, even for thick and thin strokes of variant weight, the same time, ClearType uses sophisticated color filtering to maintain defined. providing a cleaner and stronger glyph image than older greyscale font The illustration contrasts centered accents, blue, with accents smoothing technologies. positioned using accent attachment values, orange. Note that the accent 푓� 푓� � �˜ attachment interacts with the flattened accents and dotless forms past ten years has greatly increased the amount of text that we read on The rapid growth and of the Internet in all areas of life in the features discussed on page 28. computer screens rather than in print. Mathematicians and scientists, of course, were among the earliest users of the Internet and electronic ClearType rendering using individual communications, but only fairly recent developments—the inclusion subpixels results in smoother curves 푔 푔` �� �� and more natural diagonal strokes. of specialist mathematical characters in Unicode and the specification 36 | Features of Cambria Math Cambria Math on screen | 37 Input and layout

Ansolutions examination required. of the Having examples looked in atthe these previous issues sections from the gives perspective some ideaof the of font the tablesdifficulties and features,involved wein mathematical can now look layoutat how and math the layout intricate is

performed in the larger of Microsoft applications, and at how the Math input & layout of the MathML markup language—have made possible the reliable Above: a screenshot of a 12pt user creates mathematical content. equation on a 145 pixel per inch display. It is difficult to accurately of this publication, as is full documentation of the new math input interchange of mathematical content in electronic documents. Cambria represent screen rendering in print, but this illustration, using full pixel language.Describing Most math of the layout material in all in its the complexities following section is beyond is introductory, the scope Mathhas guided is the allfirst aspects font developed of the font specifically production, to from provide the highdesign quality of glyph color representation of the ClearType and provides a basic overview of Microsoft’s approach to mathematical display of mathematical typesetting in table a screen values. environment. This goal subpixel rendering, gives some idea of the clarity and legibility of the of the layout mechanisms employed in correctly typesetting a famous Cambria Math font on screen. outlines to the specification of math e.g. superscript and inputequation. and layout. The section concludes with a more technical discussion subscriptBy leveraging forms, canthe displaybe cleanly improvements rendered at andtypical positioning text sizes. refinements Glyph of ClearType, even scaled glyphs in math settings, glyph that ensure the rasterizer maintains consistency of stroke weights renderingand proportions is assisted in the by low “hints” resolution in the font:grid. instructionIn addition setsto these for each general

values in the table, e.g. glyph hints, Cambria Math contains device-dependent adjustments to math desired kerning cut-in depths and heights for specific sizes.

38 | Cambria Math on screen Mathematical input and layout The math input language In the simplest cases, such as an equation like , the variables , In a math zone, the user types: adfhiknvxy and the lead of Cambria Italic glyphs are separated from the letters by spacing rules� according � � � � to established� a=b+c Microsoft’scollaboration math between layout four depends entities: on Unicode encoding and follows � � are represented by Unicode math-italic letters and the operators As each character is entered, TeX and MathML 2.0 in key areas. It is performed as a • The book. the application substitutes the appropriate math italic • the math handler built into the latest version of the Microsoft text Cambria Math math-italic glyphs mathsimpler typesetting than the layoutconventions requirements (as documented might imply: by Donald he simply Knuth types in the layouta Unicode component rich-text processing program such as Microsoft Word T X ) The input experience for the user in such a case is much character and makes appropriate normale key sequence a=b+c in the math zone and the math handler adjustments to the spacing. • the math font The italic letters used for math variables in the Cambria Math • the math font handler ����������font differ from the regular italic characters from the math font and applying the correct form and Cambria Italic font letters in both takesspacing care for of the the operators. rest, converting the letters to the appropriate math- form and spacing. The math italics In a math zone, the user types: are encoded as Unicode math This collaboration is invoked whenever text inside a designated math � = � +[space]� alphanumeric characters and are Input of characters in a math zone is achieved via a linear or “nearly zone needs to be displayed. A math zone is created in a document by stored in the same font as the specialized characters into text by typing an escape sequence, usually a text in the math zone is rendered using appropriate glyphs (which may As each character is entered, regular, upright characters and plainbackslash text” \input followed language. by a keyword This linear e.g. language \ will is a displaymeans of; entering \sum will the user, and is distinguished from regular text for layout purposes. All the application substitutes the other alphanumeric forms such as display characters on a standard keyboard are measurements dependent on glyph ascents, descents, and widths, as appropriate math italic character. , doublestruck, etc. entered directly and autocorrected as required. Note that these� keyboard a/(b+c) varydetermined from related, by the non-math math handler forms, rules as shownand the at contents right) and of theaccording font to The space character triggers characters∑, andare usedso forth. only Thefor input ASCII notation: the resulting text is stored table. the fraction object layout and using the appropriate Unicode math characters. positioning: Within the math zone, text is entered using a special input language.mat h are used as switches or triggers; for instance, a forward slash / indicates that a fraction is to be constructed from what comes Some before keyed andcharacters after the mathematical content quickly while relying on the layout engine and font _ ^ Thisto ensure is intuitive accurate and glyph easy display,to learn, arrangement and allows the and user spacing. to create slash. An character indicates a subscript, and a circumflex � indicates a superscript. The space character also has a role, delimiting � + � 40 | Math input and layout Math input and layout | 41 Full details on the math input between computer typesetting of mathematics and a purely visual e.g. a_2 followed by the space language can be found in Unicode composition as practised in the days of metal type. It is not enough to thecharacter operands would of the render linear format notation. The space character indicates Technical Note 28: look at a printed or equation to know how to reproduce www.unicode.org/reports/tn28/ that preceding elements are to be built-up, it from the available glyphs in a font: it is necessary to understand at � for instance.� . As well as keyboarding, other means of input least something of what the equation means and how the parts of the are also possible, such as pull-down menus or handwriting recognition, equation relate to one another. on a Tablet PC The math layout handler enable aspects of typographical layout for mathematics, it is proving helpfulAlthough in interacting this requirement with mathematical of the input calculation model was engines, introduced allowing to processing client, e.g. Microsoft Word, is carried out via a library of for close integration between calculation and layout. layoutThe methodscollaboration and rules, between along the with math extensive layout handler communication and its text- between , called can be converted to and from MathML Math zone text is described in a mark-up language, an XML theas where math handlera run of textand thebegins other and layout ends, components. the properties The and math content handler of OMMLtag sets. (Office MathML). can be embedded OMML in other s such as Word and uses a “callback” mechanism to ask for information about the text, such vice2.04 andversa. contains features of both the MathML presentation and content OMML XML ML, thatfor instance, run, the examineglyphs and the glyph characters dimensions in the todocument’s be used, the backing math-object store of properties, line breaking data, etc. This results in callback functions that, data to assist layout decisions. characters or ask the math-font handler and to obtain a backing store with the correct function names and arguments; the correctFor all bases, this tosubscripts work correctly, or superscripts; the client theapplication correct integrands,needs to provide

summands; etc. This means that the input model requires some understanding of the underlying mathematics. This is a key difference 42 | Math input and layout Math input and layout | 43 Math objects and spacing Object Arguments Purpose accent 1 Displays accent over base character(s) is relatively easy. In Opposite: table of math layout handler objects, showing the number box 1 Gives properties to base boxed formula 1 Displays and/or lines through base Theused layout to place of athe linear glyphs equation in the correctsuch as places.� � � � � of arguments each object takes during processing and its purpose. delimiters 1 Encloses base in parens, brackets, braces, etc. morean extended complicated set of equations,spacing rules special for operators built-up math and math handler objects objects to are delimiters with separators n Encloses bases separated by separator character, such as a vertical bar automate The math delegates handler to usesthe user. equation array n Displays set of horizontally aligned equations fraction 2 Displays normal or small built-up fraction a number of spacing refinements that TeX function apply 2 Displays trigonometric and other functions with function name and base The built up math objects are summarized in the table opposite. left subsup 3 Prefixes a subscript and/or superscript to base The function-apply object, for example, is used to insert proper lower limit 2 Displays limit below base spacing arounde.g. sin and � in the expression sin �. The �-ary object is n × m Displays matrix with n columns and m rows usedobjects to areinsert used proper to provide spacing the around proper the kerning �-ary betweensymbol and the aroundbase and the the n-ary 3 Displays large n-ary operator with a base and optional upper and lower limits “�-aryand”, integrand or summand. The subscript and table. superscript operator character 1 Used internally to give proper spacing to operators overbar 1 Displays bar over base (boxed formula special case) phantom 1 Suppresses any combination of base ascent, descent, width, display, or transparency script element, using the cut-in values in the font math of laying out , and provide the math handler, radical 1, 2 Displays square and nth roots workingThe objects with the are math based font, on awith detailed precise analysis control of overthe requirements the positioning of slashed fraction 2 Displays slashed or built-up linear fraction every element of an equation. Individual characters and smaller objects stack 2 Displays first argument over second (like fraction but without bar) are positioned relative to each other and built up into larger objects that, stretch stack 1 Displays stretchable character above or below base, or limit above or below in turn, are positioned relative to adjacent objects as appropriate to the stretchable base character overall shape of the equation. subscript 2 Displays subscript relative to base subsup 3 Display subscript and superscript relative to base superscript 2 Display superscript relative to base underbar 1 Display bar under base (boxed formula special case) upper limit 2 Display limit above base

44 | Math input and layout Math input and layout | 45 An example: displaying Murray Sargent 2 to obtain character properties, widths, and glyphs, as well as to display � � �� with text runs for arguments. The text runs result in various callbacks

the glyphs or variants thereof once the and whole line is laid out. All text is treated using glyphs and glyph- measurements of ascents and Technical text consists of normal text with interspersed math zones. descents. The math italic letters � � � are encoded as Unicode math These zones contain all the mathematics and may contain as little as a determine the operator’s text characteristics and its default spacing class, layout process begins when a layout client, e.g. Microsoft Word, requests alphabetics. The operator object for the equal sign results in callbacks to thesingle line mathematical layout handler variable, ( or one or more complete equations. The in this case, relational. The superscript object results in callbacks to LLH) to display the next line of text. The LLH get text-run information for the base and superscript text, as well as to then calls the “fetch-run” callback for the line’s first run of text. This right corner of the objects. When the obtain the superscript vertical shift and the cut-in values for the upper- callback distinguishes between text, math zones, and other in-line are obtained from the math font handler, which is2 responsible for access transfers control to the math layout handler ( executes � and lower-left corner of the . These displacements LLH gets back the start of a math-zone object, it to the math font’s table along with appropriate scaling. When the MLH). The MLH glyph for the superscript is fetched, the math font handler is requested math bagcallbacks of properties to the client that towill obtain be passed math-zone to the properties,client in most such subsequent as display 2 versus in-line modes, zone ascent/descent, and a pointer to a client’s to return a script level-1 glyph variant with a relative size specified by the font (typically about 70% of the text size). callbacks in the math zone. The MLH then calls the fetch-run callback involves interplay between the client, the math layout handler, the math between mathematical text, mathematical objects and mathematical This example shows how even a short and relatively simple equation for the first run of the math zone. The fetch-run callback distinguishes font handler, and the font itself. More complicated examples, such as those shown in the following specimen pages, involve math objects like mathematical objects. brackets or integrals and need glyph assemblies and other information. operators. The operators are treated as special single-character . In addition, larger equations may need to be wrapped to two or more is in its own text run, the equal sign is a mathematical operator 2 lines, a process that involves further callbacks and information. object,For example,the is inconsider its own Einstein’s text run, and most the famous is a equation, superscript � � object �� The � 2 � �

46 | Math input and layout Math input and layout | 47 Mathematical sample settings The following pages present specimens of the Cambria Math font used to typeset equations from a variety of mathematical and scientific features that, due to space constraints, have not been covered in detail. font and math layout behaviour discussed earlier in this book, as well as handler. In order to test font behaviour and layout accuracy, Microsoft documents created using Microsoft’s math typesetting solutions. on these specimen pages. Other samples are extracts from mathematical cases. This test tool was used to generate some of the sample settings developed a test application with a large number of pre-loaded context of the development and testing of the the math font and layout disciplines. They are selected to illustrate many different aspects of the equations, as well as the ability to accept user input of additional test Sample settings The creation of the sample settings is itself of some interest in the 49  p. 49 ൌ ݒ ܸ න ܣන ൌ ݑ݀ ݎ݀ݎ න݀ߠ නݎ ݀ ൥ ൌ ߪߨݖ ൌ ߪߨݖ ൌ ൌ ෍ െ ͳ ͸ ͳ ߪ ʹ ଴ ߪܴ ߨݖʹ ோ ௦ୀଵ ஶ ଴ ଴ ଶ ଶ ଶ ߱ ߱ ଴ ߨݖ ଶ ሾ ଶ ଶ ߱ ԝԝܬ ଴ •‹ •‹ ଵ ଶ ଶ ଶ ଴ ߱ ሺ ଶగ •‹ ܾߚ ଶ ଶ ଶ ߨܬ •‹ ߱ݐ ߱ݐ ଶ ௦ ଵ ݐන ߱ݐ ሻ ଶ ߪ ʹ ଶ ʹ ͳ ʹ ͳ ሺ ܬ െ ܾߚ ߱ݐ ݖ ܴ න ଴ ݎൌͲ Ͳ ଶ ଶ ଴ ݎൌܴ ܴ ଶ ௦ ቀ െ ൬ቀͳ ͵ ͳ ሻ ሺ ݀ݎݎ ܽߚ ͳെ ቀͳ ݀ ௦ ൫ ሻሿ ݎ ͳെ ቀͳ ݎ ʹ ݎ  ଶ ሼ ͳെ ቀͳ ൯ ൗ ଶ ԝԝܬ ൗ ܴ ଴ ܴ ଶ ݎ ሺ ଶ ߱ݐ൰ •‹ ߱ ቁ ‹ ܾߚ ଶ ቁ ൗ ଷ ܴ ݎ ௦ ሺ ଶ ሻ ଶ െͳ ൗ ܻ ቁ ܴ ଴ ʹ ሺ ଶ ሻ ܽߚ ቁ ฬ ʹ ଴ ௥ୀோ ௦ ଶ ሻ ܻ െ ଴ ሺ ܾߚ ௦ ሻ ܬ version shown here. shown version print resolution high to the compared be can latter the of legibility The 38. page on image rendering screen the in shown as same the is above equation the that Note ଴ ሺ ܽߚ ௦ ሻሽ ݔ݌݁ Sample Settings | ሺ െߢߚ ௦ ଶ ݐ ሻ ൩  49 p. 50 p. 51

ିଵ Ͳǡ ‹ˆͲ ൑ ߛ ൏ ݊ � ͳǢ ۓ ௡ ௠ିଵ ௡ ߲� ݀� ߲� ݀� ఊ ۖ 1௡ǡ ‹ˆߛ � ݊ � ͳǢ ܶ݀ ௝ ௝ ௞   ൌ ൬ ൰ఏ ൅ ൬ ൰௥ ߨሺ݊ሻ ൌ ෍ ቨ൭ ෍ ቔቀ݉ ቁൗ ቒ݉ ቓ ቕ൱ ቩ ෍ ቌݔ ൘ ෑ ൫ݔ െ ݔ ൯ቍ ൌ ݐ ߲ߠ ݀ݐ ൗ݇ ൗ݇ ௝ୀଵ ଵஸ௞ஸ௡ǡ௞ஷ௝݀ ݎݐ ߲݀ ෍ ݔ௝ ǡ ‹ˆߛ � ݊Ǥ ۔ ௠ୀଶ ௞ୀଵ � ۖ ௝ୀଵ݀ ݎ� ߲݀ ݎ߲� ߲ ە ൌ ൬ ൰ ቈ൬ ൰ ൅ ൬ ൰ ቉ ఏ ߲ݔ ௬ ݀ݐ ߲ݕ ௫ ݀ݐ ݎ߲  ଵ � � ଴ ൌ ቀെʹ� ଶቁ ቈ ଶ ଶ ݒ ቉ 51 ܽ ඥ� ൅ � ଶ ଶ ଶ ଶ ଶ ଴ ଴ ଵ ଴ ଵ ඥܿ ൅ ݒ � ݒ � ʹ� ݒ � ଶ ଶ ଶ ൌ െ ଶ ڄ ൌ െʹ� ଶ ඥܿ ൅ ݒ଴ � ܽ ଵହ ା՜ ଵଶ բ ଵହ ା ଵ଺ ܽ ա ՜  ൅ ݌ ՜ ߙ �   ൅ ݌ ՜  ൅ ߛ ՝ ՝ ଵହ ା ଵହ Ԧ ଵଶ ା ଵଷ ଵ଺ ା ଵ଻ ሺ௜ሻ ሺ௝ሻ ሺ௞ሻ ሺ௜ሻ ሺ௝ሻ ሺ௞ሻ ఒ ఑ ఓ  ൅ ݁ ՜  ൅ ߥ C ൅ ݌ ՜  ൅ ߛ � ՜ ൅ ߛ ർ߶ ቚܣ ቚ߰ ඀ ൌ ሺ݅ߣȁ݆ߢ݇ߤሻ ർ߶ ቛܣ ቛ ߰ ඀  ଵସ ା ՛ ଵହ ଵଷ ଵଷ ՝ ା ଵ଻ ଵ଻ ՝ ା 50  ൅ ݌ ՜  ൅ ߛ � ՜ C ൅ ݁ ൅ ߥ � ՜  ൅ ݁ ൅ ߥ ଵଷ ା ՝ ଵସ ଵ଻ ା ՝ ଵସ థ೔బ థ೔భ థ೔೙షభ థ೔೙ ՠ ՚ C ൅ ݌ ՜  ൅ ߛ � ൅ ݌ ՜ ߙ 𝛼� ՚ գ ܤ = ௜೙ܤ ௜೙ ሱሮܣ = ௜೙షభܤ ሱۛۛሮ ڮ ௜భ ሱሮܣ = ௜బܤ ௜బ ሱሮܣ ൌ ܣ 50 | Sample Settings Sample Settings | 51 In general, we have the following formula. p. 53 TheTheThe BinomialBinomial Binomial Theorem Theorem ǡ ׊݇ቑ ‰‡‡”ƒŽǡ™‡Šƒ˜‡–Š‡ˆ‘ŽŽ‘™‹‰ˆ‘”—ŽƒǤ ‰‡‡”ƒŽǡ™‡Šƒ˜‡–Š‡ˆ‘ŽŽ‘™‹‰ˆ‘”—ŽƒǤܻ א෍ ߠ௬ ൌ ͳǢ ߠ௞௬ ൒ Ͳǡ ߠ௞௬ҧ ൒ Ͳƒ†ߠ௞௬ ൅ ߠ௞௬ҧ ൌ ͳǡ ׊௬ †ƒܻ אȣ ൌ ቐߠǣ ߠ௬ ൒ Ͳǡ ׊௬ ௬ If is a positive integer, then 

ி ௙ೖሺ௫ሻ ௙ೖሺ௫ሻ ˆ݇ ˆ푘‹•ƒ’‘•‹–‹˜‡‹–‡‰‡”ǡ–Š‡݇‹•ƒ’‘•‹–‹˜‡‹–‡‰‡”ǡ–Š‡ ିଵ ͳ ͳ ൰ ௞ ௞ ௞ିଵ ݇ሺ݇ െ ͳሻ ௞ିଶ ଶ ڄ ߠ௞௬ҧ ൅ ߣҧ௬ ڄ ൰ ൬ߣ௬ ڄ ߠ௞௬ ൅ ߣҧ௬ ڄ ߠ௬ ෑ ൬ߣ௬ ڄ ൫ݕሃݔǢ ߠ൯ ൌ ܼ൫ݔǢ ߠ൯ܲ ௞ୀଵ ʹ ʹ ሺܽ ൅ ܾሻ ൌ ܽ + ݇௞� ௞ 𝑏�௞ ௞ ௞ିଵ௞ିଵܽ ݇ሺ݇�ሺ െ݇ ͳ െ ͳ௞ିଶ௞ିଶଶ ଶ � ʹ 𝑏�𝑏� ܽ ܽ � �ڄሺܽሺ ൅ܽ ܾ ൅ ܾൌ ܽൌ ܽ+ ݇+�1݇ ʹ ڄʹ 1ڄ ሺ݇ െ ͳሻሺ݇ െ 𝑘 ௞ିଷ ଷ1݇ �௞ିଷ௞ିଷଷ ଷڮሺ݇ܽሺ െ݇ ͳ െሺ�݇ ͳሺ െ+݇� െ݇ + ் � � ܽ ܽ + +͵ ڄ ʹ ڄ ଵ ߣ௬ 1ି ௞ି௡ ͵ ௡ڄ ͵ ሻʹ ڄ ڄ�1 ʹͳڄ ݊ ሺ݇ െ1 ڮ ቐͳ ൅ ߚఏ ෍ ݂௞ሺݔ௜ሻൣߜሺݕǡ ݕ௜ሻ െ ݌൫ݕሃݔ௜Ǣ ߠ൯൧ቑ ݇ሺ݇ െ ͳሻ ڄ ߠ௞௬ ڄ ߠ෠௞௬ ൌ ܰ௞௬ ͳ ௜ୀଵ + ݇ሺ݇ሺ െ݇ܽ ͳ െ� ͳ�ሺ�݇ሺ െ݇ ݊ െ� ݊ ͳ� ͳ௞ି௡௞ି௡௡ ௡ ڄ ߠ௞௬ ൅ ߣҧ௬ ڄ ߣ௬ ௞�+ ܽ ܽ � �ڄ ڮ+ڮ +ڮڄ +͵ ڄ ௞ିଵʹ ڄ 1 ʹ � ڄ � ڄ ڮ ௞ڄ ڮ ͵ ௞ڄ ڄ ͵ ʹ ڄ ڄ௞ିଵʹ 1ڄ𝑘 +𝑏 1௞ିଵ݇ + ڮ + 𝑘݇𝑘 + �+ �+݇ڮ++ڮ + EXAMPLEEXAMPLEEXAMPLE 13 13 53 SOLUTIONSOLUTIONSOLUTION ହ ହ ሺݔሺ𝑥�ݔ 𝑥�Ǥ Ǥ†ƒ’š†ƒ’š 52 •‹‰–Š‡‹‘‹ƒŽŠ‡‘”‡™‹–Š•‹‰–Š‡‹‘‹ƒŽŠ‡‘”‡™‹–Šܽ 𝑎�ܽ 𝑎�ǡ ܾ ǡ𝑎𝑎 ܾ 𝑎𝑎ǡ 𝑎�ǡ 𝑎�ͷǡ™‡Šƒ˜‡ͷǡ™‡Šƒ˜‡

ஶ ହ ହ ହ ହହ ହ ସସ ସ ଷ ଷଷ ଶ ଶଶ ଶ ଶଶ ଷ ଷ ସ ସସ ହ ହ ହ ͵ ͵ ڄ ڄ ͵ Ͷ Ͷڄ ڄڄ ͷ5 Ͷڄ Ͷ Ͷ 5 ڄڄ Ͷ 5ڄ௜ఈ௭ 5ͷ ሺݔሻ ܲሺݖሻ ሺሺݔݔሺ𝑥� െݔ 𝑥� ʹሻൌൌൌ ݔ ݔ ݔ൅൅ ͷ൅ ͷݔݔ ͷሺݔሺ−−2ሺʹ−+ሻʹ൅+ ݔݔሺݔ−ሺ−2ሺʹ−ʹሻ+ ൅+ ݔ ݔሺݔ−ሺሺ−2ʹ−ʹሻ൅ ͷ൅ݔ ͷݔͷሺ−ݔሺʹ−2−ʹ+ሻ ሺ+൅−ሺʹሺ−−2ʹ ሻܲ ͵ ͵ ڄ ڄ͵ ʹ 2ڄ ڄڄ ʹ ͳ1ڄ ଶ 1 ʹ 2ڄ ڄ ʹ ଷ1ڄቈ � ቉ቑ ହ ସ 1ͳ ݏܴ݁ න •‹ሺߙ�ሻ݀� ൌ ʹߨߦ ቐ ෍ ஶ ܳሺݔሻ కሾ௭ሿவ଴ ܳሺݖሻ ହ ହ ସ ସ ଷ ଷ ଶ ଶି ʹRadicalsRadicals ൌݔൌൌݔ ݔ െ− ͳെͳͲݔͲݔ ͳͲݔ+൅ͶͲݔ+ ͶͲݔͶͲݔ−−ͺͲݔ−ͺͲݔͺͲݔ+൅ͺͲݔ ͺͲݔ+ ͺͲݔ𝑥𝑥 െ �𝑥𝑥 52 | Sample Settings Sample Settings | 53

p. 54 Š‡‘•–Š‡‘•– ‘‘Ž›‘ —””‹‰”ƒ†‹ ƒŽ•ƒ”‡•“—ƒ”‡”‘‘–•ǤŠ‡•›„‘ ‘‘Ž›‘ —””‹‰”ƒ†‹ ƒŽ•ƒ”‡•“—ƒ”‡”‘‘–•ǤŠ‡•›„‘ŽξŽᇹξᇹ‡ƒ•‡ƒ• Dz–Š‡’‘•‹–‹˜‡•“—ƒ”‡”‘‘–‘ˆǤdzŠ—•Dz–Š‡’‘•‹–‹˜‡•“—ƒ”‡”‘‘–‘ˆǤdzŠ—• ଶ ଶ ݔ �ݔ ξ�ܽƒ•ܽ ‡ƒ•ݔ ݔൌ ܽൌƒ† ܽ ƒ†ݔ ൒ݔ� ൒ � ଶ ଶ ‹ ‡‹ ‡ܽ 𝑎�ܽ 𝑎�≥ Ͳ≥ǡ–Š‡•›„‘ŽͲǡ–Š‡•›„‘Žξܽ‡••‡•‡‘Ž›™Š‡ܽ ƒ‡••‡•‡‘Ž›™Š‡ܽ 𝑎�ܽ 𝑎�Ǥ ‡”‡ƒ”‡–™‘”—Ž‡•Ǥ ‡”‡ƒ”‡–™‘”—Ž‡•  ˆ‘”™‘”‹‰™‹–Š•“—ƒ”‡”‘‘–•ǣˆ‘”™‘”‹‰™‹–Š•“—ƒ”‡”‘‘–•ǣ  ܽ ܽ ξܽξܽ  ξܾܽξܾܽൌ ξൌܽξξܽ�ξ� ට ටൌ ൌ  � � ξ�ξ�   ‘™‡˜‡”ǡ–Š‡”‡‹•‘•‹‹Žƒ””—Ž ‘™‡˜‡”ǡ–Š‡”‡‹•‘•‹‹Žƒ””—Ž‡ˆ‘”–Š‡•“—ƒ”‡”‘‘–‘ˆƒ•—Ǥ‡ˆ‘”–Š‡•“—ƒ”‡”‘‘–‘ˆƒ•—Ǥ ˆƒ –ǡ›‘—•Š‘—Ž† ˆƒ –ǡ›‘—•Š‘—Ž† ”‡‡„‡”–‘ƒ˜‘‹†–Š‡ˆ‘ŽŽ‘™‹‰ ‘‘‡””‘”ǣ  ”‡‡„‡”–‘ƒ˜‘‹†–Š‡ˆ‘ŽŽ‘™‹‰ ‘‘‡””‘”ǣ ξܽξ ൅ܽ ܾ ൅് ܾ ξ്ܽξ+ܽ ξ+�ξ� Conclusion Mathematicians and scientists are ‘symbol-hungry’, and neither neither and ‘symbol-hungry’, are scientists and Mathematicians Despite the complexity of math layout requirements and the the and requirements layout math of complexity the Despite succinct and beautiful visual form. visual beautiful and succinct type them, making for tools the and fonts math of features specialised experts in mathematics and typography—, whose collaboration is is collaboration whose typography—, and mathematics in experts an historic collaboration that will continue. will that collaboration historic an celebrated in this book. The goal of this undertaking is the same same the is undertaking this of goal The book. this in celebrated format, font supported widely a and tools processing word common this in engaging in hesitant be not should typographers and designers groups at Microsoft, external type designers and font technicians, technicians, font and designers type external Microsoft, at groups had to be made manually, and in addressing directly the appearance of of appearance the directly addressing in and manually, made be to had people—software developers, managers and testers from many different different many from testers and managers developers, people—software products has been a major undertaking, involving more than forty forty than more involving undertaking, major a been has products Conclusion implementation is exhaustive or closed to further extension. The The extension. further to closed or exhaustive is implementation of context the in typesetting mathematical to access providing in previously that positioning and spacing to refinements automating in of instance latest the only is work this But screen. on text mathematical that has guided earlier collaborations between mathematicians and and mathematicians between collaborations earlier guided has that clear, in concepts and ideas mathematical express to typographers: Microsoft’s nor encoding character math Unicode current the work recorded in this book is a significant advance in many respects: respects: many in advance significant a is book this in recorded work The development of support for mathematical typesetting in Microsoft Microsoft in typesetting mathematical for support of development The ™ƒ• ‘˜‡”‰‡–Ǥ ሻ ݔ ሺ ܲ ƒŽˆƒ –‘”ˆ‹”•–ǡ™‡Šƒ˜‡ Ǥ ሻ ܽ ǡ ሺ ଶ ݂ � Ǥ ǡ™‡‘„–ƒ‹ ଶ ݀ ൅ � ିଶ ቁ ଵ ݀ ቍ ൌ ͳ � ఒ ଶ Ǥ ௞ାଵ ሻ ଶ ቍ ݔ ݀ ఒ Ǥƒ Ž‹‰–Š‡‡š’‘‡–‹ ఒ ଶ ܽ ݔ ଶ ଶ ௜ ఒ ଵ ’ƒ•‹‘‘ˆ–Š‡ ‘‡ˆˆ‹ ‹‡– ሺ ݔ ൯ ݔ ܽ ݔ ఒ ఒ ఒ ଶ ௜ ௞ ܹ ܾ ൌ ͳ ܽ ݔ ݌ 𝑘� ݌ ஶ ଴ ఒ ሻ ෍ ఒୀ଴ ݇ ୀ ܽ ஶ ஶ ܽ ෍ ቌ ఒ ଴ ෍ ఒୀ଴ ሺ ஶ ௜ୀିଵ ୀ ஶ ቌ ෍ ௞ ஶ ఒୀ଴ ܹ σ ିଶఈ ିଶఈ ଶ ଶ మ σ ൅ ൪ ௫ ൫ ௔ ିଶఈ ଶ ׬ ൌ ݔ ଶఈ ൌ ݔ షభ ଶ ݔ ݔ Ž ି௣ ڮ ൅ ଶ ିଵ ݔ ൪ ଶ ିଵ ௫ ቍ ቍ ‡š’ ቀെ ఒ ଶ න ௫ ‡”‡“—‹”‡‡––Šƒ– ݔ ሻ ൌ ݌ ௞ାଶ ଶ ఒ න ݔ ˜‡”‰‡–‹ˆ–Š‡‘”‹‰‹ƒŽ‡š ଵ ݔ ܽ ሺ ሻ � ଵ ݔ ݀ ሺ ஶ ௞ ෍ ఒୀ଴ ଵ ௜ 𝑘� ଵ ݌ ൌ ݕ ቌ ݔ –Šƒ––Š‡”‘•‹ƒǡ ݇ ௜ ሻ ݌ ൌ ݕ ݔ ଶఈ ଶ ஶ ሺ ሻ ݔ ෍ ௞ୀ଴ ଶ ൦ ݔ ஶ ቌ ୀିଵ ݕ ෍ ሺ ௜ ଶ ቍ మ ͳ ʹǨ ݕ ௫ • ‡”–ƒ‹Ž› ‘ ௔ ൅ න ௞ାଵ ଶ ݔ ௞ାଵ ଶ ௞ ݔ 𝑘� ݌ ݇ ௞ 𝑘� ݌ ஶ ݇ ෍ ௞ୀ଴ ƒ›„‡Šƒ†Ž‡†„›™”‹–‹‰ െ ஶ Š‡‡š’‘‡–‹ƒŽ‹ Šƒ˜‡„‡‡‘”ƒŽ‹œ‡†•‘ ෍ ௞ୀ଴ ቌ ଶ ݕ ͳ െ ‡š’ ൦ ቍ ƒ† షభ ଵ షభ � ଵ ି௣ ଶ ݕ ି௣ ଶ ݀ ݔ ௜ ݔ ଵ ൧ ൧ ሻ ݔ ሻ ௜ ܽ ܽ ݌ ሺ ሺ ݂  ݂ ௜ െ ෍ െ ൣ ൣ మ ௫ ௔ න െ ቌ ‡š’ ‡ ‡ ൌ ‡š’ Š‹•ˆ‹ƒŽ•‡”‹‡•‡š’ƒ•‹‘‘ˆ–  ൌ ‡š’ ™Š‡”‡–Š‡•‘Ž—–‹‘• ‡‰Ž‡ –‹‰ ‘•–ƒ–ˆƒ –‘”•–Šƒ–™‹ŽŽ„‡’‹ ‡†—’ƒ›™ƒ›„›–Š Š‡†‡‘‹ƒ–‘”‹“ǤͺǤ͸ͻ | Sample Settings 54 course of this project was just how enthusiastic mathematicians and ongoing collaboration. One of the things that became apparent in the are of the efforts involved. scientists are to see their work well-typeset and how appreciative they typesetting effectively limited the range of typographic options available to mathematicians.The material cost It of was producing always easiernew fonts and forcheaper metal to and add even new photo- symbols to an existing typeface than to start afresh. With the advent of computer typography, the options expanded a little—notably with the Euler

collaboration of with Donald Knuth on the AMS types—, but mathematical typesetting has yet to fully benefit from thebut digitalalso in revolutiondemonstrating with whatextensive is possible options in in terms basic of type fresh styles. approaches The Cambriato the design Math of font mathematical breaks new typesetting. ground, not We only hope via thisits technical project will features inspire others.

56 | Conclusion