Why my D3D9 Font is poor quality

1.1k Views Asked by At

I have a question. I'm trying to draw on my screen with DirectX 9, but for some reason ALL fonts (which use rounded edges) that I try to use are in poor quality, this also includes fonts downloaded from the internet, I do not know if I'm doing anything wrong, or if I'm just paranoid about it.

Images:

2 fonts, Windows font and custom internet font

with 500x zoom: with 500x zoom

My create font code:

D3DXCreateFont(pDevice, 30, 0, FW_BOLD, 1, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Roboto", &pFont);

I've tried many things, like:

FW_BOLD to FW_SEMIBOLD
DEFAULT_QUALITY to ANTIALIASED_QUALITY

but nothing has shown result.

My DrawString function:

void D3D9Draw::String(int x, int y, DWORD Flag, int FontID, D3DCOLOR Color, std::string String, ...)
{
    char Buffer[256];

    va_list args;
    va_start(args, String);
    vsprintf_s(Buffer, String.c_str(), args);
    va_end(args);

    if (FontID >= (int)m_Font.size())
        FontID = 0;

    RECT Rect = { x, y, x, y };
    m_Font[FontID]->DrawText(NULL, Buffer, -1, &Rect, Flag | DT_NOCLIP, Color);
}

btw, sorry for my bad eng.

0

There are 0 best solutions below