You Are Here:

Community: Developer Discussion Boards

#1 Old font flags not working - 2008-12-09, 04:03

Join Date: Mar 2008
Posts: 127
jtullis
Offline
Regular Contributor
This code works fine:
Code:
    img.text((100,150), u"hello", fill = (0,0,0), font = (None,50))
    canvas.blit(img)
But this does not:
Code:
    img.text((100,150), u"hello", fill = (0,0,0), font = (None,50,FONT_BOLD))
    canvas.blit(img)
So what am I doing wrong?

1.4.5 doc - page 32 says:
A font can be speci_ed in three ways:
_ None, meaning the default font
_ a Unicode string that represents a full font name, such as u'LatinBold19'
_ a plain string symbolic name that refers to a font setting currently speci_ed by the UI framework
_ as a two or three element tuple, where
{ the _rst element is the font name (unicode or string) or None for default font
{ the second element is the font height in pixels or None for default size
{ the third (optional) element is the ags applied to the font or None for default options.

The ags are the following:
_ FONT_BOLD bold
Reply With Quote

#2 Old Re: font flags not working - 2008-12-09, 05:07

Join Date: Feb 2008
Posts: 743
Location: Belo Horizonte, Brazil
Send a message via Skype™ to Rafael T.
Rafael T.'s Avatar
Rafael T.
Offline
Forum Nokia Champion
Hi jtullis,

Well, FONT_BOLD is declared in graphics module, so you should assign it:

Code:
import graphics

img.text((100,150), u"hello", fill = (0,0,0), font = (None,50,graphics.FONT_BOLD))
canvas.blit(img)
Haven't tested it, but this seems obvious


Hope it helps,

Rafael.
Last edited by Rafael T. : 2008-12-09 at 05:36.
Reply With Quote

#3 Old Re: font flags not working - 2008-12-09, 09:50

Join Date: Nov 2008
Posts: 73
xiaobu
Offline
Regular Contributor
Quote:
Originally Posted by Rafael T. View Post
Hi jtullis,

Well, FONT_BOLD is declared in graphics module, so you should assign it:

Code:
import graphics

img.text((100,150), u"hello", fill = (0,0,0), font = (None,50,graphics.FONT_BOLD))
canvas.blit(img)
Haven't tested it, but this seems obvious


Hope it helps,

Rafael.
----------------------------
But why my 3230 didn't work either, even though I have done that?
Reply With Quote

#4 Old Re: font flags not working - 2008-12-09, 11:12

Join Date: Mar 2008
Posts: 127
jtullis
Offline
Regular Contributor
Correct - thank you Rafael.

Code:
    img.text((100,150), u"hello", fill = (0,0,0), font = (None,50,graphics.FONT_BOLD))
    canvas.blit(img)
I'm glad it was obvious for you, but for me I would never have figured that out from the pdf doc. Why can't they include a simple example usage of the flags? Or just add a sentence saying using graphics.flag ?

Is there a way for us to suggest examples to go in the pdf doc?

I have pasted the flags below in case someone searching in future needs help to do the same as me.

FONT_BOLD bold
FONT_ITALIC italic
FONT_SUBSCRIPT subscript
FONT_SUPERSCRIPT superscript
FONT_ANTIALIAS forces the font to be antialiased
FONT_NO ANTIALIAS forces the font to not be antialiased
Reply With Quote

#5 Old Re: font flags not working - 2008-12-09, 14:47

Join Date: Feb 2008
Posts: 743
Location: Belo Horizonte, Brazil
Send a message via Skype™ to Rafael T.
Rafael T.'s Avatar
Rafael T.
Offline
Forum Nokia Champion
Quote:
Originally Posted by jtullis View Post
Correct - thank you Rafael.

I'm glad it was obvious for you, but for me I would never have figured that out from the pdf doc. Why can't they include a simple example usage of the flags? Or just add a sentence saying using graphics.flag ?

Is there a way for us to suggest examples to go in the pdf doc?
Hi jtullis,

It is obvious because the Documentation is separated by modules, so all you see inside graphics module, should have graphics. in the front and this is valid for all the modules inside the PDF file


BR,

Rafael.
Reply With Quote

#6 Old Re: font flags not working - 2008-12-09, 15:22

Join Date: Nov 2008
Posts: 73
xiaobu
Offline
Regular Contributor
But why my 3230 didn't work either, even though I have done that?
Reply With Quote

#7 Old Re: font flags not working - 2008-12-09, 15:47

Join Date: Sep 2008
Posts: 36
mikezs
Offline
Registered User
Quote:
Originally Posted by xiaobu View Post
But why my 3230 didn't work either, even though I have done that?
There are limitations when using Image on 1st edition phones, so this is probably one of them.

There's a module called Image1st or something that should give the methods you need.
Reply With Quote

#8 Old Re: font flags not working - 2008-12-09, 16:41

Join Date: Feb 2005
Posts: 1,353
Location: Belgium (Europe)
cyke64's Avatar
cyke64
Offline
Super Contributor
Quote:
Originally Posted by mikezs View Post
There are limitations when using Image on 1st edition phones, so this is probably one of them.

There's a module called Image1st or something that should give the methods you need.
Yes you're right it's the image1st

BR
Cyke64


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

#9 Old Re: font flags not working - 2008-12-09, 17:26

Join Date: Mar 2008
Posts: 127
jtullis
Offline
Regular Contributor
OK I understand a bit better how to use the help doc now - thank you!

Also, is there a diagram of all the modules and their classes/functions etc, like a UML diagram?

Or do we always have to trawl through the help doc to find out the options?

Thanks again,
John

www.nottinghamjazz.co.uk
Reply With Quote

#10 Old Re: font flags not working - 2008-12-09, 18:01

Join Date: Feb 2008
Posts: 743
Location: Belo Horizonte, Brazil
Send a message via Skype™ to Rafael T.
Rafael T.'s Avatar
Rafael T.
Offline
Forum Nokia Champion
Quote:
Originally Posted by jtullis View Post
OK I understand a bit better how to use the help doc now - thank you!

Also, is there a diagram of all the modules and their classes/functions etc, like a UML diagram?

Or do we always have to trawl through the help doc to find out the options?

Thanks again,
John

www.nottinghamjazz.co.uk
I guess the official documentation is the best way for checking how to use the functions of a module

Also a good way is checking the Wiki Code Examples, which can also help you very much.


BR,

Rafael.
Reply With Quote

#11 Old Re: font flags not working - 2008-12-10, 09:27

Join Date: Nov 2008
Posts: 73
xiaobu
Offline
Regular Contributor
Quote:
Originally Posted by mikezs View Post
There are limitations when using Image on 1st edition phones, so this is probably one of them.

There's a module called Image1st or something that should give the methods you need.
May be,But I mean the 3230s are 2nd edition phones?
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
How to get the name of the used font chrishawaii Symbian User Interface 1 2007-06-22 07:55
Devenagri Unicode Font for Nokia 6600 gapata Series 40 & S60 Platform Feedback 1 2007-01-22 10:59
font file in use, how to uninstall kmsoomro General Symbian C++ 10 2007-01-10 09:57
Install font trouble address2 General Symbian C++ 0 2003-09-09 06:27
font problem lczgn Symbian 0 2003-05-19 05:00

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