AknFontAccess Class Reference

API published in: S60 3rd Ed FP 1

Link against: uiklaf.lib avkon.lib fontutils.lib

Capability Information

Required Capabilities

None


#include <aknfontaccess.h>

Public Types

enum   TAknFontFamily { EAknFontFamilyNotSpecified = 0, EAknFontFamilySansSerif, EAknFontFamilySerif, EAknFontFamilyMonospace }
  Generic font family enumeration. More...

Static Public Member Functions

static IMPORT_C CFbsFont *  GetFont (CBitmapDevice &aBitmapDevice, const TFontStyle aFontStyle, TInt aFontSizeInTwips, TAknFontFamily aFontFamily)
  Returns a font that matches the metrics supplied.
static IMPORT_C CFbsFont *  GetFont (CBitmapDevice &aBitmapDevice, const TFontStyle aFontStyle, TInt aFontSizeInTwips, const TDesC &aFontFamilyName)
  Returns a font that matches the metrics supplied.
static IMPORT_C CFbsFont *  GetClosestFont (CBitmapDevice &aBitmapDevice, const TFontStyle aFontStyle, TInt aFontSizeInTwips, TAknFontFamily aFontFamily)
  Returns a font that matches the metrics supplied.
static IMPORT_C CFbsFont *  GetClosestFont (CBitmapDevice &aBitmapDevice, const TFontStyle aFontStyle, TInt aFontSizeInTwips, const TDesC &aFontFamilyName)
  Returns a font that matches the metrics supplied.
static IMPORT_C CAknLayoutFont CreateLayoutFontFromSpecificationL (CBitmapDevice &aBitmapDevice, const TAknFontSpecification &aSpec)
  Return a fully constructed CAknLayoutFont object based upon the specification passed in.
static IMPORT_C CAknLayoutFont CreateLayoutFontFromSpecificationL (CBitmapDevice &aBitmapDevice, const TTypeface &aTypeface, const TAknFontSpecification &aSpec)
  Return a fully constructed CAknLayoutFont object based upon the typeface and specification passed in.

Member Enumeration Documentation

enum AknFontAccess::TAknFontFamily
 

Generic font family enumeration.

These can be used in place of the family name descriptors

Enumerator:
EAknFontFamilyNotSpecified 
EAknFontFamilySansSerif 
EAknFontFamilySerif 
EAknFontFamilyMonospace 

Member Function Documentation

static IMPORT_C CAknLayoutFont* AknFontAccess::CreateLayoutFontFromSpecificationL CBitmapDevice &  aBitmapDevice,
const TTypeface &  aTypeface,
const TAknFontSpecification aSpec
[static]
 

Return a fully constructed CAknLayoutFont object based upon the typeface and specification passed in.

The TTypeface object contains a typeface name that is used as the primary key to select a font. The Series 60 font specifiation object is also used, but any value of TAknFontCategory passed in is reset to EAknFontCategoryUndefined, and is not used to select the font.

The font object is returned as non-const, since it is owned and will eventually be deleted by the client.

This method can only be used for TAknFontSpecification objects that are stored in Pixels (See TAknFontSpecification::Units() )

Parameters:
aBitmapDevice  Device for which the font is required (not used in 2.8; CEikonEnv::ScreenDevice() is used)
aTypeface  Symbian Typface object
aSpec  Series 60 font specification object
Returns:
pointer to a CAknLayoutFont object, owned by the caller
static IMPORT_C CAknLayoutFont* AknFontAccess::CreateLayoutFontFromSpecificationL CBitmapDevice &  aBitmapDevice,
const TAknFontSpecification aSpec
[static]
 

Return a fully constructed CAknLayoutFont object based upon the specification passed in.

The Avkon font specifiation object uses TAknFontCategory to determine the font.

The font object is returned as non-const, since it is owned and will eventually be deleted by the client.

This method can only be used for TAknFontSpecification objects that are stored in Pixels. (See TAknFontSpecification::Units() )

