freetype-devel
[Top][All Lists]
Advanced

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

Re: [Devel] Adding options to the PS Hinter


From: Owen Taylor
Subject: Re: [Devel] Adding options to the PS Hinter
Date: Fri, 5 Jul 2002 13:26:54 -0400 (EDT)
User-agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/21.1

Keith Packard <address@hidden> writes:

> >    In all cases, more experimentation is needed and will be
> >    performed. It seems that we might be able to completely
> >    forget about this patent non-sense in a relatively short
> >    time.. Good, really good :-) !!
> 
> Have you started thinking about how to fix diagonal elements?  Seems like
> we could discover parallel edges in the glyph and integerize the distance
> between them so that the diagonals appeared the same size as an equivalent
> stem.  That's one of the most noticeable problems right now when dealing
> with gothic fonts.
> 
> A harder problem would be to retain the angular relationship between 
> diagonoal elements in glyphs; I've seen the autohinter do weird things
> with ¥ in some fonts.

In my observations (of the PS hinter, not the autohinter) there
are three main types of distortions of diagonal stems involved:

 a) darkening/lightening of diagonal and curved elements due to
    monitor gamma.

 b) quantizing horizontal and vertical stems and leaving diagonal
    stems untouched.

 c) Squashing or stretching of unhinted elements by moving
    adjacent control points. This is frequently very obvious
    in lowercase 's' and 'a'.

    Both integer stem quantizaton and stem alignment can cause
    this, but the effect is typically much stronger with
    integer stem quantization.


To fix b) you really need to do some sort of autohinting of
diagonal elements as you suggest.


My thought on c) is that the right thing to do would be
adjust the overall scale of the font so that if we are
thickening stems by 0.4 pixels, then we make both the 
x-height and cap-height 0.8 pixels taller. (There should
also be a horizontal expansion.)

Implementing this is is tricky. Possible idea:
  
 - First identify which blue zones are active with the
   original stem positions; if the overall expansion
   is 0.8 pixels, then move the top blue zone by 0.8 pixels
   and linearly interpolate from the distance from the
   bottom blue zone.

 - Do the same thing for the stem hints - move the top
   stem up by 0.8 pixels and linearly interpolate to 
   the bottom stem.

This doesn't really handle stems _beneath_ the baseline
right - e.g. something like a lowercase g. But it wouldn't
make them any worse.

This all is even approximately right only for Roman 
and related (cyrillic/greek) fonts. For CJK fonts you
need to take the counter hints into consideration.


For perhaps apparent reasons, I decided to look at not
quantizing stem widths instead.

Regards,
                                        Owen




reply via email to

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