How many pixels per character width? 24 point.

Associate
Joined
18 Feb 2010
Posts
940
Ok, strange question.

We're doing a coursework in C/C++ where we have to use a set framework. So.. I have a font which is 24 point Cornerstone Regular.
I want to put this in the middle of the screen, I have a method to find the width of the window, divide it by 2 and the same for the height. Of course, this is the starting point of the text so this isn't what I'm after, as it now starts in the middle rather than IS in the middle.

So ok, I need to find how long my text is in pixels.
My text has 23 characters.
I guessed that would be 23*24 pixels if a point is a pixel = 552, so half that is 276 which I want to move to the left to centralise it.
No, that's too much ( it's moved left now of the center ).
I can pick and guess, until I get there ( I know it's near 400 ), but I would like a way to calculate it, if it's even possible?

How wide is a point?
 
Back
Top Bottom