• Advertisement
Sign in to follow this  

Proper font aspect ratio?

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
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 this post


Link to post
Share on other sites
Quote:
Original post by Koobazaur
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).


Sounds like anti-aliasing.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement