Jump to content
  • Advertisement
Sign in to follow this  

Can't change size of 3D font

This topic is 5417 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

Hello, I'm experimenting with 3d fonts but I can't seem to change the size of my font. I first create my font with CreateFont, but no matter what I put for height and width, the size always remains the same. Any suggestions?
// Create a font for the 3d text
HFONT hFont = CreateFont(0, 0, 
                         0, 0,
                         FALSE, FALSE, FALSE,
                         DEFAULT_PITCH | FF_DONTCARE,
// Get the device context
HDC hdc = CreateCompatibleDC( NULL );

// Use the font I just made and save the old one.
HFONT hFontOld = (HFONT)SelectObject(hdc, hFont); 

// Create the text mesh
if ( FAILED( D3DXCreateText( m_pD3DDevice,
                             "Test text",
                             NULL ) ) )             
    MessageBox( m_mainWindowHandle, "D3DXCreateText() failed.", "Error", MB_OK | MB_ICONEXCLAMATION );
    return( E_FAIL );

// Restore the old font
SelectObject(hdc, hFontOld);

DeleteObject( hFont );
DeleteDC( hdc );

// Clip...


[Edited by - Coder on September 17, 2004 2:35:49 AM]

Share this post

Link to post
Share on other sites
That's just what my code currently reads. I've changed the width and height to say 500, 500 but the text is still the same size.

Share this post

Link to post
Share on other sites
I thought about doing that. I was just wondering if I could do it the easier way of changing the height and width.

Share this post

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

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!