[metapost] How to use a thinner pen?

Boguslaw Jackowski B_Jackowski at GUST.org.pl
Thu Jun 19 11:48:09 CEST 2008


I wrote:
> if for a given transformation the result comes out zero, the 
> relevant line will be displayed as a 1-pixel one;

That's true.

> the advantage is that 
> very thin lines never disappear, disadvantage -- that their optical 
> thickness can be misleading at low resolutions.

I thus suggested that the stroked lines in PS may disappear. It's wrong.

Right is Dan Luecking, writing:
> a PS renderer will paint any pixel that
> is touched by the pen. Probably PDF uses a similar rule

PostScript Language Reference (Section 7.5.1 Scan Conversion Rules):
and PDF Referene (section 6.5.3 Scan Conversion Rules) say:

    A shape is scan-converted by painting any pixel whose square region
    intersects the shape, no matter how small the intersection is. This
    ensures that no shape ever disappears as a result of unfavorable
    placement relative to the device pixel grid, as might happen with
    other possible scan conversion rules. The area covered by painted
    pixels is always at least as large as the area of the original shape.
    This rule applies both to fill operations and to strokes with nonzero
    width. Zero-width strokes are done in a device-dependent manner that
    may include fewer pixels than the rule specifies.

One-node (open) curves, however, may disappear (the PostScript Language 
Reference, the description of the `stroke command'):

    If a subpath is degenerate (consists of a single-point closed path or
    of two or more points at the same coordinates), `stroke' paints it
    only  if round line caps have been specified, producing a filled circle
    centered at the single point. If butt or projecting square line caps
    have been specified, `stroke' produces no output, because the
    orientation of the caps would be indeterminate. A subpath consisting
    of a singlepoint open path produces no output.

Nearly the same repeats the PDF Reference describing the `S' operator.

Cheers -- Jacko

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  Bogus\l{}aw Jackowski: B_Jackowski at GUST.ORG.PL
----------------------------------------------------------------
  Hofstadter's Law: It always takes longer than you expect, even
                    when you take into account Hofstadter's Law.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-




More information about the metapost mailing list