views:

660

answers:

2

I want to change the font I am using in a CEikLabel on S60 device

I believe I can do the following

const CFont* aPlainFont = LatinPlain12();
aLabel->SetFont(aPlainFont);

where LatinPlain12 is one from this list..

Albi12
Alp13
Alpi13
Albi13
alp17
Alb17b
albi17b
alpi17
Aco13
Aco21
Acalc21
LatinBold12
LatinBold13
LatinBold17
LatinBold19 
LatinPlain12
Acb14
Acb30
Acp5

However, who can help me find out which ones from this list are fixed width.. Thanks :)

+1  A: 

You may use the FontViewer application to view and find out which of the fonts are proportional and fixed-width.

ayaz
I cannot install this onto my N95 from http://www.newlc.com/files/FontViewer-S60.sis - says 'Installation not supported' - I see from the screenshots though, Courier is available as a fixed width font.... do you know how to access it as a CFont type? Thanks ;)
adam
Adam, yes, I am afraid it won't work on version 3 and later phones. The SIS file only supports <= v2. I cannot at the moment tell you how to access the Courier CFont typeface, but I am playing with fonts these days. If and when I find something, I'll post back. :)
ayaz
A: 

Programatically, you can determine if a font is proportional using:

const CFont* myFont; 
// Initialize your font
// ....
TBool isProportional = (myFont->FontSpecInTwips().iTypeface.Attributes() & TTypeFace::EProportional);

BTW you might be better off enumerating the fonts on the device and/or using the logical font API than relying on the static font accessor functions.

KevinD