Jump to content
  • Advertisement
Sign in to follow this  
chadmv

Can't change size of 3D font

This topic is 5149 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,
                         FW_NORMAL,
                         FALSE, FALSE, FALSE,
                         DEFAULT_CHARSET,
                         OUT_DEFAULT_PRECIS,
                         CLIP_DEFAULT_PRECIS,
                         DEFAULT_QUALITY,
                         DEFAULT_PITCH | FF_DONTCARE,
                         "Arial");
    
// 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,
                             hdc,
                             "Test text",
                             0.001f,
                             0.2f,
                             &m_pMesh,
                             NULL,
                             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...

m_pD3DDevice->BeginScene();
m_pMesh->DrawSubset(0); 
m_pD3DDevice->EndScene();

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

Share this post


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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!