Public Group

# Proper font aspect ratio?

This topic is 4319 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I am creating a DirectX font in c++ with D3DXCreateFontIndirect and I can't get it to look quite right; it seems distorted no matter what. Can someone tell me what the proper width:height font aspect ratio I should be using? In case it matters, I am using Arial and Courier New fonts...

##### Share on other sites
I just use D3DXCreateFont but I'm assuming it works the same here:

hr = D3DXCreateFont( g_pD3DDevice,          // D3D device                         -18,               // Height                         0,                     // Width                         500,               // Weight                         0,                     // MipLevels                         FALSE,                 // Italic                         DEFAULT_CHARSET,       // CharSet                         OUT_DEFAULT_PRECIS,    // OutputPrecision                         DEFAULT_QUALITY,       // Quality                         DEFAULT_PITCH | FF_DONTCARE, // PitchAndFamily                         "Times New Roman",              // pFaceName                         &pD3DFont);        // ppFont

The width and height does not make much sense to me but it seems to work just fine.

##### Share on other sites
Interesting. So if I set one parameter to 0, it gets calculated automatically by the other... but when I retreive font description, it is still 0.

Nonetheless, it still looks a bit odd: the same line of text printed at different coordinates actually looks slightly different (for intsance, it is a wee bit more blurred and less crisp).

##### Share on other sites
Quote:
 Original post by KoobazaurNonetheless, it still looks a bit odd: the same line of text printed at different coordinates actually looks slightly different (for intsance, it is a wee bit more blurred and less crisp).

Sounds like anti-aliasing.

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

(You must login to your GameDev.net account.)

• 28
• 16
• 10
• 10
• 11
• ### Forum Statistics

• Total Topics
634113
• Total Posts
3015570
×