* Re: mdocml: Accomodate for \f(Cx formatting. [not found] <201111061443.pA6EhE7Q011223@krisdoz.my.domain> @ 2011-11-12 22:40 ` Ingo Schwarze 2011-11-13 0:14 ` Kristaps Dzonsons 0 siblings, 1 reply; 3+ messages in thread From: Ingo Schwarze @ 2011-11-12 22:40 UTC (permalink / raw) To: tech Hi, the meaning of the "C*" font family is not "constant width" in general. Even in groff, its meaning is output-device dependent, and only a few devices support it: mainly -Tps and -Thtml, but not -Tascii or -Tdvi. Even in groff -Tps, its meaning isn't "constant width", but rather "Adobe Courier". There are many other -Tps families we do not support (A, BM, H, HN, N, P, T). Even when aiming for groff -Tps C* support only, this patch is incomplete, \f[CBI] is missing. Hence, i mildly disagree with this patch - but merged it anyway because it doesn't do that much harm. I do think, however, that any font escape except \fR \fI \fB \f1 \f2 \f3 \fP merits a warning that it's utterly non-portable both regarding different roff implementations and even regarding different output devices. I don't consider this an urgent matter at all, but thought i'd bring this up in case anybody has more thoughts on the subject... Yours, Ingo kristaps@mdocml.bsd.lv wrote on Sun, Nov 06, 2011 at 09:43:14AM -0500: > Log Message: > ----------- > Accomodate for \f(Cx formatting. Noted by Andreas Vogele, thanks! > > Modified Files: > -------------- > mdocml: > mandoc.c > roff.7 > > Revision Data > ------------- > Index: mandoc.c > =================================================================== > RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mandoc.c,v > retrieving revision 1.60 > retrieving revision 1.61 > diff -Lmandoc.c -Lmandoc.c -u -p -r1.60 -r1.61 > --- mandoc.c > +++ mandoc.c > @@ -369,8 +369,15 @@ out: > > switch (gly) { > case (ESCAPE_FONT): > - if (1 != rlim) > + /* > + * Pretend that the constant-width font modes are the > + * same as the regular font modes. > + */ > + if (2 == rlim && 'C' == *rstart) > + rstart++; > + else if (1 != rlim) > break; > + > switch (*rstart) { > case ('3'): > /* FALLTHROUGH */ > Index: roff.7 > =================================================================== > RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/roff.7,v > retrieving revision 1.33 > retrieving revision 1.34 > diff -Lroff.7 -Lroff.7 -u -p -r1.33 -r1.34 > --- roff.7 > +++ roff.7 > @@ -143,6 +143,8 @@ escape followed by an indicator: B (bold > (revert to previous mode). > A numerical representation 3, 2, or 1 (bold, italic, and regular, > respectively) may be used instead. > +The indicator or numerical representative may be preceded by C > +(constant-width), which is ignored. > .Pp > Examples: > .Bl -tag -width Ds -offset indent -compact -- To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: mdocml: Accomodate for \f(Cx formatting. 2011-11-12 22:40 ` mdocml: Accomodate for \f(Cx formatting Ingo Schwarze @ 2011-11-13 0:14 ` Kristaps Dzonsons 2011-11-14 16:11 ` Ingo Schwarze 0 siblings, 1 reply; 3+ messages in thread From: Kristaps Dzonsons @ 2011-11-13 0:14 UTC (permalink / raw) To: tech On 12/11/2011 23:40, Ingo Schwarze wrote: > Hi, > > the meaning of the "C*" font family is not "constant width" in general. > Even in groff, its meaning is output-device dependent, and only a few > devices support it: mainly -Tps and -Thtml, but not -Tascii or -Tdvi. > > Even in groff -Tps, its meaning isn't "constant width", but rather > "Adobe Courier". There are many other -Tps families we do not > support (A, BM, H, HN, N, P, T). Even when aiming for groff -Tps C* > support only, this patch is incomplete, \f[CBI] is missing. > > Hence, i mildly disagree with this patch - but merged it anyway > because it doesn't do that much harm. I do think, however, that > any font escape except \fR \fI \fB \f1 \f2 \f3 \fP merits a warning > that it's utterly non-portable both regarding different roff > implementations and even regarding different output devices. > > I don't consider this an urgent matter at all, but thought > i'd bring this up in case anybody has more thoughts on the > subject... Ingo, Hm, you have a good point. Maybe mention should be omitted from the manual to avoid encouraging this bad behaviour? And while yes, in principle warning about bad formatting tokens is a good idea -- there just so many of them! We should maybe warn when people are doing the correct thing. ;) Thoughts? (About the manual entry, of course...) Kristaps -- To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: mdocml: Accomodate for \f(Cx formatting. 2011-11-13 0:14 ` Kristaps Dzonsons @ 2011-11-14 16:11 ` Ingo Schwarze 0 siblings, 0 replies; 3+ messages in thread From: Ingo Schwarze @ 2011-11-14 16:11 UTC (permalink / raw) To: tech Hi Kristaps, Kristaps Dzonsons wrote on Sun, Nov 13, 2011 at 01:14:34AM +0100: > On 12/11/2011 23:40, Ingo Schwarze wrote: >> the meaning of the "C*" font family is not "constant width" in general. >> Even in groff, its meaning is output-device dependent, and only a few >> devices support it: mainly -Tps and -Thtml, but not -Tascii or -Tdvi. >> >> Even in groff -Tps, its meaning isn't "constant width", but rather >> "Adobe Courier". There are many other -Tps families we do not >> support (A, BM, H, HN, N, P, T). Even when aiming for groff -Tps C* >> support only, this patch is incomplete, \f[CBI] is missing. >> >> Hence, i mildly disagree with this patch - but merged it anyway >> because it doesn't do that much harm. I do think, however, that >> any font escape except \fR \fI \fB \f1 \f2 \f3 \fP merits a warning >> that it's utterly non-portable both regarding different roff >> implementations and even regarding different output devices. >> >> I don't consider this an urgent matter at all, but thought >> i'd bring this up in case anybody has more thoughts on the >> subject... > Hm, you have a good point. Maybe mention should be omitted > from the manual to avoid encouraging this bad behaviour? Yes, i think that is a good idea. We might accept \f(.[BIR123] and drop *any* middle character from it, in case people use \f(TB or \f(PI, but that's very low priority. Then again, such hacks will never be complete, and just dropping such escapes is fine with me, too. > And while yes, in principle warning about bad formatting tokens is a > good idea -- there just so many of them! Well, at some point i'll probably look into that, it can't be that hard. But it's not high priority either. Yours, Ingo -- To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-11-14 16:11 UTC | newest] Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <201111061443.pA6EhE7Q011223@krisdoz.my.domain> 2011-11-12 22:40 ` mdocml: Accomodate for \f(Cx formatting Ingo Schwarze 2011-11-13 0:14 ` Kristaps Dzonsons 2011-11-14 16:11 ` Ingo Schwarze
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).