1151497Sru<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> 2104862Sru<html> 3104862Sru<head> 4104862Sru<meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> 5104862Sru<title>Mom -- Appendices</title> 6104862Sru</head> 7104862Sru<body bgcolor="#dfdfdf"> 8104862Sru 9104862Sru<!====================================================================> 10104862Sru 11151497Sru<a href="reserved.html#TOP">Next</a> 12151497Sru<a href="macrolist.html#TOP">Prev</a> 13104862Sru<a href="toc.html">Back to Table of Contents</a> 14151497Sru<p> 15104862Sru 16104862Sru<a name="TOP"></a> 17104862Sru<a name="APPENDICES"> 18104862Sru <h2 align="center"><u>APPENDICES</u></h2> 19104862Sru</a> 20104862Sru 21104862Sru<ul> 22104862Sru <li><a href="#MOREDOC">Further notes on this documentation</a> 23151497Sru <li><a href="#FONTS">Adding PostScript fonts to groff</a> 24151497Sru <ul> 25151497Sru <li><a href="#HOWTO">How to create a PostScript font for use with groff</a> 26151497Sru </ul> 27104862Sru <li><a href="#CODENOTES">Some reflections on mom, with an apology</a> 28151497Sru <li><a href="#CONTACT">Contact the author</a> 29104862Sru <li><a href="reserved.html">List of reserved words</a> 30104862Sru</ul> 31104862Sru 32104862Sru<a name="MOREDOC"> 33104862Sru <h2><u>Further notes on this documentation</u></h2> 34104862Sru</a> 35104862Sru 36104862SruSome <strong>mom</strong> users are sure to ask: "Why is this 37104862Srudocumentation in html? If <strong>mom</strong>'s so great, why not 38104862Srutypeset the whole thing to show her off? And if groff's so great, 39104862Sruwhy not write a man page?" 40104862Sru<p> 41104862SruValid questions, to be sure, and <strong>mom</strong> has 42104862Sruanswers. (Okay -- I have answers, but I speak for 43104862Sru<strong>mom</strong>.) 44104862Sru<p> 45104862SruThe documentation is in html because I still find it the best tool 46104862Srufor navigating lengthy manuals. Html, with its anchors and links, 47104862Srucame into being precisely so people could do something they'd never 48104862Srubeen able to with the printed word: instantly track down internal 49104862Sruand external references in a document. 50104862Sru<p> 51104862SruTo me, it's essential that people reading <strong>mom</strong>'s 52104862Srudocumentation never have difficulty finding precisely the macro 53104862Sruthey need for a particular task. Equally, when reading up on 54104862Srua macro, they should never be presented with terms or other 55104862Srumacro names for which they cannot instantly find accurate explanations. 56104862SruShort of having written the documentation in TeX for the info browser 57104862Sru(and TeX bloat is one of the reasons I prefer to typeset with groff), 58104862SruI can think of no better way to achieve the kind of truly useful 59104862Srudocumentation I wanted than html. 60104862Sru<p> 61104862SruAnother reason for html is that working with <strong>mom</strong> 62104862Srunecessarily involves creating files inside a text editor. I use 63104862Sruelvis, a truly fabulous vi clone that does a terrific job of rendering 64104862Srubasic (text only) html. I may have written <strong>mom</strong>, 65104862Srubut I still regularly call on her documentation. Elvis, with its 66104862Sruhtml capabilities, lets me write and format <strong>mom</strong> 67104862Srudocuments AND peruse her documentation, clicking on links as 68151497Srunecessary, without ever leaving the comfy confines of my 69104862Srutext editor. 70104862Sru<p> 71104862SruNot everyone, of course, uses an editor with html capabilities. 72104862SruFor them, firing up a browser is obviously necessary for reading 73104862Sru<strong>mom</strong>'s documentation. Browsers being what they are, 74104862Sruand not everyone on the globe having the cash for muscle machines 75151497Sruto run Galeon, or Konqueror or Mozilla, their browser 76151497Sruneeds to be fast and light--and probably "text-only". 77104862Sru<p> 78104862SruSome <strong>mom</strong> users may notice the absence of graphics, 79151497Sruframes, and (for the most part) tables in this documentation. The 80151497Srureason is simple: text-only browsers. People who, for whatever 81151497Srureason (choice or necessity), use lynx, or links or w3m to read 82151497Sruthe documentation must be able to make sense of it. All of it. 83151497SruGraphical examples of <strong>mom</strong> in action might have made 84151497Srusome parts of the documentation easier to write, but would have 85151497Sruexcluded text-only browser users. And it goes without saying that 86151497Sruthe documentation looks fine if you're reading it in a graphical 87151497Srubrowser. 88104862Sru<br> 89104862Sru<hr> 90104862Sru 91104862Sru<!=====================================================================> 92104862Sru 93151497Sru<a name="FONTS"> 94151497Sru <h2><u>Adding PostScript fonts to groff</u></h2> 95151497Sru</a> 96151497Sru 97151497Sru<a name="SMALL_NOTE"></a> 98151497Sru<em><strong>Small note:</strong> the term <prefix> in this 99151497Srusection refers to the directory in which groff is installed, 100151497Srutypically something like /usr/share/groff/<version#> 101151497Sru(for distro-specific, pre-compiled groff packages) or 102151497Sru/usr/local/share/groff/<version#> (if you've built groff 103151497Srufrom source).</em> 104151497Sru<p> 105151497SruGroff comes with a small library of PostScript 106151497Sru<a href="definitions.html#TERMS_FAMILY">families</a> 107151497Sru(see the 108151497Sru<a href="typesetting.html#FAMILY">FAMILY</a> 109151497Srumacro for a list). The families have four 110151497Sru<a href="definitions.html#TERMS_FONT">fonts</a> 111151497Sruassociated with them. These fonts are a combination of 112151497Sru<a href="definitions.html#TERMS_WEIGHT">weight</a> 113151497Sruand 114151497Sru<a href="definitions.html#TERMS_SHAPE">shape</a>: 115151497Sru<br> 116151497Sru<ul> 117151497Sru <li><strong>R</strong> (Roman, usually Medium weight), 118151497Sru <li><strong>I</strong> (Italic, usually Medium weight), 119151497Sru <li><strong>B</strong> (Bold, usually Roman shape) and 120151497Sru <li><strong>BI</strong> (Bold Italic). 121151497Sru</ul> 122151497Sru<p> 123151497SruIf you do a lot of document processing or typesetting with 124151497Sru<strong>mom</strong>, you'll find, sooner or later, that these 125151497Srufamilies and their associated fonts aren't sufficient. You'll want 126151497Sruto supplement them, either with more fonts for the families already 127151497Sruprovided--"Damn! I need Helvetica Bold Condensed Italic!"--or with 128151497Sruentire new families. 129151497Sru<p> 130151497SruWithout going into the gory details (yet), while it's true that 131151497Sruadding fonts to groff is a relatively straightforward 132151497Sruprocess, extending existing families or adding new ones requires 133151497Srusome planning. 134151497Sru<p> 135151497SruThe traditional approach to extending groff families has been 136151497Sruto create new families for non-default weights and 137151497Srushapes (e.g. Light, which is a weight; Condensed, which is a 138151497Srushape), then to associate them with groff's predefined <strong>R, 139151497SruI, B</strong> and <strong>BI</strong> font styles. An example 140151497Sruof this can be seen in the groff PostScript font library itself 141151497Sru(<prefix>/font/devps/): there's one "family" for 142151497SruHelvetica (HR, HI, HB, HBI) and another for Helvetica Narrow (HNR, 143151497SruHNI, HNB, HNBI). 144151497Sru<p> 145151497SruThe difficulty with this approach is that typographers 146151497Srutend to think of "families" as referring to the 147151497Sruentire set of font weights and shapes associated with a 148151497Sruparticular family name. For example, when a typesetter says 149151497Sru"the Helvetica family", s/he is including the <a 150151497Sruhref="definitions.html#TERMS_WEIGHT">weights</a> Helvetica Thin, 151151497SruHelvetic Light, Helvetica Regular, Helvetica Bold, Helvetica Heavy, 152151497Sruetc, and all their associated 153151497Sru<a href="definitions.html#TERMS_SHAPE">shapes</a> 154151497Sru(Roman, 155151497SruItalic, Condensed, Narrow, Extended, Outline, etc). 156151497Sru<p> 157151497SruThus, intuitively, when a typesetter gives <strong>mom</strong> a 158151497Sru<kbd>.FAM(ILY)</kbd> directive, s/he reasonably expects that any 159151497Srusubsequent <kbd>.FT</kbd> directive will access the desired font 160151497Srufrom the Helvetica family--without the need to state explicitly both 161151497Srufamily and font to <kbd>.FT</kbd>, as it is explained one can do in 162151497Sruthe 163151497Sru<a href="typesetting.html#FAMILY">FAMILY</a> 164151497Sruand 165151497Sru<a href="typesetting.html#FONT">FT</a> 166151497Srusections of these documents. 167151497Sru<p> 168151497SruIf one had, say, the fonts, Helvetica Light Roman 169151497Sruand Helvetica Light Italic as well as Helvetica Light Condensed 170151497SruRoman and Helvetica Light Condensed Italic, the traditional 171151497Sruapproach would require two "partial" families: HLR/HLI and 172151497SruHLCDR/HLCDI. Accessing these family/font combos 173151497Sruroutinely throughout a document would then require 174151497Sruchanging family (with <kbd>.FAM(ILY)</kbd>) and selecting the 175151497Srudesired font (with <kbd>.FT R</kbd> or <kbd>.FT I</kbd>), or 176151497Srupassing <kbd>.FT</kbd> the lengthy family+fontname (.e.g. <kbd>.FT 177151497SruHLCDI</kbd>). 178151497Sru<p> 179151497SruFortunately, groff provides a mechanism whereby it's possible to 180151497Sruextend the basic <strong>R, I, B</strong> and <strong>BI</strong> 181151497Srufonts ("styles" in groff-speak) so that one can, in 182151497Srufact, create extensive type families, and access all the fonts 183151497Sruin them with <kbd>.ft</kbd> (groff) or <kbd>.FT</kbd> (mom). 184151497Sru<p> 185151497Sru<strong>mom</strong> uses this mechanism to offer, in addition to 186151497Srugroff's default PostScript font styles, the following: 187151497Sru<p> 188151497Sru<a name="STYLE_EXTENSIONS"></a> 189151497Sru<pre> 190151497SruMom's extensions to groff's basic font styles 191151497Sru============================================= 192151497Sru 193151497Sru L = Light Roman 194151497Sru LI = Light Italic 195151497Sru LCD = Light Condensed Roman 196151497Sru LCDI = Light Condensed Italic 197151497Sru LEX = Light Extended Roman 198151497Sru LEXI = Light Extended Italic 199151497Sru CD = Medium/Book Condensed Roman 200151497Sru CDI = Medium/Book Condensed Italic 201151497Sru EX = Medium/Book Extended Roman 202151497Sru EXI = Medium/Book Extended Italic 203151497Sru DB = DemiBold Roman 204151497Sru DBI = DemiBold Italic 205151497Sru BCD = Bold Condensed Roman 206151497Sru BCDI = Bold Condensed Italic 207151497Sru BEX = Bold Extended Roman 208151497Sru BEXI = Bold Extended Italic 209151497Sru HV = Heavy Roman 210151497Sru HVI = Heavy Italic 211151497Sru HVCD = Heavy Condensed Roman 212151497Sru HVCDI = Heavy Condensed Italic 213151497Sru HVEX = Heavy Extended Roman 214151497Sru HVEXI = Heavy Extended Italic 215151497Sru BL = Black Roman 216151497Sru BLI = Black Italic 217151497Sru BLCD = Black Condensed Roman 218151497Sru BLCDI = Black Condensed Italic 219151497Sru BLEX = Black Extended Roman 220151497Sru BLEXI = Black Extended Italic 221151497Sru UBL = Ultra-Black Roman 222151497Sru UBLI = Ultra-Black Italic 223151497Sru</pre> 224151497Sru 225151497SruThus, with <strong>mom</strong>, if you've installed, say, some 226151497Sruextra Helvetica fonts and named them according to the convention FS 227151497Sru(where "F" means family and "S" means font 228151497Srustyle), once having entered 229151497Sru<p> 230151497Sru<pre> 231151497Sru .FAMILY H 232151497Sru or 233151497Sru .FAM H 234151497Sru</pre> 235151497Sru 236151497Sruyou can access any of those Helvetica fonts simply by 237151497Srupassing the correct argument from the list above to 238151497Sru<a href="typesetting.html#FONT">FT</a>. 239151497Sru<p> 240151497SruFor example, if you were working in Medium Roman (<kbd>.FT R</kbd>) 241151497Sruand you needed Medium Condensed Italic for a while (assuming it's 242151497Sruinstalled), you'd just type 243151497Sru<p> 244151497Sru<pre> 245151497Sru .FT CDI 246151497Sru</pre> 247151497Sru 248151497Sruto access the Medium Condensed Italic font from the Helvetica 249151497Srufamily. 250151497Sru<p> 251151497Sru<strong>Mom</strong>'s list of font styles doesn't pretend to 252151497Srube exhaustive, but rather tries to cover the basic weight/shape 253151497Srucombinations likely to be found in any reasonably complete type 254151497Srufamily. 255151497Sru<p> 256151497SruThe actual extension names are arbitrary and can be used in a 257151497Sruflexible manner. For example, if you create a family that has a 258151497SruDemiBold font (DB) but no Bold font (B), you might find it more 259151497Sruconvenient to give the DemiBold font the extension "B". 260151497SruEqually, if the family has an ExtraBold font, you might find it more 261151497Sruconvenient to use the extension "HV" (Heavy). 262151497Sru<a name="REGISTER_STYLE"></a> 263151497Sru<p> 264151497SruHowever, you may, at needs, want to add to <strong>mom</strong>'s 265151497Srulist of font styles. You can do this by editing the file, om.tmac. 266151497SruNear the top, you'll see lines of the form 267151497Sru<p> 268151497Sru<pre> 269151497Sru .sty \n[.fp] L \" Light Roman 270151497Sru .sty \n[.fp] LI \" Light Italic 271151497Sru .sty \n[.fp] LCD \" Light Condensed Roman 272151497Sru</pre> 273151497Sru 274151497SruSimply add your new font style by imitating what you see and 275151497Sruplugging in your new font style (having, of course, first created the 276151497Srufont, correctly named, in groff's PostScript font directory; see 277151497Sru<a href="#HOWTO">How to create a PostScript font for use with groff</a>). 278151497Sru<p> 279151497SruFor example, if you already have some fonts from the Univers 280151497Srufamily installed and have called the family UN, you might decide at 281151497Srusome point to add the Bold Outline font (UNBO). In which case, 282151497Sruyou'd add 283151497Sru<p> 284151497Sru<pre> 285151497Sru .sty \n[.fp] BO \" Bold Outline 286151497Sru</pre> 287151497Sru 288151497Sruto the <kbd>.sty \n[.fp] <font style></kbd> list in om.tmac. 289151497Sru<p> 290151497SruBe careful, though, that any styles you add do not conflict 291151497Sruwith <strong><u>family</u></strong> names that already exist. 292151497Sru"C", for example, conflicts with the Courier family 293151497Sru(CR, CI, CB, CI). Were you to create a font style "C", 294151497Sruthinking that <kbd>.FT C</kbd> would give you access to font style 295151497Sruonce you'd given a <kbd>.FAM(ILY)</kbd> directive, you'd get a nasty 296151497Srusurprise: your type would come out in Courier Roman! 297151497Sru<p> 298151497Sru<strong>VERY IMPORTANT NOTE: mom</strong>'s font extensions are 299151497Srunot "user-space" controllable via a macro. If you've 300151497Srubeen using groff for a long time, and have already rolled your own 301151497Srusolution to adding PostScript families, fonts, weights, shapes, etc. to 302151497Srugroff, you may find that <strong>mom</strong>'s font extensions 303151497Sruconflict with your own scheme. Should that be the case, comment out 304151497Sruthe <kbd>.sty \n[.fp] <font style></kbd> lines found near the 305151497Srutop of the om.tmac file. 306151497Sru 307151497Sru<a name="HOWTO"><h3><u>How to create a PostScript font for use with groff</u></h3></a> 308151497SruThese instructions aren't meant to cover all possibilities, merely 309151497Sruto present one way of making PostScript families/fonts available to 310151497Srugroff and <strong>mom</strong>. 311151497Sru<p> 312151497SruGNU/Linux distributions being what they are, directory locations may 313151497Srudiffer and the presence of some executables can't be guaranteed. 314151497SruI run a Debian system. The instructions reflect that. Users of 315151497Sruother distros will have to interpret them according to the way their 316151497Srudistro operates. 317151497Sru<p> 318151497SruWhat you need before you start: 319151497Sru<br> 320151497Sru<ul> 321151497Sru <li>groff, version 1.18 or higher 322151497Sru <br> 323151497Sru (Debian package: groff) 324151497Sru <li>a full installation of gs and associated tools 325151497Sru <br> 326151497Sru (Debian package: gs or gs-gpl) 327151497Sru <li>a library of gs fonts 328151497Sru <br> 329151497Sru (Debian package: gsfonts) 330151497Sru <li>a utility for converting TrueType fonts to Type1 fonts 331151497Sru <br> 332151497Sru (Debian package: ttf2pt1) 333151497Sru <li>a font manager 334151497Sru <br> 335151497Sru (Debian packages: defoma, psfontmgr, dfontmgr) 336151497Sru <li>perl 337151497Sru <br> 338151497Sru (Debian package: perl) 339151497Sru</ul> 340151497Sru<br> 341151497SruA reasonably complete installation of any major GNU/Linux distro 342151497Srushould already have these on your system, except perhaps for the 343151497Sruutility to convert TrueType fonts to Type1 fonts. 344151497Sru<p> 345151497SruInitial preparation (you only have to do this once): 346151497Sru<br> 347151497Sru<ol> 348151497Sru <li>If you don't already have one, create a directory in your 349151497Sru home directory to hold new fonts. Any directory name will do. 350151497Sru I use ~/Fonts, with subdirectories for Type1, TrueType and Groff 351151497Sru fonts. 352151497Sru<a name="SITE-FONT"></a> 353151497Sru <li>Locate the groff directory, site-font. The exact location is 354151497Sru difficult to predict, owing to differences between distros 355151497Sru and whether you're using a pre-packaged groff or have built 356151497Sru it from source. Some typical locations are 357151497Sru <br> 358151497Sru <ul> 359151497Sru <li>/usr/share/groff, 360151497Sru <li>/usr/local/share/groff 361151497Sru <li>/etc/groff 362151497Sru </ul> 363151497Sru <p> 364151497Sru If you can't find the site-font directory, locate 365151497Sru groff's site-tmac directory, and, as root, create site-font 366151497Sru in the same directory as the one that holds site-tmac. 367151497Sru E.g., if you find site-tmac in /usr/share/groff, create 368151497Sru site-font in /usr/share/groff. 369151497Sru <li>Locate the file <kbd><prefix>/font/devps/generate/textmap</kbd> 370151497Sru and symlink it to <kbd>textmap</kbd> in the directory that 371151497Sru contains your personal collection of PostScript fonts. (See the 372151497Sru <a href="#SMALL_NOTE">Small Note</a>, 373151497Sru above, for the meaning of <prefix>). On my system, 374151497Sru at the time of writing, <prefix> is 375151497Sru /usr/local/share/groff/1.19.2/, therefore, I symlink it in 376151497Sru ~/Fonts/Type1 with 377151497Sru <br> 378151497Sru <pre> 379151497Sruln -s /usr/local/share/groff/1.19.2/font/devps/generate/textmap textmap 380151497Sru </pre> 381151497Sru <li>Locate the file <prefix>/font/devps/text.enc and 382151497Sru symlink it to <kbd>text.enc</kbd> in your personal font 383151497Sru directory. On my system, in ~/Fonts/Type1 384151497Sru <pre> 385151497Sruln -s /usr/local/share/groff/1.19.2/font/devps/text.enc text.enc 386151497Sru </pre> 387151497Sru <li>Make sure you know which directory/ies holds your gs fonts. 388151497Sru You'll need the information later. On a Debian box, some 389151497Sru typical locations are 390151497Sru <br> 391151497Sru <ul> 392151497Sru <li>/usr/lib/ghostscript/fonts 393151497Sru <li>/usr/share/ghostscript/fonts 394151497Sru <li>/usr/share/fonts/type1/gsfonts 395151497Sru </ul> 396151497Sru</ol> 397151497Sru<br> 398151497SruFont creation/installation: 399151497Sru<br> 400151497Sru<ol> 401151497Sru <li>Acquire the font in either Type1 (.pfb) or TrueType 402151497Sru (.ttf) format. 403151497Sru <li>Place the font in your personal font directory; for me, 404151497Sru that's ~/Fonts/Type1 or ~/Fonts/TrueType. 405151497Sru <li>In your personal font directory, run one of the following: 406151497Sru <br> 407151497Sru <ul> 408151497Sru <li>For Type1 fonts 409151497Sru <br> 410151497Sru <ul> 411151497Sru <li><kbd>getafm fontfilename.pfb | gsnd - > fontfilename.afm</kbd> 412151497Sru <br> 413151497Sru For Type1 fonts, this will generate something called 414151497Sru an .afm (Adobe Font Metrics) file, which is 415151497Sru required to create PostScript fonts for groff. 416151497Sru </ul> 417151497Sru <li>For TrueType fonts 418151497Sru <br> 419151497Sru <ul> 420151497Sru <li><kbd>ttf2pt1 \-b fontfilename.ttf</kbd> 421151497Sru <br> 422151497Sru For TrueType fonts, this will generate a PostScript 423151497Sru .pfb file as well as an .afm file. 424151497Sru </ul> 425151497Sru </ul> 426151497Sru <li>Still in your personal font directory, run 427151497Sru <br> 428151497Sru <ul> 429151497Sru <li><kbd>afmtodit -e text.enc fontfilename.afm textmap GROFF_FONTNAME</kbd> 430151497Sru </ul> 431151497Sru <p> 432151497Sru Q: <em>How do I choose a GROFF_FONTNAME?</em> 433151497Sru <p> 434151497Sru A: Start by considering the 435151497Sru <a href="definitions.html#TERMS_FAMILY">family</a> 436151497Sru to which the font belongs. If you're adding to a family that 437151497Sru already exists in groff's <prefix>/font/devps 438151497Sru directory, that will be the first part of the font name. 439151497Sru (See 440151497Sru <a href="typesetting.html#FAMILY">here</a> 441151497Sru for a list of families already installed, along with their groff 442151497Sru names.) Add to that name the appropriate weight/style extension, 443151497Sru listed 444151497Sru <a href="#STYLE_EXTENSIONS">here</a>. 445151497Sru <p> 446151497Sru For example, if you're adding Helvetica Light Roman, your 447151497Sru GROFF_FONTNAME would be <strong>HL</strong>. If you're 448151497Sru adding Helvetica Light Italic, your GROFF_FONTNAME would be 449151497Sru <strong>HLI</strong>. 450151497Sru <p> 451151497Sru If you're adding a font not already in groff's PostScript 452151497Sru families, first choose a meaningful name for the 453151497Sru <a name="definitions.html#TERMS_FAMILY">family</a> 454151497Sru to which the font belongs. The name can be anything you like. If, 455151497Sru for example, the family is Garamond, you could choose GARAMOND, 456151497Sru GARA, GD, or even just plain G as the family name. Then tack on the 457151497Sru appropriate style/weight extension. Thus, if you were installing 458151497Sru Garamond Bold Condensed Italic and had chosen <strong>GD</strong> 459151497Sru as the family name for Garamond, your GROFF_FONTNAME would be 460151497Sru <strong>GDBCDI</strong>. 461151497Sru <p> 462151497Sru In <strong>mom</strong>, you can then access the Garamond 463151497Sru family with <kbd>.FAM GD</kbd>, and the Bold Condensed 464151497Sru Italic font wth <kbd>.FT BCDI</kbd>. 465151497Sru <p> 466151497Sru <strong>Note:</strong> The family name need not be in upper 467151497Sru case, and there's no limit to the length of the name. 468151497Sru "Garamond", for example, could be the name you 469151497Sru give the Garamond family. In fact, you might find it 470151497Sru preferable, since a) you wouldn't have to remember how 471151497Sru you'd named the family, and b) should you be scanning 472151497Sru your 473151497Sru <a href="#SITE-FONT">site-font directory</a>, 474151497Sru something like GaramondBCDI will be more meaningful than, 475151497Sru say, GDBCDI. 476151497Sru <li>Copy or move GROFF_FONTNAME to your 477151497Sru <a href="#SITE-FONT">site-font directory</a>, 478151497Sru or change to the site-font directory and make a symlink to 479151497Sru GROFF_FONTNAME in your personal directory. 480151497Sru <li>Copy or move the .pfb file to the directory that 481151497Sru holds your gs fonts, or change to that directory and make a 482151497Sru symlink to the .pfb file in your personal directory. 483151497Sru <li>Do whatever your system or distro requires in order to 484151497Sru register the new PostScript font (the .pfb file). On a 485151497Sru Debian system, as root, you can run dfontmgr for a 486151497Sru graphical interface that will take care of registering the 487151497Sru font. 488151497Sru</ol> 489151497Sru<p> 490151497SruWritten out in full, adding fonts looks like a lot of work. It 491151497Sruisn't. Basically, it's just: 492151497Sru<br> 493151497Sru<ul> 494151497Sru <li>acquire the font 495151497Sru <li>generate an .afm file for the font 496151497Sru <li>create the groff font 497151497Sru <li>put the groff font in <prefix>/font/devps 498151497Sru <li>make sure gs knows about the font 499151497Sru</ul> 500151497Sru<br> 501151497SruAfter you've done it a couple of times, it all makes sense, and is 502151497Srureally quite easy. Not to mention that once you understand the 503151497Sruprocess, you can write a bash script to automate the process. 504151497SruHere's an example, which you can adapt to your own needs. The 505151497Sruscript requires an argument (the .pfb filename), then prompts for 506151497Sruthe GROFF_FONTNAME. 507151497Sru<p> 508151497Sru<pre> 509151497Sru#! /bin/bash 510151497Sru 511151497Sru# A script for installing Type1 fonts. 512151497Sru# 513151497Sru# Builds .afm files from .pfb files, generates a groff font from the 514151497Sru# .afm file, makes a symlink in /usr/lib/ghostscript/font/ to the 515151497Sru# .pfb file, and a symlink in site-font to the groff font 516151497Sru 517151497Sru# .pfb filename, stripped of .pfb extension 518151497SruFONT=`basename $1 .pfb` 519151497Sru 520151497Sru# Directory holding my personal collection of type1 fonts 521151497SruFONTDIR="$HOME/Fonts/Type1" 522151497Sru 523151497Sru# Directory holding system ghostscript fonts 524151497SruGS_FONTDIR="/usr/lib/ghostscript/fonts" 525151497Sru 526151497Sru# Location of site-font/devps 527151497SruGROFF_SITE_FONTDIR="/usr/local/share/groff/site-font/devps" 528151497Sru 529151497Sru# Personal groff fonts directory 530151497SruGROFF_FONTS="$HOME/Fonts/Groff" 531151497Sru 532151497Sru# Symlinks to textmap and text.enc 533151497SruTEXTMAP="$FONTDIR/textmap" 534151497SruTEXTENC="$FONTDIR/text.enc" 535151497Sru 536151497Sruif [ ! `pwd` = "$FONTDIR" ] ; then 537151497Sru echo "Changing into $FONTDIR directory.." 538151497Sru cd $FONTDIR 539151497Sru sleep 1 540151497Sruelse 541151497Sru sleep 1 542151497Srufi 543151497Sru 544151497Sruecho -n "Groff name for this font: " 545151497Sruread FONTNAME 546151497Srusleep 1 547151497Sru 548151497Sruecho "Getting .afm.." 549151497Srugetafm $FONT.pfb | gsnd - > $FONT.afm 550151497Srusleep 1 551151497Sru 552151497Sruecho "Creating $FONTNAME.." 553151497Sruafmtodit -e $TEXTENC $FONTDIR/$FONT.afm $TEXTMAP $FONTNAME 554151497Srumv -i $FONTNAME $GROFF_FONTS 555151497Srusudo ln -s $GROFF_FONTS/$FONTNAME $GROFF_SITE_FONTDIR/$FONTNAME 556151497Srusleep 1 557151497Sru 558151497Sruecho "Linking $FONT in $GS_FONTDIR.." 559151497Srucd $GS_FONTDIR 560151497Srusudo ln -s $FONTDIR/$FONT.afm $FONT.afm 561151497Srusudo ln -s $FONTDIR/$FONT.pfb $FONT.pfb 562151497Srusleep 1 563151497Sru 564151497Sru# This next bit is Debian specific. If you're not running a 565151497Sru# Debian system, replace it with whatever your distro requires 566151497Sru# in order to register Type1 fonts. 567151497Sru 568151497Sruif [ !`pidof -x /usr/bin/dfontmgr` ] ; then 569151497Sru echo "I will now run dfontmgr so you can register the font." 570151497Sru exec sudo dfontmgr & 571151497Sruelse 572151497Sru echo "You may now register the font with dfontmgr." 573151497Srufi 574151497Sru</pre> 575151497Sru<hr> 576151497Sru 577151497Sru<!=====================================================================> 578151497Sru 579104862Sru<a name="CODENOTES"> 580104862Sru <h2><u>Some reflections on mom</u></h2> 581104862Sru</a> 582104862Sru 583104862Sru<p> 584104862Sru<strong>Mom</strong>, as a complete macro set, had her origins 585104862Sruin a "library" of groff routines I wrote over the 586104862Sruyears to handle various aspects of typesetting and document 587104862Sruprocessing that weren't adequately covered by ms, me, mm, and so 588104862Sruon. Typically, I'd use the library to cobble together macro 589104862Srusets for new challenges as they came my way. 590104862Sru<p> 591104862SruIf, as Eric Raymond asserts, open source begins with a programmer 592104862Sruscratching a personal itch, then <strong>mom</strong> can truly be 593104862Srucalled open source, even if, a mere humble set of macros standing on 594104862Sruthe shoulders of a giant named troff, she isn't programming at all. 595104862Sru<p> 596151497SruAs a writer living in a perpetual state of penury, all the computers 597104862SruI've ever owned have been hand-me-downs -- several generations 598104862Sruout-of-date and "resource challenged". Disk space has 599104862Srualways been an issue, as has processor speed and available RAM. 600151497SruOne of the reasons I run GNU/Linux is that it has helped enormously 601151497Sruto get the most out of my poor little boxes. (It has been pointed 602151497Sruout to me that NetBSD might be an even better choice of operating 603151497Srusystems for computers with limited resources.) 604104862Sru<p> 605104862SruIn Linux-land, the choice of typesetting systems basically comes down 606104862Sruto groff or TeX. Both are wonderful -- monumental achievements if you 607104862Sruask me -- and both have their own particular strengths. However, for 608104862Srupeople in my financial position (and there are millions of us around 609104862Sruthe globe, in both developed and developing countries), TeX and groff 610104862Sruhave one big difference: size. TeX is huge. Even its most ardent 611104862Srusupporters agree it suffers from bloat, on top of being complex and 612104862Sruunwieldy to manage. Groff is tiny by comparison, occupying minimal 613104862Srudisk space and having only a small memory footprint while at the same 614104862Srutime being flexible and powerful, typographically speaking. I've run 615104862Sruit successfully on a 386 with 8 megs of RAM and a 250 meg hard disk. 616104862Sru<p> 617104862SruHowever, groff has always had a liability: it's incredibly geeky. 618104862SruOwing to its very long history, it -- and its "power users" 619104862Sru-- have remained stuck in a time warp. Most common macro packages 620104862Srustill look as they did in those decades when memory was exorbitantly 621151497Sruexpensive and every byte mattered. Documentation -- not always 622104862Srueasy to find -- is written as if all readers are computer whizzes, 623104862Sruor at least have a university degree in one of the higher sciences. 624104862Sru<p> 625104862SruBy no means a stupid man, nor unfamiliar with the precepts of 626104862Sruprogramming, I've more than once torn my hair out over the terseness and 627104862Sruambiguity of groff's documentation. Making sense of certain primitives 628104862Sruhas often involved days of testing, interpreting the documentation 629104862Sruinstead of just using the primitive. 630104862Sru<p> 631151497Sru(ADDENDUM to the previous two paragraphs: A tremendous amount of 632151497Srueffort has gone into creating a groff manual that can be read with 633151497Sru"info," as well as creating truly useful man pages. The info 634151497Srumanual is clear and well-written, so my comments are actually out 635151497Sruof date. I leave them in for the benefit of groff newbies, who may 636151497Srustill find the documents a bit intimidating.) 637151497Sru<p> 638104862SruFor some time now, groff users and macro writers have had the 639104862Sruoption to use "long" names, yet have mostly chosen not to. 640104862SruWith long names, it's possible to create macro sets that are humanly 641104862Srureadable and easy to interpret, encouraging development and evolution. 642104862SruWhat's more, the macros themselves need not be terse, intimidating, 643104862Sruand easily forgotten 1- or 2-letter commands inserted in the body 644104862Sruof a document. They can be sensible and helpful to everyone, groff 645104862Srunewbies and old hands alike. 646104862Sru<p> 647104862Sru<strong>Mom</strong>'s macro file, om.tmac, uses long names, aliases, 648104862Sruand a host of other groff goodies that have become part of the 649104862Sruwhole groff picture under the unflagging guidance of groff's current 650104862Srumaintainer, Werner Lemberg. Nearly every macro, number register and 651151497Srustring is "recognizable" simply by its name. The file is 652104862Sruheavily commented. A consistent, if idiosyncratic, indenting style 653104862Sruis used as well, significantly improving readability. Anyone 654104862Sruwanting to futz around with <strong>mom</strong>'s macros should be 655104862Sruable to do so with a minimum of head scratching. 656104862Sru<br> 657104862Sru<hr> 658104862Sru 659104862Sru<!=====================================================================> 660104862Sru 661104862Sru<a name="CONTACT"> 662104862Sru <h2><u>Contact the author</u></h2> 663104862Sru</a> 664104862Sru 665104862Sru<p> 666104862SruIf you have any questions or comments about <strong>mom</strong>, 667104862Srusuggestions to make, criticisms to offer, or bugs to report, use the 668104862Srugroff mailing list at 669104862Sru<a href="mailto:groff@ffii.org">groff@ffii.org</a> 670104862Sru(subscription information available 671104862Sru<a href="http://ffii.org/mailman/listinfo/groff/">here</a>) 672104862Sruor contact me, Peter Schaffter, directly at 673151497Sru<i>peter@faustus.dyn.ca</i> 674151497Sruor 675151497Sru<i>ptpi@golden.net</i>. 676104862Sru 677104862Sru<p> 678151497SruPlease include the word "mom" or "groff" in the 679151497SruSubject: line of any message sent to my personal address, or you 680151497Srurisk the wrath of my implacable spam filters. :) 681151497Sru<p> 682151497SruIf you want to visit <strong>mom</strong>'s homepage, you'll find 683151497Sruit 684151497Sru<a href="http://faustus.dyn.ca/mom/mom.html">here</a>. 685151497Sru<p> 686104862Sru<hr> 687151497Sru<a href="reserved.html#TOP">Next</a> 688151497Sru<a href="macrolist.html#TOP">Prev</a> 689104862Sru<a href="#TOP">Top</a> 690104862Sru<a href="toc.html">Back to Table of Contents</a> 691104862Sru</body> 692104862Sru</html> 693