]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - contrib/groff/contrib/mom/momdoc/appendices.html
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / contrib / groff / contrib / mom / momdoc / appendices.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
2 <html>
3 <head>
4 <meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
5 <title>Mom -- Appendices</title>
6 </head>
7 <body bgcolor="#dfdfdf">
8
9 <!====================================================================>
10
11 <a href="reserved.html#TOP">Next</a>&nbsp;&nbsp;
12 <a href="macrolist.html#TOP">Prev</a>&nbsp;&nbsp;
13 <a href="toc.html">Back to Table of Contents</a>
14 <p>
15
16 <a name="TOP"></a>
17 <a name="APPENDICES">
18         <h2 align="center"><u>APPENDICES</u></h2>
19 </a>
20
21 <ul>
22         <li><a href="#MOREDOC">Further notes on this documentation</a>
23         <li><a href="#FONTS">Adding PostScript fonts to groff</a>
24         <ul>
25                 <li><a href="#HOWTO">How to create a PostScript font for use with groff</a>
26         </ul>
27         <li><a href="#CODENOTES">Some reflections on mom, with an apology</a>
28         <li><a href="#CONTACT">Contact the author</a>
29         <li><a href="reserved.html">List of reserved words</a>
30 </ul>
31
32 <a name="MOREDOC">
33     <h2><u>Further notes on this documentation</u></h2>
34 </a>
35
36 Some <strong>mom</strong> users are sure to ask: &quot;Why is this
37 documentation in html?  If <strong>mom</strong>'s so great, why not
38 typeset the whole thing to show her off?  And if groff's so great,
39 why not write a man page?&quot;
40 <p>
41 Valid questions, to be sure, and <strong>mom</strong> has
42 answers.  (Okay -- I have answers, but I speak for
43 <strong>mom</strong>.)
44 <p>
45 The documentation is in html because I still find it the best tool
46 for navigating lengthy manuals.  Html, with its anchors and links,
47 came into being precisely so people could do something they'd never
48 been able to with the printed word: instantly track down internal
49 and external references in a document.
50 <p>
51 To me, it's essential that people reading <strong>mom</strong>'s
52 documentation never have difficulty finding precisely the macro
53 they need for a particular task.  Equally, when reading up on
54 a macro, they should never be presented with terms or other
55 macro names for which they cannot instantly find accurate explanations.
56 Short of having written the documentation in TeX for the info browser
57 (and TeX bloat is one of the reasons I prefer to typeset with groff),
58 I can think of no better way to achieve the kind of truly useful
59 documentation I wanted than html.
60 <p>
61 Another reason for html is that working with <strong>mom</strong>
62 necessarily involves creating files inside a text editor.  I use
63 elvis, a truly fabulous vi clone that does a terrific job of rendering
64 basic (text only) html.  I may have written <strong>mom</strong>,
65 but I still regularly call on her documentation.  Elvis, with its
66 html capabilities, lets me write and format <strong>mom</strong>
67 documents AND peruse her documentation, clicking on links as
68 necessary, without ever leaving the comfy confines of my
69 text editor.
70 <p>
71 Not everyone, of course, uses an editor with html capabilities.
72 For them, firing up a browser is obviously necessary for reading
73 <strong>mom</strong>'s documentation.  Browsers being what they are,
74 and not everyone on the globe having the cash for muscle machines
75 to run Galeon, or Konqueror or Mozilla, their browser
76 needs to be fast and light--and probably &quot;text-only&quot;.
77 <p>
78 Some <strong>mom</strong> users may notice the absence of graphics,
79 frames, and (for the most part) tables in this documentation.  The
80 reason is simple: text-only browsers.  People who, for whatever
81 reason (choice or necessity), use lynx, or links or w3m to read
82 the documentation must be able to make sense of it.  All of it.
83 Graphical examples of <strong>mom</strong> in action might have made
84 some parts of the documentation easier to write, but would have
85 excluded text-only browser users.  And it goes without saying that
86 the documentation looks fine if you're reading it in a graphical
87 browser.
88 <br>
89 <hr>
90
91 <!=====================================================================>
92
93 <a name="FONTS">
94     <h2><u>Adding PostScript fonts to groff</u></h2>
95 </a>
96
97 <a name="SMALL_NOTE"></a>
98 <em><strong>Small note:</strong> the term &lt;prefix&gt; in this
99 section refers to the directory in which groff is installed,
100 typically something like /usr/share/groff/&lt;version#&gt;
101 (for distro-specific, pre-compiled groff packages) or
102 /usr/local/share/groff/&lt;version#&gt; (if you've built groff
103 from source).</em>
104 <p>
105 Groff comes with a small library of PostScript
106 <a href="definitions.html#TERMS_FAMILY">families</a>
107 (see the
108 <a href="typesetting.html#FAMILY">FAMILY</a>
109 macro for a list).  The families have four
110 <a href="definitions.html#TERMS_FONT">fonts</a>
111 associated with them.  These fonts are a combination of
112 <a href="definitions.html#TERMS_WEIGHT">weight</a>
113 and
114 <a href="definitions.html#TERMS_SHAPE">shape</a>:
115 <br>
116 <ul>
117         <li><strong>R</strong> (Roman, usually Medium weight),
118         <li><strong>I</strong> (Italic, usually Medium weight),
119         <li><strong>B</strong> (Bold, usually Roman shape) and
120         <li><strong>BI</strong> (Bold Italic).
121 </ul>
122 <p>
123 If you do a lot of document processing or typesetting with
124 <strong>mom</strong>, you'll find, sooner or later, that these
125 families and their associated fonts aren't sufficient.  You'll want
126 to supplement them, either with more fonts for the families already
127 provided--"Damn!  I need Helvetica Bold Condensed Italic!"--or with
128 entire new families.
129 <p>
130 Without going into the gory details (yet), while it's true that
131 adding fonts to groff is a relatively straightforward
132 process, extending existing families or adding new ones requires
133 some planning.
134 <p>
135 The traditional approach to extending groff families has been
136 to create new families for non-default weights and
137 shapes (e.g.  Light, which is a weight; Condensed, which is a
138 shape), then to associate them with groff's predefined <strong>R,
139 I, B</strong> and <strong>BI</strong> font styles.  An example
140 of this can be seen in the groff PostScript font library itself
141 (&lt;prefix&gt;/font/devps/): there's one &quot;family&quot; for
142 Helvetica (HR, HI, HB, HBI) and another for Helvetica Narrow (HNR,
143 HNI, HNB, HNBI).
144 <p>
145 The difficulty with this approach is that typographers
146 tend to think of &quot;families&quot; as referring to the
147 entire set of font weights and shapes associated with a
148 particular family name.  For example, when a typesetter says
149 &quot;the Helvetica family&quot;, s/he is including the <a
150 href="definitions.html#TERMS_WEIGHT">weights</a> Helvetica Thin,
151 Helvetic Light, Helvetica Regular, Helvetica Bold, Helvetica Heavy,
152 etc, and all their associated
153 <a href="definitions.html#TERMS_SHAPE">shapes</a>
154 (Roman,
155 Italic, Condensed, Narrow, Extended, Outline, etc).
156 <p>
157 Thus, intuitively, when a typesetter gives <strong>mom</strong> a
158 <kbd>.FAM(ILY)</kbd> directive, s/he reasonably expects that any
159 subsequent <kbd>.FT</kbd> directive will access the desired font
160 from the Helvetica family--without the need to state explicitly both
161 family and font to <kbd>.FT</kbd>, as it is explained one can do in
162 the
163 <a href="typesetting.html#FAMILY">FAMILY</a>
164 and
165 <a href="typesetting.html#FONT">FT</a>
166 sections of these documents.
167 <p>
168 If one had, say, the fonts, Helvetica Light Roman
169 and Helvetica Light Italic as well as Helvetica Light Condensed
170 Roman and Helvetica Light Condensed Italic, the traditional
171 approach would require two &quot;partial&quot; families: HLR/HLI and
172 HLCDR/HLCDI.  Accessing these family/font combos
173 routinely throughout a document would then require
174 changing family (with <kbd>.FAM(ILY)</kbd>) and selecting the
175 desired font (with <kbd>.FT R</kbd> or <kbd>.FT I</kbd>), or
176 passing <kbd>.FT</kbd> the lengthy family+fontname (.e.g. <kbd>.FT
177 HLCDI</kbd>).
178 <p>
179 Fortunately, groff provides a mechanism whereby it's possible to
180 extend the basic <strong>R, I, B</strong> and <strong>BI</strong>
181 fonts (&quot;styles&quot; in groff-speak) so that one can, in
182 fact, create extensive type families, and access all the fonts
183 in them with <kbd>.ft</kbd> (groff) or <kbd>.FT</kbd> (mom).
184 <p>
185 <strong>mom</strong> uses this mechanism to offer, in addition to
186 groff's default PostScript font styles, the following:
187 <p>
188 <a name="STYLE_EXTENSIONS"></a>
189 <pre>
190 Mom's extensions to groff's basic font styles
191 =============================================
192
193         L      =  Light Roman
194         LI     =  Light Italic
195         LCD    =  Light Condensed Roman
196         LCDI   =  Light Condensed Italic
197         LEX    =  Light Extended Roman
198         LEXI   =  Light Extended Italic
199         CD     =  Medium/Book Condensed Roman
200         CDI    =  Medium/Book Condensed Italic
201         EX     =  Medium/Book Extended Roman
202         EXI    =  Medium/Book Extended Italic
203         DB     =  DemiBold Roman
204         DBI    =  DemiBold Italic
205         BCD    =  Bold Condensed Roman
206         BCDI   =  Bold Condensed Italic
207         BEX    =  Bold Extended Roman
208         BEXI   =  Bold Extended Italic
209         HV     =  Heavy Roman
210         HVI    =  Heavy Italic
211         HVCD   =  Heavy Condensed Roman
212         HVCDI  =  Heavy Condensed Italic
213         HVEX   =  Heavy Extended Roman
214         HVEXI  =  Heavy Extended Italic
215         BL     =  Black Roman
216         BLI    =  Black Italic
217         BLCD   =  Black Condensed Roman
218         BLCDI  =  Black Condensed Italic
219         BLEX   =  Black Extended Roman
220         BLEXI  =  Black Extended Italic
221         UBL    =  Ultra-Black Roman
222         UBLI   =  Ultra-Black Italic
223 </pre>
224
225 Thus, with <strong>mom</strong>, if you've installed, say, some
226 extra Helvetica fonts and named them according to the convention FS
227 (where &quot;F&quot; means family and &quot;S&quot; means font
228 style), once having entered
229 <p>
230 <pre>
231         .FAMILY H
232           or
233         .FAM H
234 </pre>
235
236 you can access any of those Helvetica fonts simply by
237 passing the correct argument from the list above to
238 <a href="typesetting.html#FONT">FT</a>.
239 <p>
240 For example, if you were working in Medium Roman (<kbd>.FT R</kbd>)
241 and you needed Medium Condensed Italic for a while (assuming it's
242 installed), you'd just type
243 <p>
244 <pre>
245         .FT CDI
246 </pre>
247
248 to access the Medium Condensed Italic font from the Helvetica
249 family.
250 <p>
251 <strong>Mom</strong>'s list of font styles doesn't pretend to
252 be exhaustive, but rather tries to cover the basic weight/shape
253 combinations likely to be found in any reasonably complete type
254 family.
255 <p>
256 The actual extension names are arbitrary and can be used in a
257 flexible manner.  For example, if you create a family that has a
258 DemiBold font (DB) but no Bold font (B), you might find it more
259 convenient to give the DemiBold font the extension &quot;B&quot;.
260 Equally, if the family has an ExtraBold font, you might find it more
261 convenient to use the extension &quot;HV&quot; (Heavy).
262 <a name="REGISTER_STYLE"></a>
263 <p>
264 However, you may, at needs, want to add to <strong>mom</strong>'s
265 list of font styles.  You can do this by editing the file, om.tmac.
266 Near the top, you'll see lines of the form
267 <p>
268 <pre>
269         .sty \n[.fp] L       \" Light Roman
270         .sty \n[.fp] LI      \" Light Italic
271         .sty \n[.fp] LCD     \" Light Condensed Roman
272 </pre>
273
274 Simply add your new font style by imitating what you see and
275 plugging in your new font style (having, of course, first created the
276 font, correctly named, in groff's PostScript font directory; see
277 <a href="#HOWTO">How to create a PostScript font for use with groff</a>).
278 <p>
279 For example, if you already have some fonts from the Univers
280 family installed and have called the family UN, you might decide at
281 some point to add the Bold Outline font (UNBO).  In which case,
282 you'd add
283 <p>
284 <pre>
285         .sty \n[.fp] BO      \" Bold Outline
286 </pre>
287
288 to the <kbd>.sty \n[.fp] &lt;font style&gt;</kbd> list in om.tmac.
289 <p>
290 Be careful, though, that any styles you add do not conflict
291 with <strong><u>family</u></strong> names that already exist.
292 &quot;C&quot;, for example, conflicts with the Courier family
293 (CR, CI, CB, CI).  Were you to create a font style &quot;C&quot;,
294 thinking that <kbd>.FT C</kbd> would give you access to font style
295 once you'd given a <kbd>.FAM(ILY)</kbd> directive, you'd get a nasty
296 surprise: your type would come out in Courier Roman!
297 <p>
298 <strong>VERY IMPORTANT NOTE: mom</strong>'s font extensions are
299 not &quot;user-space&quot; controllable via a macro.  If you've
300 been using groff for a long time, and have already rolled your own
301 solution to adding PostScript families, fonts, weights, shapes, etc. to
302 groff, you may find that <strong>mom</strong>'s font extensions
303 conflict with your own scheme.  Should that be the case, comment out
304 the <kbd>.sty \n[.fp] &lt;font style&gt;</kbd> lines found near the
305 top of the om.tmac file.
306
307 <a name="HOWTO"><h3><u>How to create a PostScript font for use with groff</u></h3></a>
308 These instructions aren't meant to cover all possibilities, merely
309 to present one way of making PostScript families/fonts available to
310 groff and <strong>mom</strong>.
311 <p>
312 GNU/Linux distributions being what they are, directory locations may
313 differ and the presence of some executables can't be guaranteed.
314 I run a Debian system.  The instructions reflect that.  Users of
315 other distros will have to interpret them according to the way their
316 distro operates.
317 <p>
318 What you need before you start:
319 <br>
320 <ul>
321         <li>groff, version 1.18 or higher
322                 <br>
323                 (Debian package: groff)
324         <li>a full installation of gs and associated tools
325                 <br>
326                 (Debian package: gs or gs-gpl)
327         <li>a library of gs fonts
328                 <br>
329                 (Debian package: gsfonts)
330         <li>a utility for converting TrueType fonts to Type1 fonts
331                 <br>
332                 (Debian package: ttf2pt1)
333         <li>a font manager
334                 <br>
335                 (Debian packages: defoma, psfontmgr, dfontmgr)
336         <li>perl
337                 <br>
338                 (Debian package: perl)
339 </ul>
340 <br>
341 A reasonably complete installation of any major GNU/Linux distro
342 should already have these on your system, except perhaps for the
343 utility to convert TrueType fonts to Type1 fonts.
344 <p>
345 Initial preparation (you only have to do this once):
346 <br>
347 <ol>
348         <li>If you don't already have one, create a directory in your
349                 home directory to hold new fonts.  Any directory name will do.
350                 I use ~/Fonts, with subdirectories for Type1, TrueType and Groff
351                 fonts.
352 <a name="SITE-FONT"></a>
353         <li>Locate the groff directory, site-font.  The exact location is
354                 difficult to predict, owing to differences between distros
355                 and whether you're using a pre-packaged groff or have built
356                 it from source.  Some typical locations are
357                 <br>
358                 <ul>
359                         <li>/usr/share/groff,
360                         <li>/usr/local/share/groff
361                         <li>/etc/groff
362                 </ul>
363                 <p>
364                 If you can't find the site-font directory, locate
365                 groff's site-tmac directory, and, as root, create site-font
366                 in the same directory as the one that holds site-tmac.
367                 E.g., if you find site-tmac in /usr/share/groff, create
368                 site-font in /usr/share/groff.
369         <li>Locate the file <kbd>&lt;prefix&gt;/font/devps/generate/textmap</kbd>
370         and symlink it to <kbd>textmap</kbd> in the directory that
371         contains your personal collection of PostScript fonts.  (See the
372                 <a href="#SMALL_NOTE">Small Note</a>,
373                 above, for the meaning of &lt;prefix&gt;).  On my system,
374                 at the time of writing, &lt;prefix&gt; is
375                 /usr/local/share/groff/1.19.2/, therefore, I symlink it in
376                 ~/Fonts/Type1 with
377                 <br>
378                 <pre>
379 ln -s /usr/local/share/groff/1.19.2/font/devps/generate/textmap textmap
380                 </pre>
381         <li>Locate the file &lt;prefix&gt;/font/devps/text.enc and
382                 symlink it to <kbd>text.enc</kbd> in your personal font
383                 directory.  On my system, in ~/Fonts/Type1
384                 <pre>
385 ln -s /usr/local/share/groff/1.19.2/font/devps/text.enc text.enc
386                 </pre>
387         <li>Make sure you know which directory/ies holds your gs fonts.
388                 You'll need the information later.  On a Debian box, some
389                 typical locations are
390                 <br>
391                 <ul>
392                         <li>/usr/lib/ghostscript/fonts
393                         <li>/usr/share/ghostscript/fonts
394                         <li>/usr/share/fonts/type1/gsfonts
395                 </ul>
396 </ol>
397 <br>
398 Font creation/installation:
399 <br>
400 <ol>
401         <li>Acquire the font in either Type1 (.pfb) or TrueType
402                 (.ttf) format.
403         <li>Place the font in your personal font directory; for me,
404                 that's ~/Fonts/Type1 or ~/Fonts/TrueType.
405         <li>In your personal font directory, run one of the following:
406                 <br>
407                 <ul>
408                         <li>For Type1 fonts
409                         <br>
410                         <ul>
411                                 <li><kbd>getafm fontfilename.pfb | gsnd - > fontfilename.afm</kbd>
412                                         <br>
413                                         For Type1 fonts, this will generate something called
414                                         an .afm (Adobe Font Metrics) file, which is
415                                         required to create PostScript fonts for groff.
416                         </ul>
417                         <li>For TrueType fonts
418                         <br>
419                         <ul>
420                                 <li><kbd>ttf2pt1 \-b fontfilename.ttf</kbd>
421                                 <br>
422                                 For TrueType fonts, this will generate a PostScript
423                                 .pfb file as well as an .afm file.
424                         </ul>
425                 </ul>
426         <li>Still in your personal font directory, run
427                 <br>
428                 <ul>
429                         <li><kbd>afmtodit -e text.enc fontfilename.afm textmap GROFF_FONTNAME</kbd>
430                 </ul>
431                 <p>
432                 Q: <em>How do I choose a GROFF_FONTNAME?</em>
433                 <p>
434                 A: Start by considering the
435                 <a href="definitions.html#TERMS_FAMILY">family</a>
436                 to which the font belongs.  If you're adding to a family that
437                 already exists in groff's &lt;prefix&gt;/font/devps
438                 directory, that will be the first part of the font name.
439                 (See
440                 <a href="typesetting.html#FAMILY">here</a>
441                 for a list of families already installed, along with their groff
442                 names.)  Add to that name the appropriate weight/style extension,
443                 listed
444                 <a href="#STYLE_EXTENSIONS">here</a>.
445                 <p>
446                 For example, if you're adding Helvetica Light Roman, your
447                 GROFF_FONTNAME would be <strong>HL</strong>.  If you're
448                 adding Helvetica Light Italic, your GROFF_FONTNAME would be
449                 <strong>HLI</strong>.
450                 <p>
451                 If you're adding a font not already in groff's PostScript
452                 families, first choose a meaningful name for the
453                 <a name="definitions.html#TERMS_FAMILY">family</a>
454                 to which the font belongs.  The name can be anything you like.  If,
455                 for example, the family is Garamond, you could choose GARAMOND,
456                 GARA, GD, or even just plain G as the family name.  Then tack on the
457                 appropriate style/weight extension.  Thus, if you were installing
458                 Garamond Bold Condensed Italic and had chosen <strong>GD</strong>
459                 as the family name for Garamond, your GROFF_FONTNAME would be
460                 <strong>GDBCDI</strong>.
461                 <p>
462                 In <strong>mom</strong>, you can then access the Garamond
463                 family with <kbd>.FAM GD</kbd>, and the Bold Condensed
464                 Italic font wth <kbd>.FT BCDI</kbd>.
465                 <p>
466                 <strong>Note:</strong> The family name need not be in upper
467                 case, and there's no limit to the length of the name.
468                 &quot;Garamond&quot;, for example, could be the name you
469                 give the Garamond family.  In fact, you might find it
470                 preferable, since a) you wouldn't have to remember how
471                 you'd named the family, and b) should you be scanning
472                 your
473                 <a href="#SITE-FONT">site-font directory</a>,
474                 something like GaramondBCDI will be more meaningful than,
475                 say, GDBCDI. 
476         <li>Copy or move GROFF_FONTNAME to your
477                 <a href="#SITE-FONT">site-font directory</a>,
478                 or change to the site-font directory and make a symlink to
479                 GROFF_FONTNAME in your personal directory.
480         <li>Copy or move the .pfb file to the directory that
481                 holds your gs fonts, or change to that directory and make a
482                 symlink to the .pfb file in your personal directory.
483         <li>Do whatever your system or distro requires in order to
484                 register the new PostScript font (the .pfb file).  On a
485                 Debian system, as root, you can run dfontmgr for a
486                 graphical interface that will take care of registering the
487                 font.
488 </ol>
489 <p>
490 Written out in full, adding fonts looks like a lot of work.  It
491 isn't.  Basically, it's just:
492 <br>
493 <ul>
494         <li>acquire the font
495         <li>generate an .afm file for the font
496         <li>create the groff font
497         <li>put the groff font in &lt;prefix&gt;/font/devps
498         <li>make sure gs knows about the font
499 </ul>
500 <br>
501 After you've done it a couple of times, it all makes sense, and is
502 really quite easy.  Not to mention that once you understand the
503 process, you can write a bash script to automate the process.
504 Here's an example, which you can adapt to your own needs.  The
505 script requires an argument (the .pfb filename), then prompts for
506 the GROFF_FONTNAME.
507 <p>
508 <pre>
509 #! /bin/bash
510
511 # A script for installing Type1 fonts.
512 #
513 # Builds .afm files from .pfb files, generates a groff font from the
514 # .afm file, makes a symlink in /usr/lib/ghostscript/font/ to the
515 # .pfb file, and a symlink in site-font to the groff font
516
517 # .pfb filename, stripped of .pfb extension
518 FONT=`basename $1 .pfb`
519
520 # Directory holding my personal collection of type1 fonts
521 FONTDIR="$HOME/Fonts/Type1"
522
523 # Directory holding system ghostscript fonts
524 GS_FONTDIR="/usr/lib/ghostscript/fonts"
525
526 # Location of site-font/devps
527 GROFF_SITE_FONTDIR="/usr/local/share/groff/site-font/devps"
528
529 # Personal groff fonts directory
530 GROFF_FONTS="$HOME/Fonts/Groff"
531
532 # Symlinks to textmap and text.enc
533 TEXTMAP="$FONTDIR/textmap"
534 TEXTENC="$FONTDIR/text.enc"
535
536 if [ ! `pwd` = "$FONTDIR" ] ; then
537     echo "Changing into $FONTDIR directory.."
538     cd $FONTDIR
539     sleep 1
540 else
541         sleep 1
542 fi
543
544 echo -n "Groff name for this font: "
545 read FONTNAME
546 sleep 1
547
548 echo "Getting .afm.."
549 getafm $FONT.pfb | gsnd - > $FONT.afm
550 sleep 1
551
552 echo "Creating $FONTNAME.."
553 afmtodit -e $TEXTENC $FONTDIR/$FONT.afm $TEXTMAP $FONTNAME
554 mv -i $FONTNAME $GROFF_FONTS
555 sudo ln -s $GROFF_FONTS/$FONTNAME $GROFF_SITE_FONTDIR/$FONTNAME
556 sleep 1
557
558 echo "Linking $FONT in $GS_FONTDIR.."
559 cd $GS_FONTDIR
560 sudo ln -s $FONTDIR/$FONT.afm $FONT.afm
561 sudo ln -s $FONTDIR/$FONT.pfb $FONT.pfb
562 sleep 1
563
564 # This next bit is Debian specific.  If you're not running a
565 # Debian system, replace it with whatever your distro requires
566 # in order to register Type1 fonts.
567
568 if [ !`pidof -x /usr/bin/dfontmgr` ] ; then
569     echo "I will now run dfontmgr so you can register the font."
570     exec sudo dfontmgr &
571 else
572     echo "You may now register the font with dfontmgr."
573 fi
574 </pre>
575 <hr>
576
577 <!=====================================================================>
578
579 <a name="CODENOTES">
580         <h2><u>Some reflections on mom</u></h2>
581 </a>
582
583 <p>
584 <strong>Mom</strong>, as a complete macro set, had her origins
585 in a &quot;library&quot; of groff routines I wrote over the
586 years to handle various aspects of typesetting and document
587 processing that weren't adequately covered by ms, me, mm, and so
588 on.  Typically, I'd use the library to cobble together macro
589 sets for new challenges as they came my way.
590 <p>
591 If, as Eric Raymond asserts, open source begins with a programmer
592 scratching a personal itch, then <strong>mom</strong> can truly be
593 called open source, even if, a mere humble set of macros standing on
594 the shoulders of a giant named troff, she isn't programming at all.
595 <p>
596 As a writer living in a perpetual state of penury, all the computers
597 I've ever owned have been hand-me-downs -- several generations
598 out-of-date and &quot;resource challenged&quot;.  Disk space has
599 always been an issue, as has processor speed and available RAM.
600 One of the reasons I run GNU/Linux is that it has helped enormously
601 to get the most out of my poor little boxes.  (It has been pointed
602 out to me that NetBSD might be an even better choice of operating
603 systems for computers with limited resources.)
604 <p>
605 In Linux-land, the choice of typesetting systems basically comes down
606 to groff or TeX.  Both are wonderful -- monumental achievements if you
607 ask me -- and both have their own particular strengths.  However, for
608 people in my financial position (and there are millions of us around
609 the globe, in both developed and developing countries), TeX and groff
610 have one big difference: size.  TeX is huge.  Even its most ardent
611 supporters agree it suffers from bloat, on top of being complex and
612 unwieldy to manage.  Groff is tiny by comparison, occupying minimal
613 disk space and having only a small memory footprint while at the same
614 time being flexible and powerful, typographically speaking.  I've run
615 it successfully on a 386 with 8 megs of RAM and a 250 meg hard disk.
616 <p>
617 However, groff has always had a liability: it's incredibly geeky.
618 Owing to its very long history, it -- and its &quot;power users&quot;
619 -- have remained stuck in a time warp.  Most common macro packages
620 still look as they did in those decades when memory was exorbitantly
621 expensive and every byte mattered.  Documentation -- not always
622 easy to find -- is written as if all readers are computer whizzes,
623 or at least have a university degree in one of the higher sciences.
624 <p>
625 By no means a stupid man, nor unfamiliar with the precepts of
626 programming, I've more than once torn my hair out over the terseness and
627 ambiguity of groff's documentation.  Making sense of certain primitives
628 has often involved days of testing, interpreting the documentation
629 instead of just using the primitive.
630 <p>
631 (ADDENDUM to the previous two paragraphs:  A tremendous amount of
632 effort has gone into creating a groff manual that can be read with
633 "info," as well as creating truly useful man pages.  The info
634 manual is clear and well-written, so my comments are actually out
635 of date.  I leave them in for the benefit of groff newbies, who may
636 still find the documents a bit intimidating.)
637 <p>
638 For some time now, groff users and macro writers have had the
639 option to use &quot;long&quot; names, yet have mostly chosen not to.
640 With long names, it's possible to create macro sets that are humanly
641 readable and easy to interpret, encouraging development and evolution.
642 What's more, the macros themselves need not be terse, intimidating,
643 and easily forgotten 1- or 2-letter commands inserted in the body
644 of a document.  They can be sensible and helpful to everyone, groff
645 newbies and old hands alike.
646 <p>
647 <strong>Mom</strong>'s macro file, om.tmac, uses long names, aliases,
648 and a host of other groff goodies that have become part of the
649 whole groff picture under the unflagging guidance of groff's current
650 maintainer, Werner Lemberg.  Nearly every macro, number register and
651 string is &quot;recognizable&quot; simply by its name.  The file is
652 heavily commented.  A consistent, if idiosyncratic, indenting style
653 is used as well, significantly improving readability.  Anyone
654 wanting to futz around with <strong>mom</strong>'s macros should be
655 able to do so with a minimum of head scratching.
656 <br>
657 <hr>
658
659 <!=====================================================================>
660
661 <a name="CONTACT">
662         <h2><u>Contact the author</u></h2>
663 </a>
664
665 <p>
666 If you have any questions or comments about <strong>mom</strong>,
667 suggestions to make, criticisms to offer, or bugs to report, use the
668 groff mailing list at
669 <a href="mailto:groff@ffii.org">groff@ffii.org</a>
670 (subscription information available
671 <a href="http://ffii.org/mailman/listinfo/groff/">here</a>)
672 or contact me, Peter Schaffter,  directly at
673 <i>&#112;&#101;&#116;&#101;&#114;&#64;&#102;&#97;&#117;&#115;&#116;&#117;&#115;&#46;&#100;&#121;&#110;&#46;&#99;&#97;</i>
674 or
675 <i>&#112;&#116;&#112;&#105;&#64;&#103;&#111;&#108;&#100;&#101;&#110;&#46;&#110;&#101;&#116;</i>.
676
677 <p>
678 Please include the word &quot;mom&quot; or &quot;groff&quot; in the
679 Subject: line of any message sent to my personal address, or you
680 risk the wrath of my implacable spam filters. :)
681 <p>
682 If you want to visit <strong>mom</strong>'s homepage, you'll find
683 it
684 <a href="http://faustus.dyn.ca/mom/mom.html">here</a>.
685 <p>
686 <hr>
687 <a href="reserved.html#TOP">Next</a>&nbsp;&nbsp;
688 <a href="macrolist.html#TOP">Prev</a>&nbsp;&nbsp;
689 <a href="#TOP">Top</a>&nbsp;&nbsp;
690 <a href="toc.html">Back to Table of Contents</a>
691 </body>
692 </html>