| ID | Creation date | March 28, 2008 | |
| Platform | S60 2nd Edition, S60 3rd Edition | Tested on devices | S60 3rd Edition FP1 SDK |
| Category | Python | Subcategory | UI |
| Keywords (APIs, classes, methods, functions): fonts |
This article provides information about the types of fonts used in PyS60.
import appuifw
print appuifw.available_fonts() #To display all available fonts, use this commands
This displays "Nokia Hindi S60", "Nokia Hindi TitleSmBd S6", "Series 60 ZDigi" as shown in the following figure.
The size and style of a font can be changed by the following code snippet and screenshot.
fnt=appuifw.Text()
fnt.font=u"Nokia Hindi S6016b" # sets font to Nokia Hindi S60 16 bold
The fonts can also have attributes like bold, italics and underlined. For example, setting bold fonts is shown in screenshot.
On a canvas, fonts are bit different. If you use their names as given by available_fonts(), these names must be in unicode format. More common names for the most used fonts are:
font='normal' # displays large text
font='title' # displays very large text
font='annotation' #or 'legend' or 'symbol' displays small text
font='dense' # displays slightly thinner text
If the font is not specified in canvas.text, the default font is used, which displays very small text.
Example:
canvas.text((20,20), u"Text here", font='normal')
#or
canvas.text((20,20), u"Text here", font=u"Nokia Hindi S6016b")
No related wiki articles found