Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!gatech!udel!princeton!phoenix!jay From: jay@phoenix.Princeton.EDU (Jay Plett) Newsgroups: comp.text Subject: Re: Questions about (di)troff Summary: how ditroff searches special fonts Message-ID: <6455@phoenix.Princeton.EDU> Date: 16 Feb 89 21:19:07 GMT References: <5800004@ugun21> <673@pcrat.UUCP> Organization: Princeton University, NJ Lines: 31 In article <673@pcrat.UUCP>, rick@pcrat.UUCP (Rick Richardson) writes: > Actually, ditroff searches the current font and then all of the > fonts which are marked special (in order) for the special characters. Close. Ditroff searches the current font, then all special fonts, then all regular fonts (starting with font 1), until it finds the character or exhausts the list of fonts. Example: say you have mounted fonts A B C D S T U, where S is the first special font. If the current font is C, then the search order is C, S, T, U, A, B, C, D. I've seen versions of ditroff which are clever enough to recognize that they needn't search C twice, but they still didn't quite get it right: they search C, S, T, U, A, B, C (or is it C, S, T, U, B, C, D? I forget). By the way, there's another gotcha in there. It's not "all of the fonts which are marked special". All fonts after the first special font are considered special. When ditroff reads DESC.out while starting up, it considers the first font which is marked as special to be the first of a list of special fonts. It doesn't care whether succeeding fonts are marked special or not. Example: your DESC file lists A B C D S R I B where "S" is special but R, I and B aren't. Surprise! Ditroff considers R, I and B to be special. What's worse, the code for .fp doesn't care whether a font is marked as special. But it does recognize the name "S" as the name of a special font and changes the beginning of the special fonts accordingly. What's even worse than that is what happens when you use .fp to mount *any* font on the position which contains the first special font. I'm running out of steam here, so I'll leave that one as an exercise for the reader (with the suggestion that you don't try it except as an experiment). ...jay@princeton.edu