Calculate text bounding box size in pixels

Reply

Join Date: May 2008
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

 
0
  #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
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 16,574
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: 1613
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: Calculate text bounding box size in pixels

 
0
  #2
Nov 29th, 2008
Assuming you are using MS-Windows, you will probably find something in one of these Font and Text Functions.
The most important thing in the Olympic Games is not to win but to take part, just as the most important thing in life is not the triumph but the struggle. The essential thing is not to have conquered but to have fought well.
-Pierre de Coubertin, The Olympic Creed Inspired by Bishop Ethelbert
Reply With Quote Quick reply to this message  
Join Date: May 2008
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

 
0
  #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 Quick reply to this message  
Join Date: Aug 2005
Posts: 16,574
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: 1613
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: Calculate text bounding box size in pixels

 
0
  #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.
The most important thing in the Olympic Games is not to win but to take part, just as the most important thing in life is not the triumph but the struggle. The essential thing is not to have conquered but to have fought well.
-Pierre de Coubertin, The Olympic Creed Inspired by Bishop Ethelbert
Reply With Quote Quick reply to this message  
Join Date: May 2008
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

 
0
  #5
Nov 29th, 2008
Gui api is X11.
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
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

 
0
  #6
Dec 1st, 2008
I think xruler might be of some help.
it can be found here
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the C Forum


Views: 733 | Replies: 5
Thread Tools Search this Thread



Tag cloud for C
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2010 DaniWeb® LLC