You Are Here:

Community: Developer Discussion Boards

#1 Old Question Text size: height e width - 2007-01-28, 10:17

Join Date: Nov 2006
Posts: 17
oper6600
Offline
Registered User
Hi,

it is possible to determine the height and width of a text?

a=u'Text'

len(a) is 4

height (a) ?
width (a) ?

Tanks
Reply With Quote

#2 Old Re: Text size: height e width - 2007-01-28, 16:02

Join Date: Feb 2005
Posts: 1,353
Location: Belgium (Europe)
cyke64's Avatar
cyke64
Offline
Super Contributor
Quote:
Originally Posted by oper6600
Hi,

it is possible to determine the height and width of a text?

a=u'Text'

len(a) is 4

height (a) ?
width (a) ?

Tanks
I don't understand
Do you want character height and width of characters in pixels or characters number in a Text widget ?


pys60 1.4.5,1.9.7,pygame,PyS60 CE on E90 , N810 with Python 2.5.2 and ... last PyS60 1.9.7 with touch ui on 5800 !

pys60 extension modules on http://cyke64.googlepages.com/
Reply With Quote

#3 Old Re: Text size: height e width - 2007-01-28, 22:04

Join Date: Nov 2006
Posts: 17
oper6600
Offline
Registered User
Quote:
Originally Posted by cyke64
I don't understand
Do you want character height and width of characters in pixels or characters number in a Text widget ?
In pixel. Tanks
Reply With Quote

#4 Old Re: Text size: height e width - 2007-01-29, 10:30

Join Date: May 2006
Posts: 622
Location: Oulu, Finland
lfd
Offline
Super Contributor
Hi oper6600,

I'm not sure if there are methods to get the size (h and w) for a character for a specific font.

If you are trying to display some text on a canvas and that you are in the complex situation where you need to fit text on a canvas you can use akntextutils extension written by Simo Salminen . I ported it to 3rd edition and you can find it on my share http://students.oamk.fi/~dlefevre/th...dex.php/dlm/32

This extension wrap text to fit canvas screen by giving a width in pixels and a font. It returns an array of strings ready to be printed on the canvas.

I hope this help

LFD


Devices:
Nokia E61 3rd Edition - pys60 1.4.0

Tips and modules:
http://www.lfdm.net/thesis
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
Audio Input Stream on N80 tkaihock Symbian Media (Graphics & Sounds) 9 2006-06-30 10:15
how to set the text SIZE in rich text editor? decryptor Symbian User Interface 3 2005-10-01 20:08
Maximum size of text region? wftomas General Messaging 2 2005-04-01 09:10
Persist text value of user defined option in Enumerated Text Settings List leethomso Symbian User Interface 0 2004-11-24 19:49
Size of an Editor (Rich Text) khamael Symbian User Interface 0 2004-04-27 12:33

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia