freetype-devel
[Top][All Lists]
Advanced

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

Re: FT2 and Ghostscript


From: David Turner
Subject: Re: FT2 and Ghostscript
Date: Wed, 01 Nov 2000 12:52:19 +0100

Hi Francesco,

I have very few time today, but I'll answer your post and CC: the
reply to the devel list, as I'm sure some people are interested
in this..

> 
> Hello,
> 
> I'm working on integrating FT2 into Ghostscript graphics library.
> 
> In a patch soon avaliable, the FreeType rasterizer (both flavours are
> working: monochrome and anti-aliased) fills a Type1 character path
> interpreted and hinted by Ghostscript.  The results when rendering on
> low resolution devices are quite impressive, especially when using the
> monochrome rasterizer.
> 
> This makes me wonder about replacing the whole Type1 Ghostscript code
> by FreeType (other formats might follow).
> 
> DT>    - I have started rewriting the native Type 1 hinter, but
> DT>      this will apparently need more work than I expected. I
> DT>      now tend to think that it'd be better to work on the
> DT>      auto-hinter instead, though I've not made up my mind.
> 
> I have performed several tests and currently I think that the hinting
> provided by FreeType and by Ghostscript are comparable.  If the
> hinting quality of FreeType will be uniformly better than what
> Ghostscript now provides, I will be eager to let FreeType do all the
> work related to font rendering.  As far as I have been able to see
> until now, native hinting is essential for high-quality font
> rendering at low resolution.
> 
> I am looking forward to learning about your plans.
> 

OK, i'll try to explain them in more details :

the auto-hinter's work is divided in two distinct but related tasks:

  - first, it must analyze a glyph outline in order to recognize
    specific features like stems, edges and serifs. What this
    pass does is really computing hints for the glyph.
    (it also tries to compute global hints / blue zones, by the way)


  - second, it tries to hint the outline for a given scale using
    the computed hints.


For now, the auto-hinter behaves badly with a number of Type 1 fonts,
and I still have a hard-time understanding exactly why.
I believe that there are weaknesses in both "feature detection" a
"glyph hinting", though of very different nature. There are probably
strange coupling effects I didn't figured out yet..

I have recently started working on major improvements to the algorithms
used in both tasks; graph theory is cool :-) Fortunately, the changes
are orthogonal, which means that it's possible to improve one task
independently of the other.

Given that I have now a much better idea of what a good hinting system
might be, I think it's possible to divide the interface of the
auto-hinter
in two parts.

 - one would be called to automatically compute hints for a given
font/glyph

 - the other, used to grid-fit a given glyph, from a set of hints
provided
   either by the auto-hinter itself, _or_ by the font driver.

What this would mean is, basically, the fact that Type 1 fonts will be
hinted
by the auto-hinter, using the _native_ hints provided in the font. This
is good
because it will also allow the hints in CFF fonts to be used.. A bit of
research
is needed otherwise to find a suitable internal format to represent the
hints provided by the three "hinters" available (auto,type1,cff), but
this
shouldn't be a great problem..

As I mentioned earlier, I could rewrite the T1 hinter completely but
this
task would take time that wouldn't be spent on improving the auto-hinter
too, and I want to improve the situation with all formats.

Note that it's still possible to improve the T1 driver to provide your
own
native hinting if you really need it fast. However, I have too few time
to
spend on this topic currently to deal with two hinting projects.. :-(

I'll try to set up the grid-fitting improvements first, as well as the
new internal auto-hinter API in order to easily plug T1 hints to it.
This also allows me to check that high-quality hints are properly
processed (drastically reducing the opportunity for coupling bugs)

Now, for a time frame, I hope something in the 2/3 months to get better
Type 1 hinting, given that I'm currently involved with other projects
in parallel..

Hope this helps,

- David



reply via email to

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