[Top][All Lists]

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

Re: [ft] sub pixel positioning when Auto hinter and cache are used

From: Maggy Anastasia
Subject: Re: [ft] sub pixel positioning when Auto hinter and cache are used
Date: Wed, 3 Jun 2009 17:29:42 +0800

Thanks a lot Werner for the quick reply.

If I understand your point correctly so it is not possible for me to do sub pixel positioning by caching glyphs using FTC_SBitCache_Lookup().

So, my hope lies on FTC_ImageCache_Lookup().  I have not tried using this one and will try it.
Please correct me if I am wrong on how to do this.
So, using this function I will obtain the FT_Glyph object of the glyph I need. I need to cast it to FT_BitmapGlyph in order to get the bitmap buffer and the left and right side bearing.

If that's true, I have two other questions:
1. It is mentioned in the documentation that I can typecast an FT_Glyph to FT_BitmapGlyph if you have ‘glyph->format == FT_GLYPH_FORMAT_BITMAP’. My question is who decides the glyph->format, how to set the format of the out param of  FTC_ImageCache_Lookup() to be FT_GLYPH_FORMAT_BITMAP so that I can cast it to FT_BitmapGlyph ?

2. After being cast to FT_BitmapGlyph, the value of left and top is represented in 1/64th points? are they the hinted values or the non hinted values. If they are the hinted values, how to get the lsb_delta and rsb_delta.

Many thanks in advance. I apologize if somehow these questions have been answered before in the mailing list, I did search it on the mailing list before posting this and cannot find the solution to my problem yet.


Maggy Anastasia

On Wed, Jun 3, 2009 at 3:06 PM, Werner LEMBERG <address@hidden> wrote:

> I have a question on whether it is possible to perform sub pixel
> positioning when my system is using Auto Hinting and FreeType's
> cache subsystem.  If yes, I would be really keen to know how.  I
> need to perform text rendering that is fast (thus it requires cache
> to be activated), support sub pixel positioning and all glyphs are
> hinted.

You can cache glyph outlines using FTC_ImageCache.

> There is one problem with this which I know not yet how to solve,
> which is that FTC_SBit only return the metric values in pixels
> instead of in 1/64th points.

[In the following, I use `pixmap' for anti-aliased renderings of a

Exactly.  It is not possible to cache pixmaps with non-integer
positions.  You would have to store 64 pixmaps for a single glyph

> In addition to that, when we perform Auto hinting, we can't get the
> lsb_delta and rsb_delta of a glyph when FTC_SBitCache_Lookup() is
> used.

Well, since the sbit cache don't allow subpixel positioning, lsb_delta
and rsb_delta are always zero, so there's no need to cache them.


reply via email to

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