Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



How to use typefaces

The following example code demonstrates how to find the availability and details of typefaces in the font store.


Find what typefaces are available

You can use NumTypefaces() to find out what typefaces are available in the font store (from the current graphics device):

// Find the number of typefaces
iNumTypefaces = iCoeEnv->ScreenDevice()->NumTypefaces();

[Top]


Find details of a particular typeface

You can find details of a particular typeface and create a font specification object, TFontSpec. You can then use the TFontSpec to request the closest available font.

// Find the font to display
TTypefaceSupport myTypefaceSupport;
iCoeEnv->ScreenDevice()->TypefaceSupport(myTypefaceSupport,0);
iCurrentFont = myTypefaceSupport.iTypeface.iName.Des();
...
// Set up absolute font-spec and text box for 300 twips height
TFontSpec fontSpec(iCurrentFont,300);