[9fans] troff -man prints poorly - Plan9

This is a discussion on [9fans] troff -man prints poorly - Plan9 ; I've been writing a man page and wanted to see how it looks when formatted with troff and printed, so I tried: troff -man | dpost | lp only to find that the printout was extremely ugly. Words seem to ...

+ Reply to Thread
Results 1 to 10 of 10

Thread: [9fans] troff -man prints poorly

  1. [9fans] troff -man prints poorly

    I've been writing a man page and wanted to see how it looks
    when formatted with troff and printed, so I tried:
    troff -man | dpost | lp
    only to find that the printout was extremely ugly. Words seem
    to have run together in some very strange ways; if I had a scanner
    handy I could show what I mean. Anyway, the same thing happens
    when I do:
    troff -man /sys/man/1/cat | dpost | lp
    but not when I do:
    troff -ms /sys/doc/asm.ms | dpost | lp

    Am I missing something simple and fundamental, or is troff/dpost
    just broken?


    John


  2. Re: [9fans] troff -man prints poorly

    On Tue, Feb 26, 2008 at 7:22 PM, wrote:
    > I've been writing a man page and wanted to see how it looks
    > when formatted with troff and printed, so I tried:
    > troff -man | dpost | lp
    > only to find that the printout was extremely ugly. Words seem
    > to have run together in some very strange ways; if I had a scanner
    > handy I could show what I mean. Anyway, the same thing happens
    > when I do:
    > troff -man /sys/man/1/cat | dpost | lp
    > but not when I do:
    > troff -ms /sys/doc/asm.ms | dpost | lp
    >
    > Am I missing something simple and fundamental, or is troff/dpost
    > just broken?
    >


    I normally do:

    troff -ms bla.ms|lp -dstout| aux/download -H/sys/lib/postscript/font
    -mfontmat|lp -H -d printername
    and this works for me. What you describe seem to me what happens when
    I don't do the download
    and add the fonts to the postscript.

    I have never used dpost, and I don't know if it substitutes the aux/download...
    I donīt know if you were precisely trying to use dpost not to have to useit...

    HTH.
    --
    - curiosity sKilled the cat

  3. Re: [9fans] troff -man prints poorly

    troff -man /sys/man/1/cat | page

    troff -man /sys/man/1/cat | lp -dPrinter


  4. Re: [9fans] troff -man prints poorly

    > troff -man /sys/man/1/cat | page
    Looks good.

    > troff -man /sys/man/1/cat | lp -dPrinter

    Looks terrible.


  5. Re: [9fans] troff -man prints poorly

    > On Tue, Feb 26, 2008 at 7:22 PM, wrote:
    >> I've been writing a man page and wanted to see how it looks
    >> when formatted with troff and printed, so I tried:
    >> troff -man | dpost | lp
    >> only to find that the printout was extremely ugly. Words seem
    >> to have run together in some very strange ways; if I had a scanner
    >> handy I could show what I mean. Anyway, the same thing happens
    >> when I do:
    >> troff -man /sys/man/1/cat | dpost | lp
    >> but not when I do:
    >> troff -ms /sys/doc/asm.ms | dpost | lp
    >>
    >> Am I missing something simple and fundamental, or is troff/dpost
    >> just broken?
    >>

    >
    > I normally do:
    >
    > troff -ms bla.ms|lp -dstout| aux/download -H/sys/lib/postscript/font
    > -mfontmat|lp -H -d printername


    That has the same end result for me as just doing troff -man foo | lp

    John


  6. Re: [9fans] troff -man prints poorly

    lp is the most horrible shell script imaginable. The line
    for your printer in /sys/lib/lp/devices is supposed to help
    match the output of troff to the input your printer expects.
    There are people out there who know how to do this. I've long
    given up. I just generate postscript/pdf (below's the relevant
    piece of the mkfile) and print that.

    %.psQ: %.ms
    eval `{doctype $home/lib/macros.ms $stem.ms} | \
    lp -m.9 -dstdout >$target

    %.psQ: %.man
    eval `{doctype $home/lib/macros.ms $stem.man} | \
    lp -m.9 -dstdout >$target

    %.pdfQ: %.ps
    cat /sys/doc/docfonts $stem.ps >_$stem.ps
    ps2pdf _$stem.ps $stem.pdf && rm -f _$stem.ps

    # Useful in acme: mk document.show
    %.show:VQ: %.ps
    page -w $stem.ps

    %.ps: %.jpg
    jpg -t -9 $stem.jpg | lp -dstdout >$target


  7. Re: [9fans] troff -man prints poorly

    The problem most likely is the missing font informations. If you just use
    ``dpost -f'' (or the equivalent aux/download ... mentioned earlier) you
    should get just what you want. The reason the page display looks good is
    that you have access to the fonts as long as you don't leak the postscript
    outside a Plan 9 system.

    Martin

    * john@csplan9.rit.edu (john@csplan9.rit.edu) wrote:
    > I've been writing a man page and wanted to see how it looks
    > when formatted with troff and printed, so I tried:
    > troff -man | dpost | lp
    > only to find that the printout was extremely ugly. Words seem
    > to have run together in some very strange ways; if I had a scanner
    > handy I could show what I mean. Anyway, the same thing happens
    > when I do:
    > troff -man /sys/man/1/cat | dpost | lp
    > but not when I do:
    > troff -ms /sys/doc/asm.ms | dpost | lp
    >
    > Am I missing something simple and fundamental, or is troff/dpost
    > just broken?
    >
    >
    > John


  8. Re: [9fans] troff -man prints poorly

    /sys/lib/tmac.an (troff -man) loads the LucidaSans fonts:
    ..fp 1 R LucidaSans
    ..fp 2 I LucidaSansI
    ..fp 3 B LucidaSansB
    ..fp 5 L LucidaCW

    If you don't have those, some other font is substituted and that'll
    make your output look ugly.

    (/sys/lib/tmac.s (troff -ms) doesn't load fonts (defaults to Times roman)

    Sape


  9. Re: [9fans] troff -man prints poorly

    >> troff -ms bla.ms|lp -dstout| aux/download -H/sys/lib/postscript/font
    >> -mfontmat|lp -H -d printername

    >
    > That has the same end result for me as just doing troff -man foo | lp


    Yes, it would. However, if you spell fontmap right, it should work.
    Also the -H option is doing anything here -- that directory is already the default.

    cpu% troff -man /sys/man/1/cat | lp -dstdout | aux/download -mfontmat | wc
    849 2474 15261
    cpu% troff -man /sys/man/1/cat | lp -dstdout | aux/download -mfontmap |wc
    4337 7366 268301
    cpu%

    Russ


  10. Re: [9fans] troff -man prints poorly

    On Wed, Feb 27, 2008 at 4:54 PM, Russ Cox wrote:
    > >> troff -ms bla.ms|lp -dstout| aux/download -H/sys/lib/postscript/font
    > >> -mfontmat|lp -H -d printername

    > >
    > > That has the same end result for me as just doing troff -man foo | lp

    >
    > Yes, it would. However, if you spell fontmap right, it should work.
    > Also the -H option is doing anything here -- that directory is already the default


    upps. sorry it was a typo :-). The -H is probably because
    my default directory is broken, I am in an schizophrenic
    plan B/plan 9/paureas broken namespace/drawterm
    limbo where you cannot trust any default anymore.


    --
    - curiosity sKilled the cat

+ Reply to Thread