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<http://www.freetype.org/freetype2/docs/reference/ft2-glyph_management.html#FT_Glyph>to
FT_BitmapGlyph<http://www.freetype.org/freetype2/docs/reference/ft2-glyph_management.html#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.

regards


Maggy Anastasia
Singapore

On Wed, Jun 3, 2009 at 3:06 PM, Werner LEMBERG <[email protected]> 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
> glyph.]
>
> Exactly.  It is not possible to cache pixmaps with non-integer
> positions.  You would have to store 64 pixmaps for a single glyph
> otherwise!
>
> > 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.
>
>
>    Werner
>
_______________________________________________
Freetype mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/freetype

Reply via email to