Hello,
I have stumbled upon another problem when writing my gfx toolkit.
It seems like the quality D3DXSprite renders with is too bad.
My fonts are basically 256x256 textures containing all the ASCII characters.
As you can see in the picture below it is not precise enough.
As you can see the quality is not usable for drawing text at this time.
Does anyone have any ideas on how to improve the quality?
The original texture:
If you guys want my rather simple drawing function for the text:
Code:
HRESULT TextRenderer::DrawStrokedText( char *text, int x, int y, DWORD color )
{
FVEC2 currentPos = {(float)x, (float)y};
for(int i = 0; text[i]; i++)
{
RECT bounds;
bounds.left = (text[i] % 16)*16; // 16 characters per row
bounds.top = text[i] & 0xF0; // 16 rows
bounds.right = bounds.left + 16;
bounds.bottom = bounds.top + 16;
m_pGFXToolkit->DrawSprite(IDB_CONSALAS_STROKED, ¤tPos, &bounds, color);
currentPos.x += m_fontWidths[text[i]]+3;
}
return S_OK;
} It is only a prototype of the TextRenderer class I am making so some stuff is hardcoded. (Like resolution of texture, and character spacing)
Would using primitves and textures directly have any effect on the quality?