freetype-devel
[Top][All Lists]
Advanced

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

[ft-devel] Hinting: inconsistency with multiple IUP instructions


From: Marcin 'Qrczak' Kowalczyk
Subject: [ft-devel] Hinting: inconsistency with multiple IUP instructions
Date: Wed, 08 Aug 2007 23:10:34 +0200

Freetype has a weird inconsistency when the IUP instruction is used
several times with the same direction.

IUP, as implemented by freetype, does the following for each contour:

- If it contains no touched points, do nothing.

- If it contains exactly one touched point, set the current position of
  untouched points to their *current* position shifted by the distance
  between the current and the original position of the touched point.

- If it contains more touched points, interpolate the *original*
  position of untouched points based on the relation between the
  current and the original position of the surrounding touched points
  (interpolation has separate cases depending on the ordering of the
  three points under consideration, doesn't matter here).

IUP has a rare property that it may leave some points with their current
position different from their original position but marked as untouched.

If IUP is invoked a second time, contours with no touched points and
contours with more than one touched point stay unchanged. But contours
with only one touched points are shifted again, because IUP considers
the *current* position of untouched points.

I don't know if this was intended or how other renderers behave.
I'm pretty sure that it would be more logical to use the original
position instead of the current position in the case of contours with
a single touched point, thus making it consistent with other kinds of
contours. It's definitely easier for font developers if they could rely
on the ability to invoke IUP, then move some points, then invoke IUP
again. I don't know whether any font relies on the current behavior,
but I doubt it because it's unhelpful.

Microsoft documentation says the following:

"The IUP instruction does not touch the points it moves. Thus the
untouched points affected by an IUP instruction will be affected by
subsequent IUP instructions unless they are touched by an intervening
instruction. In this case, the first interpolation is ignored and the
point is moved based on its original position."

This is not quite clear: the beginning seems to imply the current
behavior, but the last sentence suggests the fixed behavior.

What do you think?

-- 
   __("<         Marcin Kowalczyk
   \__/       address@hidden
    ^^     http://qrnik.knm.org.pl/~qrczak/





reply via email to

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