Discussion:
[ft] sub pixel rendering does not work
newltf
2013-06-19 16:40:21 UTC
Permalink
I enable cleartype by uncomment macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING and
write follow :

FT_Load_Glyph(Face, glyph.FtIndex, FT_LOAD_TARGET_LCD);
FT_Render_Glyph(Face->glyph, FT_RENDER_MODE_LCD);

the font become very large that is descriped by the comment ¡°For example,
using FT_RENDER_MODE_LCD when calling */
/* FT_Render_Glyph still generates a bitmap that is 3 times wider than */
/* the original size in case this macro isn't defined;¡±

what is the problem?
Werner LEMBERG
2013-06-19 17:37:28 UTC
Permalink
Post by newltf
I enable cleartype by uncomment macro
FT_Load_Glyph(Face, glyph.FtIndex, FT_LOAD_TARGET_LCD);
FT_Render_Glyph(Face->glyph, FT_RENDER_MODE_LCD);
the font become very large that is descriped by the comment
“For example, using FT_RENDER_MODE_LCD when calling FT_Render_Glyph
still generates a bitmap that is 3 times wider than the original
size in case this macro isn't defined;”
what is the problem?
There is no problem. The horizontally enlarged pixmap must be folded
back into a `normal' pixmap by applying a proper color filter.
You've obviously missed this comment in the description of `FT_Render_Mode':

The LCD-optimized glyph bitmaps produced by FT_Render_Glyph can be
filtered to reduce color-fringes by using @FT_Library_SetLcdFilter
(not active in the default builds). It is up to the caller to
either call @FT_Library_SetLcdFilter (if available) or do the
filtering itself.


Werner

Loading...