Re: [9fans] unexpected tabs in man pages after font change

2015-03-05 Thread Giacomo Tesio
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 quans...@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




Re: [9fans] unexpected tabs in man pages after font change

2015-03-05 Thread erik quanstrom
  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



Re: [9fans] unexpected tabs in man pages after font change

2015-03-05 Thread erik quanstrom
 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



[9fans] unexpected tabs in man pages after font change

2015-03-04 Thread Giacomo Tesio
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]


Re: [9fans] unexpected tabs in man pages after font change

2015-03-04 Thread Giacomo Tesio
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 giac...@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]



Re: [9fans] unexpected tabs in man pages after font change

2015-03-04 Thread Aram Hăvărneanu
On Wed, Mar 4, 2015 at 5:13 PM, Giacomo Tesio giac...@tesio.it wrote:

 why the hell we still use troff for manual pages?

What do you propose we use instead?

-- 
Aram Hăvărneanu



Re: [9fans] unexpected tabs in man pages after font change

2015-03-04 Thread Giacomo Tesio
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 ara...@mgk.ro:
 On Wed, Mar 4, 2015 at 5:13 PM, Giacomo Tesio giac...@tesio.it wrote:

 why the hell we still use troff for manual pages?

 What do you propose we use instead?

 --
 Aram Hăvărneanu




Re: [9fans] unexpected tabs in man pages after font change

2015-03-04 Thread Stanley Lieber
troff is great. easy to maintain programmatically.

sl



Re: [9fans] unexpected tabs in man pages after font change

2015-03-04 Thread Giacomo Tesio
2015-03-05 0:56 GMT+01:00 s...@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


Re: [9fans] unexpected tabs in man pages after font change

2015-03-04 Thread Giacomo Tesio
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 s...@9front.org:
 troff is great. easy to maintain programmatically.

 sl




Re: [9fans] unexpected tabs in man pages after font change

2015-03-04 Thread sl
 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