Home
Bijlage 26 Generating Type 1 Fonts from Metafont Sources
Contents
1. 12 0 and 600 611 but there may be more entries The first entry in the array defines an area in which the y coordinates of points that lie within this area are changed into the highest second number For the following entry the y coordinate is changed into the lowest first number Together these two areas allow characters like the O to be rendered at low resolution without sticking out unac ceptably below the baseline if compared to characters like the H see figure 8 Standard stem widths Quite often a vertical or horizon tal line in a font will be just a little bit to large for one device pixel but not large enough for two pixels Depend ing on the underlying pixel grid the line may consequently be rendered as either one or two pixels In these problematic characters we want to make sure at least that verticals and horizontals that are intended to have the same width throughout the font use the same amount of pixels This is done by pre defining the widths that are supposed to be identical The commands that pass this in MAPS Generating Type 1 Fonts fromMetafont Sources Figure 8 An example of how overshoot suppression works in PostScript the top and bottom of the O are adjusted so that the character becomes just as high as the H figure borrowed from the Fontlab Manual formation to the renderer are Stdvw and StdHw The effect that a correct setting of these values has on the ren
2. 2 This section is loosely borrowed from Erik Jan Vens article Incorporating PostScript fonts in TEX EuroTpxX proceedings MAPS Generating Type 1 Fonts fromMetafont Sources Q FontLab 3 0 File Edit View Symbol Tools Window Help Bijlage 26 oela e S 2 8 Font rsfsb10 H pfhirsfsb10 pfa of x rs xl fal fal be _ E E i Glyph 72 H from rsfsb10 0000 0001 0002 0003 0005 0006 0007 0008 0013 oo14 0015 oo16 oo17 oo18 oo1s o020 0021 0026 0027 0028 0023 0030 0031 0032 0033 0034 0033 0040 0041 0042 0043 0044 0045 0046 0047 SU ERS eal evel iss 0052 0053 0054 0055 0056 0057 0058 0059 0060 ASEEN ESTIS s A B D E F G I A BC D EFG I N o i Q R S E U Vv N O P 2 S TUY Foal 0032 EE E TE 0096 0097 0038 Pa EE EE i seal te Move objects by dragging them left mouse button or press right button to open popup menu Figure 6 An interactive font editor Fontlab version 3 What a Type 1 font looks like The binary representation of a Type I font is just a com pressed version of the non compressed ascii format with extension pfa So we need a program that will do the de compression for us One of th
3. bolic fonts is the turning direction of the subpaths In PostScript whether a path will be black or white depends on how the path turns clockwise or counterclockwise Metafog sometimes gets confused and outputs a charac ter in which two concentric circles both turn leftward like in an O or the diameter symbol from the Waldi Sym bol font In those cases the character will be completely filled which is of course wrong The absolutely final step so far ve needed to do this for every commercial font program I could find is dis assembling the pfb file running a perl script to fix some incompatibilies bugs in the used font editor and to insert a couple of workarounds for bugs in software that uses the font and reassembling What I have done already and future plans So far Ihave converted four METAFONT fonts that I need ed myself The files that are now avialable from CTAN are logo8 wasy5 stmary5 rsfs5 logo9 wasy7 stmary7 rsfs7 logo10 wasy10 stmary10 rsfs10 logos110 wasyb10 logobf10 All of these files reside in a subdirectories of the METAFONT sources named ps typel hoekwater The lo go font is located under cm utilityfonts due to a weird directory structure on CTAN Note that I have not always MAPS Generating Type 1 Fonts fromMetafont Sources E Glyph 31 diameter from wasy10 a 0K Cancel Figure 15 Paths that turn the wrong way converted all of the METAFONT source files for i
4. but it often goes unnoticed because people tend to have only one printer The second device dependancy is not really related to print ers at all but is caused simply by the fact that METAFONT outputs a pixel bitmap Although METAFONT does it cal culations with a very high accuracy this does not help at all if there are simply not enough pixels to display the charac ter The commands that look like define_xxx_pixels take care of this kind of dependancy whose effects can be seen in figure 5 Figure 5 The character on the right has been created with all the define_xxx_pixels commands removed from the source The sub optimal distribution of pixels in this example is caused by the underlying pixel grid that can not be changed What are Type 1 fonts How PostScript fonts are created PostScript Type 1 fonts are quite different from METAFONT fonts Usually Type 1 fonts are created in a wysiwyg en vironment with a drawing program that is only suited for the creation of fonts Figure 6 shows the program I usually use The graphical user interface nicely shields off the de signer from what is happening behind the scenes so we need to look into the generated files themselves if we want to get more information On Windows and Unix systems the actual fonts are saved in a binary file with the exten sion pfb short for PostScript Font Binary and the metric information in an ascii file with extension afm short for Adobe Font Metrics
5. unfortunately I also have other work to do I am still open for requests but you may have to wait a couple of months 274 Bijlage 26 For further reading On METAFONTS language Donald E Knuth The METAFONT Book Addison Wesley Publishing Company June 1986 361 pages On using METAFONT to design real life fonts Donald E Knuth Computer Modern Typefaces Com puters and Typesetting volume E Addison Wesley Publishing Company June 1986 588 pages On the PostScript Language Adobe Systems Inc The PostScript Language Refer ence Manual Addison Wesley Publishing Company December 1990 764 pages 275 Taco Hoekwater On METAPOST John Hobby A User s manual for METAPOST AT amp T Bell Laboratories Computing Science Technical Report 162 1992 Comes as part of the METAPOST distribution On Type 1 fonts Adobe Systems Inc Adobe Type 1 Font Format Addison Wesley Publishing Company June 1995 On the Metafog program Richard J Kinch Converting METAFONT Shapes to Outlines Paper presented at the 1995 TUG Confer ence in St Petersburg Florida USA Appeared in print in Tugboat 16 3 MAPS
6. above into the format required by the Type 1 speci fications At the moment the program is only available as an optional extra with TrueTgX but correspondence with Mr Kinch indicate that it is very likely that this program will soon be available separately Metafog reads the METAPOST EPS file and converts this into another EPS file It also displays some debugging in formation about the character on the terminal Page 1 Initial Input Contour Figure 11 Metafog output file page 1 interp scale implies elliptical pen 66 7 x 6 0 0 o scaffolded TRUE reduce reducing shape 1 of 2 reduce reducing shape 2 of 2 duplicate scaffolded try_point 0 01 value scaffold reduce reducing shape 3 of 2 reduce reducing shape 5 of 4 Plotting page 1 Initial Input Contour done plotting reduce reducing shape 1 of 1 Voorjaar 1998 Bijlage 26 reduce reducing shape 2 of 1 Plotting page 2 Final Result Contour done plotting Total knots used 598 a wz 29 indexable c apacity Page 2 Final Result Contour Figure 12 Metafog output file page 2 The created files are pretty large too large to include lit erally This is because the file serves two purposes it is the input format for another program makefont also by Kinch and it also shows the work that has been done by metafog The first page shows the result the second page the initial input as metafog saw it the output of one
7. begins with beginlogochar be cause this is where the real work is done This portion of the source defines the letter M in the font What we see here is that characters are specified by first setting up a bunch of equations the lines that have equal signs in them followed by a draw command that connects those points actually drawing the character We won t go deeply into METAFONT syntax but it is vital to understand the following a point is defined as a pair of x and y coordinates In METAFONT syntax points are sequentially numbered per character starting from 1 z1 is the notation for point 1 Notations like x1 and y2 specify the x component of point 1 and the y component of point 2 respectively beginlogochar says that the M is precisely 18u units wide and 1ogo10 mf has set up one u to be 4 9pt so the actual character is 4 9 x 18pt 8pt wide TEX and METAFONT have the same author and it shows METAFONT can do macros just as easily as TEX can Macros can have arguments define other macros and assign values to things just like in TEX beginlogochar is in fact one of those macros and it assigns some pretty im portant values when it gets expanded by METAFONT For one it defines w to be the width we calculated above and it defines h to be the height of the character calculated from ht in logo10 mf which equals 6pt From the values of u and s it now follows that leftstemloc equals 2 5 x 4 9 0 10 9pt
8. that use draw and fill commands that intersect somewhere And the oth er way around also happens large portions of the nash14 arabic font looked exceedingly complex to me but were in fact handled by metafog without any problems Either way eventually there will be EPs files available for all characters in the font Makefont combines all of the separate files into one PostScript file and the last step of the actual conversion process is running the T1Utils to get a binary representation that can be fed into a commercial font editor Insertion of Type 1 style hinting information The pfb file created at the end of step two still has a couple of major flaws that need to be fixed First and foremost among these there are absolutely no Type 1 hints includ ed There were hints in the original METAFONT sources but these are ignored by METAPOST and subsequent por tions of the conversion do not have access to them This is the major reason for the need of a commercial font editor 273 Taco Hoekwater a Weed 088ueps _jolx Jf Eile View Window lalx a o a a Sa TEN 5 N EW ft go i 11 j il f He hfs pty Mt yo j bea 7 ae IF Wi ra eo tire on er i T op ae M G i l Z hy O e i 4 ua i Figure 14 Screendump of the weeder s window Type I hinting is too complicated a process to rely on any non interactive program to make the right choices Another thing that must be checked especially for sym
9. 6 All values are given in a coordinate system that maps 1000 units to one em The nullpoint lies at the lower left corner When one uses a PostScript font in a PostScript language program the coordinate system is initially scaled in a way such that 1000 units equal precisely 1 bp The values used to describe points and intermediate values can be negative but never partial This need for discrete val ues can be a major problem when converting METAFONT fonts as we will see later on Now let s have a short look at the used commands The command hsbw sets up the width information for this character the first number is the left sidebearing distance the second number the advance width The commands that end in stem are used by the hinting system The whole collection of commands that look like xlineto and xxcurveto are shortcuts for the ordinary PostScript com mands lineto and curveto these draw the actual out line All of these drawing commands are always relative to the current point The last couple of commands end the character closepath to close the defined path like METAFONT S cycle and endchar to do the actual draw ing ND functions as def it defines the command Ww from the first line to mean do everything between the braces remember this is reverse Polish notation M from logo10 Figure 7 How the character s path is drawn At first sight it is a little surprising to see that the PostS
10. Bijlage 26 Generating Type 1 Fonts from Taco Hoekwater Kluwer Academic Publishers Dordrecht taco hoekwater wkap nl abstract This article makes a comparison between bitmapped and vector fonts and presents some of the problems encountered when tried to convert METAFONT sources into PostScript Type 1 fonts keywords METAFONT PostScript fonts Type 1 conversion metafog The second part of this article will focus more closely on some of the problems that I faced while trying to convert METAFONTSs into PostScript Type 1 fonts but first some explanation is in order as to why one might want to do this conversion and precisely what this conversion entails These topics are the subjects of the first couple of para graphs What are METAFONT Fonts How characters are created I ll assume the reader knows the following every TX dis tribution has a program called METAFONT that compiles font sources more or less the same way that the TX pro gram compiles text sources A major difference between the two programs is that METAFONT produces device dependant output called pk files whereas T X produces device independant output also known as dvi files Let s look into the font sources that METAFONT uses and see what kind of information they contain These are ordinary ASCII files just like T X sources so it was easy to insert a listing of one of these files The file that contains the METAFONT logo font 1ogo10 mf
11. The last value we have left is ygap ht 13 5u xgap ht and xgap have been given in the driver file logol0 mf and after some small calculations ygap becomes 6pt 13 5 x 4 9pt x 0 6pt 0 6pt MAPS Generating Type 1 Fonts fromMetafont Sources It should now be easy to come to the conclusion that the equations fix the precise x y locations of the five points that denote the character M albeit in a slighly indirect manner If we fill in the values we derived above we get the following xl x2 10 9pt x4 x5 8pt x1 x3 8pt x3 y1 y5 y2 y4 bot yl Opt top y2 6pt y3 0 6pt After METAFONT has calculated these equalities for us and with some minor reshuffling of the input we get the following end result xl 10 9pt bot yl Opt x2 10 9pt top y2 6pt x3 Apt y3 0 6pt x4 62 9pt top y4 6pt x5 62 9pt bot y5 Opt 7 4 3 1 i Figure 3 Metafont output file for modeless files hand calculated version We could have typed this in right away and METAFONT would have been just as happy The end result would have been the same as can be seen in figure 3 But why do the calculus yourself if the machine can do it for you METAFONTSs ability to do the needed calculations all by itself is one of its most important strong points Combined with macros and separate input files it becomes possible to use various fonts with the same shared source
12. and like font logohuge logol0 at 20pt In that case the assignment would be mag 2 The other as signment is far more interesting METAFONT usually starts with a format file similar to the fmt files T X uses and somewhere in the sources for those format files there are some definitions like this mode_def cx mode_param pixels_per_inch 300 mode_param blacker 0 mode_param fillin 2 mode_param o_correction 6 mode_common_setup_ enddef Figure 4 An example of two different imaging models All parameters besides pixels_per_inch are a little too technical to explain in detail in a short article like this one but figure 4 tries to explain that these values really do de pend on the printing engine The drawing on the left shows a more or less standard inkjet that shoots dots of black ink on the paper The right drawing shows a hypothet ical printing device with a radically different approach This machine pours light on a photographic film through a raster creating a negative image There are still round dots but they are inverted It is easy to imagine that this radically different technique can have quite an impact on 267 Taco Hoekwater the resulting image One effect that is very easy to see from the admittedly very badly drawn figure is that the inside corners in the right drawing are a lot blacker than in the left one This sort of thing happens all the time with in real life printing
13. b files themselves I don t have enough spare time to help people with problems related to the integration of the fonts into their TeX distributions If somebody wants to volunteer for this job please let me know and I will add you to the readme I plan to add quite a couple of fonts in the near future some of which may have been uploaded already by the time you read this The announcement of the availabili ty of the files that are now on CTAN almost immediately resulted in a doubling of the length of my wish list The following fonts are TODO and will definately be done before the summer o The rest of the METAFONT logo fonts belonging to the mflogo package on a request by Ulrik Vieth o At least the most important fonts that are needed by the wsuipa package tipaxx and xipaxx I already started on those but the MAPS takes precedence sorry Sebastian o The Nash font that is used by ArabTgX but Klaus Lagally says that he needs to fix and update the METAFONT sources first o The Blackboard Bold font actually everything that is needed for the new math font encod ing will be finished before the end of the year a At least one each of the Greek Cyrillic and He brew text font families could someone please point me to the best font of those that are available o The manfnt requested by Phil Taylor Every font presuming 256 characters takes about one day to complete This does not sound like too much time but
14. cript representation is rather a lot longer than the METAFONT version This is caused by another limitation of Type 1 format every character has to define an outlined path that is filled by endchar Thanks to this limitation we cannot 269 Taco Hoekwater use four stroked lines to draw the M the way we did in METAFONT but instead are forced to trace the borders of filled shape Dealing with device dependancies Adobe s Type 1 format does not supply a means of deal ing with device differences directly like METAFONT s define_good_pixels But of course there has to be some means of making sure that a font looks reasonable on low resolution devices and this is handled by a system called hints The responsible commands are separated into two different levels there are font level hints and character level hints Font level hints take care of three things 1 Alignment zones 2 Standard stem widths 3 Extra information to control the hinting The relevant portion of the font file looks like this BlueValues 12 0 600 611 ND BlueScale 0 04379 def BlueShift 7 def BlueFuzz 1 def MinFeature 16 16 ND StdHw 60 ND Stdvw 66 ND ForceBold false def Alignmentzones First off alignment zones are defined by the array called BlueValues The values in the array de fine vertical zones by specifying two y coordinates for each zone In this case there are only the two areas between
15. dering of the font can be seen in figure 9 3 Extra information to control the hinting There are some extra commands in the example that we haven t covered yet the three Bluexxxx commands define amongst other things the pointsize below which overshoot suppression is turned on and a fuzzy correction on the values of the alignment zones ForceBold is used with bold fonts to make sure that they will stay at least two pixels wide at low resolutions otherwise they would look identical to the non bold version at small sizes The character level hints are handled by the commands from the top of the listing given previously 611 20 hstem 11 21 hstem 0 66 vstem 578 66 vstem Voorjaar 1998 Bijlage 26 q PIS 1 va KA DLS X Aa NNA K AA A VIVO yY T KSS B A A ee _ Q S Zs aN NN Na pot YZ 2 EY LK ZS D Unhinted character Hinted character i Figure 9 The desired result this figure is also borrowed from the Fontlab Manual These define horizontal and vertical stem zones The first number says at which coordinate to start the second num ber the width to use from there In this case remember this is an M there are two vertical stems and two ghost horizontal stems Figure 10 shows the graphical represen tation of this character in the font editor The ghost stems are inserted because without
16. e programs that can do this is Tlascii from the T1Utils package But running this pro grams leaves us with a hexadecimal encrypted file In the early days the encryption key was a trade secret of Adobe Incorporated This key is now freely available but the file format still reflects the past Yet another program from the T1Utils can convert this form to real human readable PostScript Tldisasm Now we can look at the generat ed PostScript file to see how the M is defined in Type 1 format M 78 800 hsbw 611 20 hstem 11 21 hstem 0 66 vstem 578 66 vstem 581 595 rmoveto 259 450 rlineto 259 450 rlineto 6 9 12 7 12 0 rrcurveto 16 17 12 17 hvcurveto 563 vlineto Voorjaar 1998 17 15 13 18 vhcurveto 19 14 13 17 hvcurveto 439 vlineto 76 131 75 131 75 131 rrcurveto 5 10 12 6 13 0 rrcurveto 14 0 8 8 8 8 rrcurveto 75 131 75 131 76 131 rrcurveto 439 vlineto 17 14 13 19 vhcurveto 18 15 13 17 hvcurveto 562 vlineto 17 17 13 16 vhcurveto 12 0 12 5 6 11 rrcurveto closepath endchar ND The code looks enough like normal PostScript to recognize it at first glance but the commands themselves are not the same you would use in everyday graphics The PostScript language uses reverse Polish notation for it s commands so you should read backwards starting at the end of the line 581 595 rmoveto means move to the point with co ordinates 581 595 1992 pp 173 181 268 Bijlage 2
17. endant calculations that METAFONT does Here is the relevant portion of the example again mode_setup define _pixels s u ygap ht 13 5u xgap define _whole_pixels xgap define whole _vertical_pixels ygap py 9px define blacker pixels px py There are in fact two kinds of device dependence that need to be dealt with The mode_setup line takes care of the first kind of device dependance the effects that the actu al hardware of the printing engine can have on the printed 1 Actually figure 3 is not completely identical to figure 2 because in my example I cheated with the calculations a bit to keep the explanation simple 266 Bijlage 26 font The most obvious difference between any two printing devices is of course the resolution but there are other prob lems as well Since we prefer our output to look as close to our intended font as possible usually a certain amount of correction is needed based on i e whether the device is going to be an inkjet printer or a lasertypesetter mode_setup cannot do this all by itself and this is why you usually have to specify somewhere what printer you are using Programs like dvips will call METAFONT with a command like mf mode ljfour mag 1 input logo10 If we forget about that first backslash we can see that there are two assignments and one input command on this line The second assignment differs from 1 when a font is called within T X using a comm
18. hange are the two numbers The next lines set up some values of the PostScript graphics state that do not always have a predefined value this is just a security measure These lines also never change newpath is the first command that is interesting starting from here the character is defined Indeed there is only one moveto followed by four straight lines and final ly a stroke It would be a little bit easier if the calculated values were given in units of a thousand per em and this can be done by inserting a different mode_def Basically we ask META POST to generate a normal font file but at a magnification of 100 375 This gives us an end result in PostScript big points and the generated character will now look like this some comments and irrelevant lines stripped SIPS sBoundingBox 77 12 723 612 66 66722 0 dtransform exch truncate exch idtransform pop setlinewidth gsave newpath 111 1115 18 88889 moveto 111 1115 581 11142 lineto 399 99867 78 88953 lineto 688 88585 581 11142 lineto 688 88585 18 88889 lineto 1 0 90001 scale stroke grestore showpage SEOF Good This is starting to look like something we could use Ideally we would prefer a output in rounded numbers but that is not possible Converting stroked paths into outlined paths Mr Kinch author of TrueT X has written a program called metafog that converts METAPOST output as in the ex MAPS Generating Type 1 Fonts fromMetafont Sources ample
19. log The numbers you see are the positions of the characters in the font for the METAFONT logo font these are the positions of the used characters in the ASCII table M E T A F P S O N As you can see they can appear in any order within the source files The file METAFONT has written is not precisely the same as the output on your screen instead it looks like figure 2 Not really usable when it comes to typesetting text but it contains some pretty valuable information nev ertheless z e ew en eo Figure 2 Metafont output file for modeless files Have a look at the logo mf file if you are interested in the nitty gritty details I will use only a small portion of that file to make some remarks about METAFONT First here is the edited program text I will use to explain things This is no longer valid METAFONT input so don t start keying it in mode_setup define pixels s u ygap ht 13 5u xgap define _whole_pixels xgap define whole_vertical_pixels ygap 265 Taco Hoekwater py 9px define blacker pixels px py pickup pencircle xscaled px yscaled py logo_pen savepen leftstemloc 2 5u ts define_good_x pixels leftstemloc beginlogochar M 18 x1 x2 leftstemloc x4 x5 w x1 x3 w x3 yl y5 y2 y4 bot yl 0 top y2 h y3 ygap draw z1 z2 z3 z4 z5 labels 1 2 3 4 5 endchar Let s start at the line that
20. nstance from the Waldi2 set wasy6 wasy8 and wasy9 are missing so sIpX users probably need a changed Font Definition File Each directory now also contains a readme Hi there This directory contains a Type 1 version of some of the Metafont sources from the directory above The pfb files are intended to be used with the original TFM files don t run finst or afmtotfm on the afm files The afm and pfm files are provided just in case you want to install the files on your windowing sys tem I m sorry for the Macintosh users amongst you but I don t know how to create the MacType1 files The fonts should give exactly the same out put results as the mf originals up to the point of sillyness All bugs in the metafont sources have been kept and there might be new ones Files are herewith donated to the public domain and provided as is Note that I feel that the copyright from the metafont sources still applies my only state ment here is that I do not impose extra restrictions Conversion process mf metapost c Hobby eps eps gt metafog c Kinch gt pfb _pfb hinted amp touched up with FontLab v3 0c Voorjaar 1998 Bijlage 26 More fonts should follow in the next few months I can be reached for propositions bugs at taco hoekwater wkap nl Greetings Taco Hoekwater Please take a note of the fact that I only want to give support for problems that are intrinsically related to the pf
21. o be handled by the conversion process Various things need to be taken care of by the conversion but the three major parts are 1 Resolving the equations in the METAFONT sources 2 Converting stroked paths into outlined paths 3 Insertion of Type 1 style hinting information Resolving the equations in the METAFONT sources The first item is easy to do with an already existing pro gram METAPOST METAPOST is a program by John Hob by co author of METAFONT that accepts METAPOST input syntax and outputs an Encapsulated PostScript picture For example running METAPOST on the logo fonts using pre cisely the same syntax as for METAFONT gives the fol lowing output oe IPS BoundingBox 0 1 8 7 Creator MetaPost CreationDate 1998 05 10 1535 Pages 1 EndProlog Page 1 1 0 66418 0 dtransform exch truncate exch idtransform pop setlinewidth 0 setdash 1 setlinecap 1 setlinejoin 10 setmiterlimit de oe 271 Taco Hoekwater gsave newpath 1 10696 0 18819 moveto 1 10696 5 78938 lineto 3 98503 0 78595 lineto 6 8631 5 78938 lineto 6 8631 0 18819 lineto 1 0 9 scale stroke grestore showpage EOF The PostScript code contained in this file is not that hard The first few lines are just comments The two lines that end with setlinewidth do nothing except setting the line width for strokes It looks complex but the code is always the same the only things in these two lines that ever c
22. of these files is shown in figure 11 and figure 12 All we have to do is run metafog on all characters in the font If everything went correctly the next step in the process is running the makefont program But this is not always the case Metafog has its flaws and it is especially bad at handling complex characters One of those trickier characters is given in figure 13 In order to handle cases like this gracefully metafog has a special startup option that gives a half way result it cuts 272 Bijlage 26 Figure 13 The character X from Ralph Smith s Formal Script the supplied shape in pieces but it does not try to remove parts that are not needed There is yet another program in the metafog suite that helps for the problematic characters This program is called the weeder figure 14 It is an interactive program that reads the half way result metafog created The human operator now has to select the par tial lines that are supposed to belong to the shape and the weeder will write a finished file for use by makefont just like metafog itself would have done if things had gone right the first time For some fonts one has to do almost every character by hand for other fonts none at all The point of view the machine has on what precisely denotes a complicated character can be rather unexpected sometimes a character can look very simple to you but be almost impossible to process by metafog usually characters
23. s In such a font the only file that is different between various ver sions of the font is the driver file that assigns different Voorjaar 1998 Bijlage 26 values to the same parameters METAFONTs calculations will have different results so the some of points will end up in slightly different locations The resulting font will be similar in style but may still differ in lots of ways Creating a full font Usually fonts are not just a bunch of characters There also is some other metric information included in almost every font The final section of our example file at the end after all the characters have been defined contains the following lines ligtable T A kern 5u ligtable F O kern u ligtable P O kern u font_quad 18u 2s font_normal_space 6u 2s font_normal_stretch 3u font_normal_shrink 2u font_identifier MFLOGO font_coding_scheme AEFMNOPST only The first three lines belong to the ligature table Usually it will contain both real ligatures and the kerning information for the font but because this is a very simple font there are only three really simple kerning pairs The next lines define TEXs fontdimen values how wide a space will be and how much it can stretch and shrink and some other information that will appear in the created font but is generally not used by programs Dealing with device dependence Now let s have a look at the device dep
24. suits our purpose quite well since it is a rather simple font that probably everybody has available font_size 10pt ht 6pt xgap 0 6pt uf 4 9pt s 0 J Voorjaar 1998 Metafont Sources o 1 9pt px 2 3pt input logo bye What do we see here First there are a bunch of as signments made the lines that contain then there is an input this command functions the same way as T Xs input so it will start reading the file logo mf next and finally the last command is bye The file logo mf contains the actual commands to create the characters It helps to run METAFONT now to see what is going on Just type the following to a system command prompt mf logol0 Probably you didn t have to worry about where the logo10 mf file is on your harddisk since most METAFONT implementations can do recursive directory searches just like TEX fl MetaFont 2 718 Online Display Figure 1 Metafont output window for modeless files You should have seen a window popping up that shows characters as they are being created like the one in fig 264 Bijlage 26 ure I but it might look a little different on your system Also there should have been some terminal output like this This is METAFONT Version 2 718 Web2c 7 2beta7 logol0 mf logo mf 77 69 84 65 70 80 83 79 78 Output written on logol0 2602gf 9 characters 98 80 bytes Transcript written on logol0
25. them the overshoot suppression wouldn t work Figure 10 The character M from the METAFONT logo font with PostScript hints added 3 Like all hinting information these values are ignored if the stem widths are larger than three device pixels approximating 1200 dpi for the average font As a result output at 1200 dpi on a new device sometimes looks inferior to the 600 dpi version for the trained eye 270 Bijlage 26 Why we want to convert to Type 1 Now that we have looked briefly into both formats it is obvious that conversion from METAFONT input syntax to PostScript definitions is not going to be easy METAFONT is apparently a lot smarter than the Type I interpreter much better suited to handle device dependancies and more ac curate So why bother at all For practical reasons of course The most important incentive is the on screen display of generated PDF files Adobe s Reader is very bad at display ing bitmapped fonts so files with only Type 1 fonts look a lot better As it is there are quite some METAFONT fonts that don t yet have a Type I counterpart so necesarily lots of TEX generated PDF files use bitmaps There also is another interesting motive designing high quality fonts in METAFONT syntax is a lot easier than creat ing Type 1 fonts of the same quality in an interactive editor not to mention the fact that interactive programs usually crash at every second mouse click Tasks t
Download Pdf Manuals
Related Search
Related Contents
TERIDIAN 71M6534 Demo Board User`s Manual User Manual - Wuxi Thinkpower New Energy Technolog Co.,Ltd. [ プローブアダプタ PL26-7.5AD ] ≫PDF product manual LES TARIFS sfr sur mesure Osprey-300 User`s Guide RESEAU LON 3065 Guía de Usuario OneTouch® UltraEasy® User Guide Great Britain Copyright © All rights reserved.
Failed to retrieve file