×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor
    Join Date
    Mar 2007
    Posts
    153

    self.img.text - how to set text style

    Hello Forum,
    i got a real beginners question.
    I still don't understand how to set the style of text on a background image.
    At the moment I use the following code to display text:
    Code:
    self.img.text((3, 40),u'Test ',0xffffff)
    I tried to change only the font by doing this:
    Code:
    self.img.text((3, 40),u'Test ',font=u'Albi17b')
    and it works fine.

    But how can I change the style?
    My guess was this:
    Code:
    self.img.text((3, 40),u'Test ',style=u'STYLE_BOLD')
    but this turned out to be incorrect.

    Can someone please give an example on how to change the style of my text?

    thx

  2. #2
    Super Contributor
    Join Date
    May 2006
    Location
    Oulu, Finland
    Posts
    622

    Re: self.img.text - how to set text style

    Hi novis,

    I checked the doc and source to be sure and it seams that it is not supported. It only accepts font and fill.

    LFD
    Devices:
    Nokia E61 3rd Edition - pys60 1.4.0

    Tips and modules:
    http://www.lfdm.net/thesis

  3. #3
    Regular Contributor
    Join Date
    Mar 2007
    Posts
    153

    Re: self.img.text - how to set text style

    Thx again lfd,
    i wanted to display text in bold letters. Now I'll try to find a different font.

  4. #4
    Super Contributor
    Join Date
    Dec 2004
    Posts
    643

    Re: self.img.text - how to set text style

    This is documented on page 31 of the PyS60 Library Reference.

    Do this:
    Code:
    self.img.text((3,40), u'Test', font=(None,None,FONT_BOLD))
    Yes, there are two ways to turn on bold, italic - one that's used in appuifw.Text and one that's used everywhere else. Yes, this is a bit confusing. If you want to save your trouble, use the FONT_xxx flags and not appuifw.Text style attributes.

  5. #5
    Regular Contributor
    Join Date
    Mar 2007
    Posts
    153

    Re: self.img.text - how to set text style

    Thx jplauril

Similar Threads

  1. CEikEdwin problem(plain text editor)
    By hossein_ashrafi in forum Symbian User Interface
    Replies: 3
    Last Post: 2007-04-17, 10:30
  2. how to set the SMS format PDU or text?
    By twosnowman in forum General Messaging
    Replies: 0
    Last Post: 2006-06-07, 15:15
  3. Reset Text to standard style
    By bercobeute in forum Symbian
    Replies: 2
    Last Post: 2006-01-06, 17:48
  4. Display global text object in upright style
    By dingdan in forum Symbian User Interface
    Replies: 2
    Last Post: 2004-08-12, 17:09
  5. how to set the message text in smtp mtm
    By siemensc55 in forum Symbian
    Replies: 4
    Last Post: 2004-07-19, 11:03

Posting Permissions

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