Parameters:
aBitmapDevice  Device for which the font is required (not used in 2.8; CEikonEnv::ScreenDevice() is used)
aSpec  Series 60 font specification object
Returns:
pointer to a CAknLayoutFont object, owned by the caller
static IMPORT_C CFbsFont* AknFontAccess::GetClosestFont CBitmapDevice &  aBitmapDevice,
const TFontStyle  aFontStyle,
TInt  aFontSizeInTwips,
const TDesC &  aFontFamilyName
[static]
 

Returns a font that matches the metrics supplied.

The provider can return a scaled or bitmap font as long as it meets the provided criteria. A best fit is used that is prioritized as follows: fontSize, fontStyle, fontFamily This will succeed as long as there is at least one font on the phone.

Parameters:
aBitmapDevice  Device for which the font will be requested
aFontStyle  of type TFontStyle. Use to set weight and posture of the font
aFontSize  Font size in twips.
aFontFamilyname  Font family is the text name of the font family and may be, for example: "courier", "helvetica", "times roman" etc. Font names are not case-sensitive.
Returns:
A font pointer. CBitmapDevice::ReleaseFont must be called to release the font resource on the device context when the font is no longer required. A font is always returned.
static IMPORT_C CFbsFont* AknFontAccess::GetClosestFont CBitmapDevice &  aBitmapDevice,
const TFontStyle  aFontStyle,
TInt  aFontSizeInTwips,
TAknFontFamily  aFontFamily
[static]
 

Returns a font that matches the metrics supplied.

The provider can return a scaled or bitmap font as long as it meets the provided criteria. A best fit is used that is prioritized as follows: fontSize, fontStyle, fontFamily This will succeed as long as there is at least one font on the phone.

Parameters:
aBitmapDevice  Device for which the font will be requested
aFontStyle  of type TFontStyle. Use to set weight and posture of the font
aFontSize  Font size in twips.
aFontFamily  Font is one of the following emumerations values: monospace, sansSerif, serif Note that serif and sansSerif are proportional fonts
Returns:
A font pointer. CBitmapDevice::ReleaseFont must be called to release the font resource on the device context when the font is no longer required. A font is always returned.
static IMPORT_C CFbsFont* AknFontAccess::GetFont CBitmapDevice &  aBitmapDevice,
const TFontStyle  aFontStyle,
TInt  aFontSizeInTwips,
const TDesC &  aFontFamilyName
[static]
 

Returns a font that matches the metrics supplied.

The provider can return a scaled or bitmap font as long as it meets the provided criteria. If an exact match isn't found than a null is returned.

Parameters:
aBitmapDevice  Device for which the font will be requested
aFontStyle  of type TFontStyle. Use to set weight and posture of the font
aFontSize  Font size in twips.
aFontFamilyname  Font family is the text name of the font family and may be, for example: "courier", "helvetica", "times roman" etc. Font names are not case-sensitive.
Returns:
A font pointer. CBitmapDevice::ReleaseFont must be called to release the font resource on the device context when the font is no longer required. If an exact match isn't found NULL is returned
static IMPORT_C CFbsFont* AknFontAccess::GetFont CBitmapDevice &  aBitmapDevice,
const TFontStyle  aFontStyle,
TInt  aFontSizeInTwips,
TAknFontFamily  aFontFamily
[static]
 

Returns a font that matches the metrics supplied.

The provider can return a scaled or bitmap font as long as it meets the provided criteria. If an exact match isn't found then a null is returned.

Parameters:
aBitmapDevice  Device for which the font will be requested
aFontStyle  of type TFontStyle. Use to set weight and posture of the font
aFontSize  Font size in twips.
aFontFamily  Font is one of the enumerations in TAknFontFamily Note that serif and sansSerif are proportional fonts
Returns:
A font pointer. CBitmapDevice::ReleaseFont must be called to release the font resource on the device context when the font is no longer required. If an exact match isn't found NULL is returned

The documentation for this class was generated from the following file:

Copyright © Nokia Corporation 2001-2008
Back to top