RSS Forums RSS

Calculate text bounding box size in pixels

Please support our C advertiser: Programming Forums
Reply
Posts: 3
Reputation: rlp1938 is an unknown quantity at this point 
Solved Threads: 0
rlp1938 rlp1938 is offline Offline
Newbie Poster

Calculate text bounding box size in pixels

  #1  
Nov 29th, 2008
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
AddThis Social Bookmark Button
Reply With Quote  
Posts: 13,871
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1231
Moderator
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is online now Online
Most Valuable Poster

Re: Calculate text bounding box size in pixels

  #2  
Nov 29th, 2008
Assuming you are using MS-Windows, you will probably find something in one of these Font and Text Functions.
Reply With Quote  
Posts: 3
Reputation: rlp1938 is an unknown quantity at this point 
Solved Threads: 0
rlp1938 rlp1938 is offline Offline
Newbie Poster

Re: Calculate text bounding box size in pixels

  #3  
Nov 29th, 2008
Originally Posted by Ancient Dragon View Post
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.
Reply With Quote  
Posts: 13,871
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1231
Moderator
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is online now Online
Most Valuable Poster

Re: Calculate text bounding box size in pixels

  #4  
Nov 29th, 2008
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.
Reply With Quote  
Posts: 3
Reputation: rlp1938 is an unknown quantity at this point 
Solved Threads: 0
rlp1938 rlp1938 is offline Offline
Newbie Poster

Re: Calculate text bounding box size in pixels

  #5  
Nov 29th, 2008
Gui api is X11.
Reply With Quote  
Posts: 14
Reputation: d0pedup is an unknown quantity at this point 
Solved Threads: 0
d0pedup d0pedup is offline Offline
Newbie Poster

Re: Calculate text bounding box size in pixels

  #6  
Dec 1st, 2008
I think xruler might be of some help.
it can be found here
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Other Threads in the C Forum
Views: 645 | Replies: 5 | Currently Viewing: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 12:32 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC