Undocumented appuifw.Text() font method parameters

by Jouni Miettunen


Warning: ksort() expects parameter 1 to be array, object given in /home/croozeus/public_html/blogs/wp-content/plugins/yet-another-related-posts-plugin/includes.php on line 256

PyS60 1.4.4 manual briefly says (page 27) that the “font” method is used to set the font of the text. There are two possible ways to set this: 1) using supported Unicode font or 2) using font labels.

This is not quite true.

You can give font method three kind of parameters:

1) string: label of a font alias. ‘normal’, ‘annotation’ etc.

2) unicode: exact name of font to use.

3) tuple: font specification in the form (name, size, flags) or (name, size).

Some examples:

1) ‘annotation’, ‘title’, ‘legend’, ‘symbol’, ‘dense’, ‘normal’, ‘digital’. The last one is undocumented and seems to contain nice looking digital numbers.

2) u”LatinPlain12″, u”Series 60 Sans”, u”Nokia Sans S60″. Beware that fonts inside the phone depend on your phone variant. European phone has different fonts than for example Indian font, therefore you should not use any hardcoded font names.

3) This is where things get interesting. You can define text size and some style flags. Size is just a number and at least 0 and 300 seem to work just fine. Style flags are the same, which you can give to “style” method as parameter.

You can find some sample code in Font Test.

Enjoy,

–jouni

Related posts:

  1. Font Test v1.20 This is sample code for PyS60 (at least v1.4.5), presenting...
  2. MWS Talks on Croozeus.com ! That's Right ! We, the guys at Croozeus.com, are...
  3. PyS60 UI tutorials, part 1: Text and Canvas I've recently written some articles about UI controls on the...
  4. Testing List Performance Games quite often require list of lists i.e. matrixes to...
  5. Watch Me – Light Touch v1.00 Watch Me - Light Touch is a fun little application...

Related posts brought to you by Yet Another Related Posts Plugin.