Hi Deri, At 2024-10-11T00:06:10+0100, Deri wrote: > On Wednesday, 9 October 2024 16:33:21 BST G. Branden Robinson wrote: > > > If the warning was about the AT&T fontnames being deprecated but > > > no change to the font used (i.e. continue to use CR), even though > > > there would be 1000+ warnings, it would achieve your desire to > > > drop support for the ancient font names but in a way which did not > > > affect rendering of the document in the interim. > > > > What do you suggest instead? > > I tnought something like this:- > > diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp > index a087bc601..2dea476ce 100644 > --- a/src/roff/troff/env.cpp > +++ b/src/roff/troff/env.cpp > @@ -556,6 +556,8 @@ static node *configure_space_underlining(bool b) > return new device_extension_node(m, 1); > } > > +static char ATnTfonts[]="#AX|ABI#KR|BMR#KI|BMI#KB|BMB#KX|BMBI#C|CR#CW|CR#CO| > CI#CX|CBI#H|HR#HO|HI#HX|HBI#Hr|HNR#Hi|HNI#Hb|HNB#Hx|HNBI#NX|NBI#PA|PR#PX| > PBI#ZI|ZCMI#"; > + > bool environment::set_font(symbol nm) > { > if (line_interrupted) { > @@ -571,6 +573,17 @@ bool environment::set_font(symbol nm) > } > else { > prev_fontno = fontno; > + char cnm[8]="#"; > + strncat(cnm+1,nm.contents(),6); > + char *found=strstr(ATnTfonts,cnm); > + char *alias=found+strlen(cnm); > + > + if (0 != found && *alias++ == '|') { > + int alen=strcspn(alias,"#"); > + warning(WARN_FONT, "obsolete AT&T font names (such as '%1') have been > deprecated.", cnm+1); > + memset(found+1,32,alias-found+alen-1); > + } > + > int n = symbol_fontno(nm); > if (n < 0) { > n = next_available_font_position();
Well, yeah, that should do it. The technique seems sure to drive any snooty C++ object-oriented snobs screaming from the room. But that's not a bad thing. ;-) > Of course this is not a serious patch (although it works). I've never > dabbled in C++, I have not written anything in C for over 30 years, > and I don't have a very deep understanding of groff internals, Don't feel bad about that. The few who acquire such a thing, don't seem inclined to talk about it. 😅 > but it may give you an idea how deprecation of the AT&T font names > could be handled, rather than sudden removal. Yeah, the approach is super special-casey, which is not something I like as a rule. But, to move a deprecation along, as something for just one release cycle (please no more?), an expedient does not need to be elegant. > You can test by reinstating the .ftr requests and run a document using > the old font names. You should see a warning for each different > obsolete font used, rather than repeated message each time the font is > used. Yeah. A slightly simpler approach might be to revert the thicket of `ftr` removals from "ps.tmac", simplify `ATnTfonts` into a list, and do the lookup dynamically. That way we'd (1) still get the benefit of the traditional remappings without recapitulating them in GNU troff source, and (2) not override the preferences of people who remapped the old names to something else themselves. Someone who hated Bookman, for example, might have done this in a document (or "troffrc-end"). .ftr KR PR .ftr KI PI .ftr KB PB .ftp KX PBI We still want to warn them about their use of obsolete font names (and we would), but also would not harsh their Palatino mellow. Their document's rendering would not change. Someone raised a point like this recently, ISTR... That doesn't get us away from hard-coding the deprecation list in GNU troff for a release cycle. I don't see any way around that without a far more disruptive change, likely not worth the effort. So. One static list for One Bell System, coming up? > Anyway, you did ask, I'm sure you could do it better. Differently. Better? That would depend on who you asked. Anyone who stared down a blitz of 1,000+ font warnings and knew I was behind them might be disposed to judge any solution of mine...harshly. :P Regards, Branden
signature.asc
Description: PGP signature