DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   C (http://www.daniweb.com/forums/forum118.html)
-   -   Calculate text bounding box size in pixels (http://www.daniweb.com/forums/thread159974.html)

rlp1938 Nov 29th, 2008 4:01 am
Calculate text bounding box size in pixels
 
I need to be able to calculate the size in pixels of a given piece of text from the font name and point size. Google has not turned up anything I can use as yet (or maybe understand). Clues anyone?

Bob

Ancient Dragon Nov 29th, 2008 10:58 am
Re: Calculate text bounding box size in pixels
 
Assuming you are using MS-Windows, you will probably find something in one of these Font and Text Functions.

rlp1938 Nov 29th, 2008 11:21 am
Re: Calculate text bounding box size in pixels
 
Quote:

Originally Posted by Ancient Dragon (Post 746935)
Assuming you are using MS-Windows, you will probably find something in one of these Font and Text Functions.

Sorry no, on a Linux system. Guess I should have said that at the beginning.

Ancient Dragon Nov 29th, 2008 11:34 am
Re: Calculate text bounding box size in pixels
 
I don't do linux but I do know it has several different gui apis, such as Motif, so you have to be more specific about which one you are using.

rlp1938 Nov 29th, 2008 12:29 pm
Re: Calculate text bounding box size in pixels
 
Gui api is X11.

d0pedup Dec 2nd, 2008 12:59 am
Re: Calculate text bounding box size in pixels
 
I think xruler might be of some help.
it can be found here


All times are GMT -4. The time now is 8:16 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC