groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] gropdf(1) Has Ugly Thick Lines by Default.


From: Ralph Corderoy
Subject: [groff] gropdf(1) Has Ugly Thick Lines by Default.
Date: Sat, 28 Jul 2018 14:37:14 +0100

Hi,

Have prepared a page of tables and out of habit used -Tps piped into
ps2pdf(1), I realised I should switch to gropdf(1) but instantly noticed
the output was a lot more ugly;  enough to force me back.

    $ cat bug
    #! /bin/sh

    cat >line.tbl <<\E
    .TS
    l.
    _
    foo
    =
    .TE
    E

    tbl <line.tbl >line.tr

    groff -dpaper=a4 -Tps line.tr >line-grops.ps
    ps2pdf line-grops.ps

    groff -dpaper=a4 -Tpdf line.tr >line-gropdf.pdf

    qpdf -qdf line-grops.pdf line-grops.qdf
    qpdf -qdf line-gropdf.pdf line-gropdf.qdf
    $
    $ ./bug
    $

The horizontal lines in the table are much thicker with gropdf(1),
so much so they dominate instead of the text they demarcate.

I think tbl(1) draws them with the `\D' escape, that doesn't give a
thickness.

    $ grep '\\D' line.tr
    \v'.25m'\s[\n[3lps]]\h'|\n[3cd0]u'\D'l |\n[3cd1]u 0'\s0
    \v'.25m'\s[\n[3lps]]\v'-2p'\D'l |\n[TW]u 0'\v'2p'\h'|0'\D'l |\n[TW]u 0'\s0
    $

line-grops.ps has

    .4 LW                    % setlinewidth
    85.33 4.5 72 4.5 DL      % Draw line.
    /F0 10/address@hidden SF  % Set font.
    (foo)72 14 Q             % Show text.
    85.33 18.5 72 18.5 DL    
    85.33 20.5 72 20.5 DL    
    0 Cg                     % setgray
    EP                       % End page.

that ps2pdf turns into, as shown by qpdf(1), with my guesswork comments.

    q 0.1 0 0 0.1 0 0 cm  % Matrix, 10th scale?
    /R7 gs                
    4 w                   % Line width, equivalent to 0.4.
    1 J                   
    1 j                   
    0 G                   
    720.25 8374.25 m      % Move.
    853.25 8374.25 l      % Line.
    S                     % Stroke.
    0 g                   
    q                     
    10 0 0 10 0 0 cm      % Matrix, scale back up to 1.
    BT                    % Begin text.
    /R8 10 Tf             % Set font.
    1 0 0 1 72 827.89 Tm  % Matrix, move.
    (foo)Tj               % Show text.
    ET                    % End text.
    Q                     
    720.25 8234.25 m      % Move.
    853.25 8234.25 l      % Line.
    S                     % Stroke.
    720.25 8214.25 m      % Move.
    853.25 8214.25 l      % Line.
    S                     % Stroke.
    Q                     

gropdf's qdf next, I'll comment significant differences.

    q 1 0 0 1 0 0 cm        % No 10th scale.
    1 J                     % No setting line width, default 1?
    1 j                     
    0 g                     
    q                       
    BT                      % Begin text, two moves, but no text.
    1 0 0 1 72 840 Tm       
    0 Tc                    
    1 0 0 1 72 837.5 Tm     
    0 Tc                    
    0 g                     
    ET                      
    Q                       
    0 G                     
    72 837.5 m              % Coordinates differ, see below.
    85.33 837.5 l           
    s                       % Stroke, but `s' v. `S'.
    q BT                    
    1 0 0 1 85.33 837.5 Tm  % Redundant move?
    0 Tc                    
    /F5 10 Tf               
    1 0 0 1 72 828 Tm       
    0 Tc                    
    0 Tw (foo) Tj           
    1 0 0 1 72 823.5 Tm     
    0 Tc                    
    ET Q                    
    72 823.5 m              
    85.33 823.5 l           
    s                       
    q BT                    % Empty `Begin text'?
    1 0 0 1 72 823.5 Tm     
    /F5 10 Tf               
    0 Tc                    
    1 0 0 1 72 821.5 Tm     
    0 Tc                    
    ET Q                    
    72 821.5 m              
    85.33 821.5 l           
    s                       
    q BT                    % Empty `Begin text'?
    1 0 0 1 85.33 821.5 Tm              
    /F5 10 Tf                          
    0 Tc                               
    1 0 0 1 85.33 0.11099999999999 Tm  
    0 Tc                               
    ET Q                               
    Q                                  

Here's the grops coordinates of the three lines, multiplied up by ten.
The y-coordinates don't change for horizontal lines.

    72.025 837.425  85.325 +0
      ''   823.425    ''   +0
      ''   821.425    ''   +0

And gropdf's.

    72     837.5    85.33  +0
    ''     823.5      ''   +0
    ''     821.5      ''   +0

The difference, pdf-ps,

    -0.025 0.075  0.005

I think grops should copy grops's choice of default line width.
And the differences in coordinates seem odd.  Even if they're correctly
compensating for line-cap differences, should those differences exist?

-- 
Cheers, Ralph.
https://plus.google.com/+RalphCorderoy



reply via email to

[Prev in Thread] Current Thread [Next in Thread]