943,884 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 1081
  • C RSS
Nov 29th, 2008
0

Calculate text bounding box size in pixels

Expand Post »
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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
rlp1938 is offline Offline
3 posts
since May 2008
Nov 29th, 2008
0

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.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,952 posts
since Aug 2005
Nov 29th, 2008
0

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.
Sorry no, on a Linux system. Guess I should have said that at the beginning.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
rlp1938 is offline Offline
3 posts
since May 2008
Nov 29th, 2008
0

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.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,952 posts
since Aug 2005
Nov 29th, 2008
0

Re: Calculate text bounding box size in pixels

Gui api is X11.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
rlp1938 is offline Offline
3 posts
since May 2008
Dec 2nd, 2008
0

Re: Calculate text bounding box size in pixels

I think xruler might be of some help.
it can be found here
Reputation Points: 10
Solved Threads: 0
Newbie Poster
d0pedup is offline Offline
14 posts
since Dec 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: Random Choice
Next Thread in C Forum Timeline: UNIX Client and Server





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC