[pdftex] magic height 1.00376129150390625pt for coloring the rules

Hans Hagen pragma at wxs.nl
Sun Mar 3 22:08:40 CET 2002


At 10:23 PM 3/2/2002 +0100, Stanis³aw Romañski wrote:
>Hello,
>
>Is there something magic in the dimension 1.00376129150390625pt for pdfTeX ?
>The rules of smaller height seem not to be colorable (and the higher ones,
>yes).
>The simple code
>
>\pdfcompresslevel=0  \nopagenumbers
>\pdfliteral{0 0.4 0.1 0 k} % Pink
>\hbox{\vrule height 1.00376129150390625pt width 15pt depth 0pt}
>\hbox{\vrule height 1.003761291503906249999999999999pt width 15pt depth 0pt}
>\bye
>
>gives two rules: the upper is pink and the lower is set black. Why ?
>My tests show this does not depend on rule width; \hrule behaves the same
>way.
>I am using pdfTeX, Version 3.14159-14g-pretest-20000912 (Web2c 7.3.2.2)
>Any suggestions how to fix it or go around ?

The magic is in the following generated code:

a filled rectangle for small values

0 w
0 0 14.944 1 re

a line for larger values

1 w
0 0.5 m
14.944 0.5 l

this has to do with the fact that especially the older versions of acrobat 
viewers lines (actuallt all graphics) were drawn rather inaccurate, which 
was showing up quite well in areas were tex uses rules to construct 
symbols, like (square) roots. So, a few years ago, after quite some 
experiments, this mixed approach was implemented.

Since pdf distinguishes between fill and stroke colors, you need to specify 
both (K and K)

I think that this mixed solution should be looked into again, esp since 
acrobat 5 now does proper graphics (and antialiasing).

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma at wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                                   fall-back web server: 
www.pragma-pod.nl
-------------------------------------------------------------------------




More information about the pdftex mailing list