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

Re: Another technical question about arrow-building



>Normally, dvi drivers shouldn't compensate for digitization errors
>between glyphs which have no space or kerning between them, but if
>the actual position (in pixels) is off from the ideal position by
>more than maxdrift (a parameter which is usually set to 2 pixels),
>then they should.  

There may yet be hope then, assuming the dvi driver never gets more
than two pixels out when setting a small arrow, which seems like a
reasonable assumption!  There may be more than two pixels drift on a
large arrow, but then the asymmetry won't be noticable.

>However, the tfm width will remain
>the same, so the arrows which you build may come out asymmetric even if
>the dvi driver hasn't adjusted for drift between the pieces.

I was planning to use a slightly more cunning design of the glyphs:

   *           **       *
  *           **         *
 ********    **    ********
  *         **           *
   *       **           *

--------            --------

Note that:

1) There's an overshoot at the right of the <leftarrowhead> and at the
left of the <rightarrowhead>.

2) The <arrownegation> has zero width, and is rotationally symmetric.

So when we plug them together, we get:

   *     ** *
  *     **   *
 **************
  *   **     *
   * **     *

----------------

OK, that works when the slash is of even width, what if it's of odd
width?  Well, this means that the whole arrow is going to have to be
an odd number of pixels long, and that's going to be impossible if
<leftarrowhead> and <rightarrowhead> are mirror images.  So we need to
shift one of them by one pixel, to get:

   *           *       *
  *           *         *
 ********    *    ********
  *         *           *
   *       *           *

--------            --------

Note that:

1) <arrowheadright> has been shifted left by one pixel.

2) <arrownegation> is no longer rotationally symmetrical, since it has
a pixel to the left of its origin, but no pixel to the right.

So when we plug them together, we get:

   *     * *
  *     *   *
 *************
  *   *     *
   * *     *

----------------

Whew, what a lot of work!

Summary: assuming no drift, you can get symmetric composite glyphs, as
long as:

1) If the negation pen is an even number of pixels wide, the left and
right arrowheads are mirror images.

2) If the negation pen is an odd number of pixels wide, one of the
arrowheads is shifted horizontally by one pixel.

Mind you, I'm not sure that all this effort is worth it...

Alan.