Web Images Videos Maps News Shopping Gmail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Get the size in pixels for a string
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Stéphane Thibaudeau  
View profile  
 More options Mar 29 2006, 9:35 am
Newsgroups: comp.lang.ruby
From: "Stéphane Thibaudeau" <sthibaud...@sqli.com>
Date: 29 Mar 2006 06:35:37 -0800
Local: Wed, Mar 29 2006 9:35 am
Subject: Get the size in pixels for a string
Hi list !

Id like to know the width and height in pixels for a string given a
font family, size and style.
How could I do that ?

Thanks,
Stéphane.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Alfeld  
View profile  
 More options Mar 29 2006, 9:59 am
Newsgroups: comp.lang.ruby
From: "Chris Alfeld" <chris.alf...@gmail.com>
Date: Wed, 29 Mar 2006 23:59:33 +0900
Local: Wed, Mar 29 2006 9:59 am
Subject: Re: Get the size in pixels for a string
This is undoubtedly overkill, but:

require 'tk'

f = TkFont.new('Courier 10')
width = f.measure("Hi There!")
height = f.metrics.assoc('linespace')[1]


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google