The following example code demonstrates how to find the availability and details of typefaces in the font store.
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();
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);