View Single Post
Old Feb 15th, 2008, 3:22 PM   #3
malavar
Newbie
 
Join Date: Apr 2006
Posts: 3
Rep Power: 0 malavar is on a distinguished road
Send a message via AIM to malavar
Re: determing whitespace to center text

Quote:
Originally Posted by Ancient Dragon View Post
If you use MFC there is a CDC c++ class that will help you with that centering. There is also the win32 api function TextOut() But you have to know where you want the text to start (x and y coordinates). That will depend on the font and font size being used. If you navigate through some of the links in MSDN you will probably find some example(s) you can use.
hey thanks for the reply, im using linux, i was hoping that there was a function in the standard library that comes with C++. its a pretty simple concept, and it is a console based application. sorry i didnt give enough information in the first place. i have a simple algorithm that centers it, but its based on a fixed width, i.e running it in a tty terminal it will be centered, but when running it in a gui based terminal i.e gnome terminal or kterm, it will not be centered.
malavar is offline   Reply With Quote