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);
I'm loading the character with:
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.