9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] unexpected tabs in man pages after font change
@ 2015-03-04 16:13 Giacomo Tesio
  2015-03-04 17:11 ` Giacomo Tesio
  2015-03-04 21:31 ` Aram Hăvărneanu
  0 siblings, 2 replies; 12+ messages in thread
From: Giacomo Tesio @ 2015-03-04 16:13 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs


[-- Attachment #1.1: Type: text/plain, Size: 477 bytes --]

Hi, I've just installed a compact sans font (from
http://input.fontbureau.com/ ) and manual pages started to look broken.

As you can see in the screenshot (man 2 control), there are white spaces
that looks like tabs in the middle of the text with apparently no reason.
Even in the troff source (why the hell we still use troff for manual pages?
:-D) I can see no command that explain this behaviour.

Any tip to fix them?


Giacomo

[image: Immagine in linea 1]

[-- Attachment #1.2: Type: text/html, Size: 719 bytes --]

[-- Attachment #2: unexpected-man-tabs.png --]
[-- Type: image/png, Size: 42340 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [9fans] unexpected tabs in man pages after font change
  2015-03-04 16:13 [9fans] unexpected tabs in man pages after font change Giacomo Tesio
@ 2015-03-04 17:11 ` Giacomo Tesio
  2015-03-05 14:15   ` erik quanstrom
  2015-03-04 21:31 ` Aram Hăvărneanu
  1 sibling, 1 reply; 12+ messages in thread
From: Giacomo Tesio @ 2015-03-04 17:11 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs; +Cc: 9front


[-- Attachment #1.1: Type: text/plain, Size: 936 bytes --]

Interestingly enough the problem disappears with a mono font.

I suspect that troff is inserting such tabs instead of spaces when it
thinks they are the same. Indeed libframe (as far I could understand from
the manual and the sources) properly handles such variable width fonts.

Looks like I've to inform troff about the glyphs sizes... but how?


Giacomo

2015-03-04 17:13 GMT+01:00 Giacomo Tesio <giacomo@tesio.it>:

> Hi, I've just installed a compact sans font (from
> http://input.fontbureau.com/ ) and manual pages started to look broken.
>
> As you can see in the screenshot (man 2 control), there are white spaces
> that looks like tabs in the middle of the text with apparently no reason.
> Even in the troff source (why the hell we still use troff for manual
> pages? :-D) I can see no command that explain this behaviour.
>
> Any tip to fix them?
>
>
> Giacomo
>
> [image: Immagine in linea 1]
>

[-- Attachment #1.2: Type: text/html, Size: 1534 bytes --]

[-- Attachment #2: unexpected-man-tabs.png --]
[-- Type: image/png, Size: 42340 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [9fans] unexpected tabs in man pages after font change
  2015-03-04 16:13 [9fans] unexpected tabs in man pages after font change Giacomo Tesio
  2015-03-04 17:11 ` Giacomo Tesio
@ 2015-03-04 21:31 ` Aram Hăvărneanu
  2015-03-04 22:29   ` Giacomo Tesio
  1 sibling, 1 reply; 12+ messages in thread
From: Aram Hăvărneanu @ 2015-03-04 21:31 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Wed, Mar 4, 2015 at 5:13 PM, Giacomo Tesio <giacomo@tesio.it> wrote:
>
> why the hell we still use troff for manual pages?

What do you propose we use instead?

-- 
Aram Hăvărneanu



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [9fans] unexpected tabs in man pages after font change
  2015-03-04 21:31 ` Aram Hăvărneanu
@ 2015-03-04 22:29   ` Giacomo Tesio
  2015-03-04 22:39     ` Stanley Lieber
  0 siblings, 1 reply; 12+ messages in thread
From: Giacomo Tesio @ 2015-03-04 22:29 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Well... docx, obviously! :-D

Seriously, a markdown/asciidoc like language would be far easier to
write and update.
We could even compile it to troff, we we had to print it.

However, this is not a rant specific to plan9. Linux is not better
from this point of view.


Giacomo

2015-03-04 22:31 GMT+01:00 Aram Hăvărneanu <aram.h@mgk.ro>:
> On Wed, Mar 4, 2015 at 5:13 PM, Giacomo Tesio <giacomo@tesio.it> wrote:
>>
>> why the hell we still use troff for manual pages?
>
> What do you propose we use instead?
>
> --
> Aram Hăvărneanu
>



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [9fans] unexpected tabs in man pages after font change
  2015-03-04 22:29   ` Giacomo Tesio
@ 2015-03-04 22:39     ` Stanley Lieber
  2015-03-04 23:09       ` Giacomo Tesio
  0 siblings, 1 reply; 12+ messages in thread
From: Stanley Lieber @ 2015-03-04 22:39 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

troff is great. easy to maintain programmatically.

sl



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [9fans] unexpected tabs in man pages after font change
  2015-03-04 22:39     ` Stanley Lieber
@ 2015-03-04 23:09       ` Giacomo Tesio
  2015-03-05  0:02         ` Giacomo Tesio
  0 siblings, 1 reply; 12+ messages in thread
From: Giacomo Tesio @ 2015-03-04 23:09 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Well, while a bit offtopic... what do you mean by "programmatically".

And btw, programs don't write man pages... yet.


Giacomo

2015-03-04 23:39 GMT+01:00 Stanley Lieber <sl@9front.org>:
> troff is great. easy to maintain programmatically.
>
> sl
>



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [9fans] unexpected tabs in man pages after font change
  2015-03-04 23:09       ` Giacomo Tesio
@ 2015-03-05  0:02         ` Giacomo Tesio
  0 siblings, 0 replies; 12+ messages in thread
From: Giacomo Tesio @ 2015-03-05  0:02 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs, 9front


[-- Attachment #1.1: Type: text/plain, Size: 711 bytes --]

Hi, I've finally fixed the issue by adding the following line at the
beginning /rc/bin/man

fn col { builtin col -x $* }


Turn out that that the culprit was not troff, but col(1) that man uses as a
post processor.

Attached you can compare the versions with and without the fix.

This fix should works with any non-monospaced font.


Giacomo


2015-03-05 0:09 GMT+01:00 Giacomo Tesio <giacomo@tesio.it>:

> Well, while a bit offtopic... what do you mean by "programmatically".
>
> And btw, programs don't write man pages... yet.
>
>
> Giacomo
>
> 2015-03-04 23:39 GMT+01:00 Stanley Lieber <sl@9front.org>:
> > troff is great. easy to maintain programmatically.
> >
> > sl
> >
>

[-- Attachment #1.2: Type: text/html, Size: 1412 bytes --]

[-- Attachment #2: fix-man.png --]
[-- Type: image/png, Size: 110855 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [9fans] unexpected tabs in man pages after font change
  2015-03-04 17:11 ` Giacomo Tesio
@ 2015-03-05 14:15   ` erik quanstrom
  2015-03-05 15:22     ` Giacomo Tesio
  0 siblings, 1 reply; 12+ messages in thread
From: erik quanstrom @ 2015-03-05 14:15 UTC (permalink / raw)
  To: 9fans

> Interestingly enough the problem disappears with a mono font.
>
> I suspect that troff is inserting such tabs instead of spaces when it
> thinks they are the same. Indeed libframe (as far I could understand from
> the manual and the sources) properly handles such variable width fonts.
>
> Looks like I've to inform troff about the glyphs sizes... but how?

i don't use a mono font so i don't like your col -x solution, and this
works for me regardless.

if $font is set correctly, i believe all this should work out.  make sure
that $tabstop=acme tabstop as well.  the default for acme is 4, but
it is imported by $tabstop, and overridden with Tab.

cpu'ing can screw with your $font.

- erik



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [9fans] unexpected tabs in man pages after font change
  2015-03-05 14:15   ` erik quanstrom
@ 2015-03-05 15:22     ` Giacomo Tesio
  0 siblings, 0 replies; 12+ messages in thread
From: Giacomo Tesio @ 2015-03-05 15:22 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 1391 bytes --]

Which font are you using?
With all mono-spaced (fixed-width) fonts everything works fine. The problem
occurs just with  variable spaced fonts.

Btw I noted that the fix is not perfect: the table at the end of man(1) is
misaligned, with or without the fix. Even without calling col at all.

This could be due to troff assuming fixed with font and inserting spaces
instead of tabs. And its a pity, because  probably libframe would align
tabs properly.

But this is just a guess, I had no time to check the troff code for this
second issue.

Giacomo
Il 05/Mar/2015 15:23 "erik quanstrom" <quanstro@quanstro.net> ha scritto:

> > Interestingly enough the problem disappears with a mono font.
> >
> > I suspect that troff is inserting such tabs instead of spaces when it
> > thinks they are the same. Indeed libframe (as far I could understand from
> > the manual and the sources) properly handles such variable width fonts.
> >
> > Looks like I've to inform troff about the glyphs sizes... but how?
>
> i don't use a mono font so i don't like your col -x solution, and this
> works for me regardless.
>
> if $font is set correctly, i believe all this should work out.  make sure
> that $tabstop=acme tabstop as well.  the default for acme is 4, but
> it is imported by $tabstop, and overridden with Tab.
>
> cpu'ing can screw with your $font.
>
> - erik
>
>

[-- Attachment #2: Type: text/html, Size: 1780 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [9fans] unexpected tabs in man pages after font change
  2015-03-04 23:56 sl
  2015-03-05  0:17 ` Giacomo Tesio
@ 2015-03-05 14:10 ` erik quanstrom
  1 sibling, 0 replies; 12+ messages in thread
From: erik quanstrom @ 2015-03-05 14:10 UTC (permalink / raw)
  To: 9fans

> > And btw, programs don't write man pages... yet.
>
> Are you familiar with the conventions that power godoc?

i think what's being said here is that programs don't write the content.
without looking at godoc, i'm pretty sure that intended usage and the
context are going to be written by a human, even if the formatting is
done by a program.

- erik



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [9fans] unexpected tabs in man pages after font change
  2015-03-04 23:56 sl
@ 2015-03-05  0:17 ` Giacomo Tesio
  2015-03-05 14:10 ` erik quanstrom
  1 sibling, 0 replies; 12+ messages in thread
From: Giacomo Tesio @ 2015-03-05  0:17 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 493 bytes --]

2015-03-05 0:56 GMT+01:00 <sl@9front.org>:

> > And btw, programs don't write man pages... yet.
>
> Are you familiar with the conventions that power godoc?
>

No, but I know quite well it's predecessors (Docstrings, Javadoc etc...).

They are great for API, but IMHO not every unix man page can be generated
from code. They are a specialized kind of prose.

What I can't undestand I why we still need troff for them.

It's almost like using a teletype to chat! :-)


Giacomo

[-- Attachment #2: Type: text/html, Size: 941 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [9fans] unexpected tabs in man pages after font change
@ 2015-03-04 23:56 sl
  2015-03-05  0:17 ` Giacomo Tesio
  2015-03-05 14:10 ` erik quanstrom
  0 siblings, 2 replies; 12+ messages in thread
From: sl @ 2015-03-04 23:56 UTC (permalink / raw)
  To: 9fans

> Well, while a bit offtopic... what do you mean by "programmatically".

Programmatically = using a program.

If you arrange your troff sources in a thoughtful way, you can perform
changes using scripts or other programs without needing to stare at each
line of source individually. (I realize that not all man pages conform
to such a style). For example, changing all instances of bold text to
italic, without needing to hand-edit each instance manually. This is
the opposite of "what you see is all you get."


> And btw, programs don't write man pages... yet.

Are you familiar with the conventions that power godoc?

sl



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-03-05 15:22 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-04 16:13 [9fans] unexpected tabs in man pages after font change Giacomo Tesio
2015-03-04 17:11 ` Giacomo Tesio
2015-03-05 14:15   ` erik quanstrom
2015-03-05 15:22     ` Giacomo Tesio
2015-03-04 21:31 ` Aram Hăvărneanu
2015-03-04 22:29   ` Giacomo Tesio
2015-03-04 22:39     ` Stanley Lieber
2015-03-04 23:09       ` Giacomo Tesio
2015-03-05  0:02         ` Giacomo Tesio
2015-03-04 23:56 sl
2015-03-05  0:17 ` Giacomo Tesio
2015-03-05 14:10 ` erik quanstrom

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).