Using Adobe Type 1 Multiple Master Fonts with TEX
Total Page:16
File Type:pdf, Size:1020Kb
Using Adobe Type 1 Multiple Master Fonts with TEX Michel Goossens CN Division, CERN CH•1211 Geneva 23 Switzerland Email: mgoossenscernch Sebastian Rahtz Elsevier Science Ltd The Boulevard, Langford Lane Kidlington, Oxford OX51GB UK Email: srahtzelseviercouk Robin Fairbairns University of Cambridge Computer Laboratory Pembroke St, Cambridge CB23QG UK Email: rfclcamacuk Abstract Adobe’sMultiple Master font format has some of the properties that METAFONT pioneered toexpressmanyfontsofthesamefamilyfrom thesame(set of) sources. Theadvent ofmultiple master fonts could offer a significantlybetter choice of fonts to users of TEX;however, thereare problems integratingthem with TEX,and thepaper presents a first solution to thoseproblems. Thepaper isderived(byRobinFairbairns)fromanarticlewrittenbyMichelGoossensand Sebastian Rahtzfor the UKTUG magazineBaskervillevolume5,number 3. Asademonstration of the effectiveness of the techniques described, it is being typeset using Adobe Minion and Myriad multiple master fonts. Introduction extrabold weight,aswellasanyintermediatemaster designs that are required. The maximum number of master designs Themultiplemaster font format isan extension oftheType1 allowed is sixteen. font format, which allows the generation ofa wide varietyof A font instance consists of a font dictionary derived typeface styles from a single font program. This capability from the multiple master font program (or from another allows users and applications control over the typographic font instance). It contains a WeightVector array with k parameters of fonts used in their documents, in a manner values that sum to 1.0and which determinethe relativecon• reminiscent ofKnuth’sground•breaking METAFONT .This tributionsofeach master design totheresultinginterpolated article describes the multiple master system in some detail, design. and describestheproceduresneeded tomakeinstances, and Allderived font instancessharethe CharStrings dic• create the appropriate font metrics for use with TEX. tionary and Subrs array of the main multiple master font Multiple Master overview program, making it relatively economical to generate a va• riety of font instances. Multiple master fonts can be made Amultiplemaster font programcontainstwoor moreoutline compatible with the installed base of PostScript language typefaces called master designs, which describe one or more interpreters byincluding several PostScript languageproce• design axes. Themaster designs that constitutea design axis duresandanewsetof OtherSubrs routinesin thefont pro• represent a dynamic range of one typographic parameter, gram. Theprocedures includethenew makeblendedfont such as the weight or width. This range of styles is defined operator, the interpolation procedure Blend and a new in a multiple master font program by specifying one master definition of the findfont operator. design to represent each end of an axis, such as a light and TUGboat, Volume 16 (1995), No. 3 — Proceedings of the 1995 Annual Meeting 253 Michel Goossens, Sebastian Rahtz and Robin Fairbairns Multiple MasterDesign Space It ispossibleto think ofthe The values used for calculating the weighted aver• master designsasbeingarrangedina1,2,3,or 4dimensional age are stored in the font dictionary in an array named space with various font instances correspondingto different WeightVector. The multiple master font program, as locations in that space. Theentries in the FontInfo dictio• shipped by the font vendor, can have a default setting for naryspecifywhat this spaceis and wherethemaster designs the WeightVector; it is recommended that it is set so the arelocated in it. Thisinformation isnecessaryfor interactive default font instance will be the normal roman design for programs that allow users to create newfont instances, and that typeface. should beincluded in thefont’sAdobeMultipleFont Metrics Multiple Master Keywords BlendAxisTypes is a (re• (AMFM)file. Figure 1 illustrates an example of the design space of a quired) arrayof n PostScript language strings where n is the dimension ofthedesign spaceand hencethenumber ofaxes. threeaxis multiplemaster font. In this example, theaxes are Each stringspecifiesthecorrespondingaxistype. In thecase weight, width,andoptical size.Itisrecommendedthatafont of the Minion 3•axis example, this value would be: program be organized to havethe lightest weight, narrowest Weight Width OpticalSize width, and smallest design size mapped to the origin of the BlendAxisTypes blend space. BlendDesignPositions is a (required) array of k Multiple master coordinates are of two types: those arrays giving the locations of the k master designs in the which represent the design space and those which represent design space. Each location subarray has n numbers giving theblend space. Design coordinates areintegerswhoserange the location of the design in the n dimensions of the blend for a particular typeface is chosen by the designer. They are space, with a minimum value of zero and a maximum value used in font names and in the user interface for software of one. Table 1 with eight master designs is based on the which creates and manipulates multiple master font pro• example shown in Figure 1. It corresponds to the blend grams. The theoretical range for a weight or width axis is space of a 3•axis multiple master font like Minion. from 1 to 999 design units; however a typical typeface, with FortheMinionMMfont,the BlendDesignPositions styles ranging from light to black, might have a dynamic arraybecomes: range of from 200 (for light) to 800 units (for black). Another type of optional axis would be for optical size, BlendDesignPositions in which the character design changes with the point size. def The design coordinates for the optical size axis might have a dynamic range of from 6• to 72•point, which represents BlendDesignMap is a required entryconsisting of an the practical extremes of sizes for typefaces designed for arrayofnarrayswherenisthedimension ofthedesign space. publishing purposes. Each arraycontains m subarrays that describe the mapping Blendcoordinatesarenormalizedvalues,in therangeof of design coordinates into normalized coordinates for that 0to 1, which correspond to theminimum and maximum de• designaxis. Theminimumvalueallowedformistwo,andthe signspacecoordinates. TheyareusedbytheType1rasterizer maximum istwelve. Theorder ofthesubarrayscorresponds because they are more convenient for mathematical manip• totheorder ofdesign axesin BlendAxisTypes.Inthecase ulations. The linear space of blend coordinates is related to of the Minion font this array is three dimensional (n =3) the (potentially) non•linear space of the design coordinates and has the following form: BlendDesignMap by the BlendDesignMap entry in the font dictionary. Afour axisdesign mightalsobeconsidered;an example of a fourth axis would be having an axis for a typographic style(serif/sansserif)or contrast(high/low: theratioofthick The first number in an individual subarray is in design co• to thin stem widths). Iffour axes are defined,sixteen master ordinates with a minimum value of 1 and a maximum value designs are required. Also, since sixteen is the maximum of 999. The second number in the subarrayis in normalized number of designs allowed, there can be no intermediate coordinates, that is, in the range of 0 to 1. In the above designs with four axes. example, the weight ranges from 345to 620, while the width ranges from 450to 600in design space. The third axis, opti• Multiple Master Font Programs calsize,rangesfrom 6to72(correspondingtothepoint sizes Multiple master typefaces may contain from two to sixteen for which thetypefacecan beadjusted for optimallegibility). master designs, organized as havingfrom oneto four design axes. Sincethemaximum number ofmaster designsallowed The makeblendedfont Operator in a multiple master font is 16, the number x of intermediate blendedfontdict weightvector makeblendedfont blendedfontdict masters is subject to the restriction 2n + x ≤ 16, where n is This operator creates a font dictionary with blended the number of design axes. entries. The blendedfontdict argument is a font dictionary of an existing multiple master font; it can be from either 254 TUGboat, Volume 16 (1995), No. 3 — Proceedings of the 1995 Annual Meeting Using Adobe Type 1 Multiple Master Fonts with TEX Light Expanded Design label Blend space Large 0,1,1 Black coordinates Expanded Large design 1: light condensed small 0 0 0 1,1,1 Light Black design 2: black condensed small 1 0 0 Expanded Expanded Small Small design 3: light expanded small 0 1 0 0,1,0 Light Condensed 1,1,0 design 4: black expanded small 1 1 0 Large Black 0,0,1 Condensed design 5: light condensed large 0 0 1 Large 1,0,1 design 6: black condensed large 1 0 1 design axis 2: width design 7: light expanded large 0 1 1 design axis 3: size Light Black design axis 1: weight Condensed Condensed design 8: black expanded large 1 1 1 Small Small 0,0,0 1,0,0 Figure 1: Multiple master typeface blend space Table 1: Design labels and blend space values for arrangement the Minion 3•axis multiple master font the original multiple master font itself, or from an interpo• WeightVector values, and leave them on the stack for the makeblendfont lated font instance since any Blend dictionary contains all operator. elements needed to derive additional font instances. Theweightvector argumentisanarrayofnumberssum• Using Multiple master fonts with TEX mingto1.0tobeused astheweightsfor creatingthenewfont Multiple master fonts come with a set