# Poor text rendering quality with freetype

This is my first time that I use freetype library and I think I've got some problems. Right now, I draw the bitmap generated by freetype, but the generated image is really low quality. I've been reading about hinting and anti-aliasing, but the thing is none of them helped me and the problem is still here.

Take a look at my picture:

You can actually see what I mean.

I have applied a vertical hinting before rendering in my font class:

float scale = 100.0f;
FT_Matrix transform =
{
(int)((1.0 / scale) * 0x10000L),
(int)((0.0) * 0x10000L),
(int)((0.0) * 0x10000L),
(int)((1.0) * 0x10000L)
};

FT_Set_Char_Size(this->mFace, 0, (int)(this->mSize * 64), (FT_UInt)(72 * scale), 72);
FT_Set_Transform(this->mFace, &transform, NULL);


FT_Load_Char(this->mpFont->Face(), this->mText[i], FT_LOAD_RENDER);


which is supposed to make the generated bitmap anti-aliased immediately as documentation has stated.

The part which I translate the buffer is here:

...
BYTE intensity = bitmap->buffer[q * bitmap->pitch + p];
D3DXCOLOR pixel(this->mColor.r * intensity,
this->mColor.g * intensity,
this->mColor.b * intensity,
this->mColor.a * intensity);

this->mpTexture->SetPixel(i, j, pixel);
...


My texture format is A8R8G8B8 and I don't think I have anything wrong with my texture rendering part. The only thing that I'm not sure this is related to is the resolution. Currently I'm using the window size (640x480) which turns to lower resolution for device because of borders. By the way, this is a regular Tahoma font that I've used.

• Well there is no FT_RENDER_MODE_DEFAULT. The version I use is 2.3.5 and I think you're mentioning the previous versions. FT_Load_Char will do the render and eliminates the use of FT_Render_Glyph. I'll try to modify my color properties, I think I'm painting transparent pixels opaque as well. – MahanGM Feb 12 '14 at 12:29
• I tried to change alpha value of pixel color, but there isn't any change. If I make it fully opaque, then there will be black background around the letters. I have to use intensity for transparency to get the image with right background and that doesn't change my words' shaped look, because in the dark background they still look the same. – MahanGM Feb 12 '14 at 12:54