freetype
[Top][All Lists]
Advanced

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

Re: FreeType 2 questions


From: David Turner
Subject: Re: FreeType 2 questions
Date: Fri, 14 Apr 2000 16:39:06 +0200

Hi Juliusz,

> 
> Dear all,
> 
> I've recently had a summary look at what needs to be done for a
> unified TrueType/Type 1 renderer for XFree86 based on FreeType 2.
> There are a few issues I didn't manage to work out.
> 

> First of all, there seems to be a problem with beta4.  At small sizes,
> there appears to be pixel dropout between curved parts of glyphs and
> vertical stems (typically in lowercase `a' and `d').  As this happens
> both for TrueType and Type 1 (in quite a few fonts), I believe this is
> a bug.  It only happens for non-AA glyphs.
> 
Yes, I know about this bug, and it seems a bit difficult to spot. Apparently,
there are differences both in the renderer and the bytecode interpreter (because
the vector normalisation function has been changed and produces slightly 
different
results for diagonals vectors..)

I have a few changes here that improve the situation, but no magic bullet.
I'll probably have to copy all the code from 1.x back to 2.0 (shouldn't be
too long), but I'd like to find a more elegant solution. Anyway, the final
release will not show these bugs..

> I'm aiming at not losing any functionality w.r.t. the current
> renderers, and so I need to do some font-format-specific processing.
> Given a face object, how do I determine the underlying font format?
>
For now, there is no direct support to retrieve the font format of a
given font. However, you can do something like this:

  /* init library, then.. */

  tt_driver = FT_Get_Driver( library, "truetype" );
  if (!tt_driver) Panic( "no truetype driver" );

  t1_driver = FT_Get_Driver( library, "type1" );
  if (!t1_driver) Panic( "no type1 driver" );

  ...

  error = FT_New_Face( ..... );
  if (error) Panic..

  if ( face->driver == tt_driver )
  {
    /* it's a TrueType font */
  }
  else if (face->driver == t1_driver )
  {
    /* it's a Type 1 font */
  }


> Given a face object that comes from a TrueType font, how do I access
> the individual TrueType tables (head, OS/2, post, hhea)?  Given a face
> object that comes from a Type 1 font, how do I access data from the
> font dictionary (font name, family name, copyright, etc.)?
> 
For now, there is no interface but it should be easy to add using
a procedural API "a la" FreeType 1.x. Which tables are you interested
in precisely ??

> On an unrelated note, could someone explain where the autohinter fits
> in?  Is it only for fonts devoid of any other hinting, or will it be
> applied to all fonts?
> 
The auto-hinter is capable of performing real-time auto-hinting for
a given font, only using the outlines found in it. It already works
with TrueType and Type 1 fonts..

It will be implemented as a pseudo-driver/module, and will be invoked
by the font drivers to hint a given face/glyph.. There are basically
two calls:

   - when a new font face is loaded, the hinter needs to compute global
     metrics from the unscaled data.

   - when loading a glyph, the hinter will grid-fit it.

For now, it is a stand-alone module that is implemented out of the
FreeType 2 tree. I hope to keep its design modular so that it could
be compiled standalone for inclusion in other things (like font creation
tools).

Typically, the auto-hinter will be used by the TrueType driver if the
bytecode interpreter isn't available. The Type 1 driver will also use
it.

Note that when used with poorly-hinter TrueType fonts (and there are
a lot of them out there), it tends to _improve_ the quality of glyphs
compared to the interpreted ones, especially with anti-aliasing..

Of course, if only it could do the same for Arial, Times, etc..

By the way, I have updated the type1 driver last week with a few lines
that improve the appearance of T1 text, in case you haven't tried it yet..

Best Regards,

- David


> Thanks,
> 
>                                         Juliusz Chroboczek



reply via email to

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