freetype
[Top][All Lists]
Advanced

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

[ft] Loading, Hinting and Rendering Without Translation


From: Mickey Gabel
Subject: [ft] Loading, Hinting and Rendering Without Translation
Date: Thu, 05 Jun 2008 14:13:02 +0300
User-agent: Thunderbird 2.0.0.14 (Windows/20080421)

If I understand the docs correctly:

1) Hinting is done during FT_Load_Glyph().
2) The hinting process only cares about current EM size and the fractional part of the current translation (assuming the current transform matrix is identity). 3) Rendering using FT_Glyph_To_Bitmap() receives a translation vector, but all it really cares about is the actual fractional part. Translation by integer amounts only affects the "left" and "top" values, and the actual rendered bitmap (size and contents) will be the same.

Putting this together, it seems that as long as I'm fine with integer translations, I don't ever need to use FT_Set_Transform() and FT_Glyph_Transform().

Assuming I am not trying for WYSIWYG, and don't care about rotation/shearing/etc, (but I do care about hinting, anti-aliasing and visual quality) is there some special reason for me to use FT for translation?

Here is my current pipeline that seems to work:

When loading:
        FT_Load_Glyph()
        FT_Get_Glyph()
        use glyph metrics to calculate pen position

When rendering:
        FT_Glyph_To_Bitmap()
        calculate bitmap origin from previous metrics
        copy the bitmap to origin on the destination image

Note that no FT transformation is done anywhere at all, I simply use whatever defaults FT2 starts with (I assume (0,0) and identity matrix).

Thanks,
        Mickey





reply via email to

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