Sign in to follow this  

font metrics with drawText()

Recommended Posts

Hi, so I'm working on a small GUI project with directx and for some controls such as textboxes I need to know the exact size a string will have when it is displayed. Currently I'm using LPD3DXFONT::drawText() in order to draw text. When I try to get the rectangle the text will display in by passing DT_CALCRECT, the rectangle is pretty inexact. Does anyone know how to get the exact size of displayed text? Thanks

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this