CFbsTypefaceStore Class Reference

class CFbsTypefaceStore : public CTypefaceStore

Font and bitmap server typeface store.

Inherits from

Public Member Functions
~CFbsTypefaceStore()
IMPORT_C TIntAddFile(const TDesC &, TInt &)
IMPORT_C TGlyphBitmapTypeDefaultBitmapType()
IMPORT_C TIntFontHeightInPixels(TInt, TInt)
IMPORT_C TIntFontHeightInTwips(TInt, TInt)
IMPORT_C TIntGetFontById(CFont *&, TUid, const TAlgStyle &)
IMPORT_C voidGetLinkedTypefaceL(CLinkedTypefaceSpecification &)
IMPORT_C TIntGetNearestFontInPixels(CFont *&, const TFontSpec &)
IMPORT_C TIntGetNearestFontInTwips(CFont *&, const TFontSpec &)
IMPORT_C TIntGetNearestFontToDesignHeightInPixels(CFont *&, const TFontSpec &)
IMPORT_C TIntGetNearestFontToDesignHeightInTwips(CFont *&, const TFontSpec &)
IMPORT_C TIntGetNearestFontToMaxHeightInPixels(CFont *&, const TFontSpec &, TInt)
IMPORT_C TIntGetNearestFontToMaxHeightInTwips(CFont *&, const TFontSpec &, TInt)
IMPORT_C TIntInstallFile(const TDesC &, TInt &)
IMPORT_C CFbsTypefaceStore *NewL(CGraphicsDevice *)
IMPORT_C TIntNumTypefaces()
IMPORT_C TIntRegisterLinkedTypeface(const CLinkedTypefaceSpecification &, TInt &)
IMPORT_C TIntRegisterLinkedTypeface(const CLinkedTypefaceSpecification &)
IMPORT_C voidReleaseTwipsCache()
IMPORT_C voidRemoveFile(TInt)
IMPORT_C voidRemoveFontFileLocksL()
IMPORT_C voidRemoveFontFileLocksL(const TDesC &, TBool)
IMPORT_C voidRemoveFontFileLocksL(const TDesC &)
IMPORT_C voidSetDefaultBitmapType(TGlyphBitmapType)
IMPORT_C voidSetDefaultLanguageForMetrics(TLanguage)
IMPORT_C voidSetFontNameAliasL(const TDesC &, const TDesC &)
IMPORT_C voidSetSystemDefaultTypefaceNameL(const TDesC &)
IMPORT_C voidTypefaceSupport(TTypefaceSupport &, TInt)
IMPORT_C TIntUpdateLinkedTypeface(const CLinkedTypefaceSpecification &)
Private Member Functions
CFbsTypefaceStore(CGraphicsDevice *)
voidConstructL()
TInt CreateFont(CFont *&, const TFontInfo &)
TInt FontHeight(TInt, TInt, TInt)
TInt GetNearestFontInTwipsAndCreateFont(CFont *&, TInt, const TFontSpec &, TInt)
voidGetPixelSizeInTwips(TSize &)
TBool IsFontLoaded(CFont *&, const TFontInfo &)
TInt SendGetNearestFontCommandNCreateFont(CFont *&, TInt, const TFontSpec &, TInt)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
CTypefaceStore::AddFontL(CFont *)
CTypefaceStore::BaselineOffset(TInt,TFontPrintPosition)
CTypefaceStore::CTypefaceStore()
CTypefaceStore::IncrementFontCount(const CFont *)
CTypefaceStore::ReleaseFont(CFont *)
CTypefaceStore::SuperSubHeight(TInt,TFontPrintPosition)
CTypefaceStore::~CTypefaceStore()
Private Attributes
CGraphicsDevice *iDevice
RFbsSession *iFbs
CFontCache *iTwipsCache
Inherited Attributes
CTypefaceStore::iFontAccess

Constructor & Destructor Documentation

CFbsTypefaceStore(CGraphicsDevice *)

CFbsTypefaceStore(CGraphicsDevice *aDevice)[private]

Parameters

CGraphicsDevice * aDevice

~CFbsTypefaceStore()

IMPORT_C~CFbsTypefaceStore()

Member Functions Documentation

AddFile(const TDesC &, TInt &)

IMPORT_C TIntAddFile(const TDesC &aName,
TInt &aId
)

Parameters

const TDesC & aName
TInt & aId

ConstructL()

voidConstructL()[private]

CreateFont(CFont *&, const TFontInfo &)

TInt CreateFont(CFont *&aFont,
const TFontInfo &aFontInfo
)[private]

Parameters

CFont *& aFont
const TFontInfo & aFontInfo

DefaultBitmapType()

IMPORT_C TGlyphBitmapTypeDefaultBitmapType()const

FontHeight(TInt, TInt, TInt)

TInt FontHeight(TIntaTypefaceIndex,
TIntaHeightIndex,
TIntaMessage
)const [private]

Parameters

TInt aTypefaceIndex
TInt aHeightIndex
TInt aMessage

FontHeightInPixels(TInt, TInt)

IMPORT_C TIntFontHeightInPixels(TIntaTypefaceIndex,
TIntaHeightIndex
)const

Parameters

TInt aTypefaceIndex
TInt aHeightIndex

FontHeightInTwips(TInt, TInt)

IMPORT_C TIntFontHeightInTwips(TIntaTypefaceIndex,
TIntaHeightIndex
)const [virtual]

Gets the height of the font with specified height and typeface indices, in twips.

The value returned is rounded up or down to the nearest font height in twips.

The height of the font, in twips.

Parameters

TInt aTypefaceIndexA typeface index number, in the range: 0 to (NumTypefaces() - 1).
TInt aHeightIndexA font height index number.

GetFontById(CFont *&, TUid, const TAlgStyle &)

IMPORT_C TIntGetFontById(CFont *&aFont,
TUidaUid,
const TAlgStyle &aAlgStyle
)

Parameters

CFont *& aFont
TUid aUid
const TAlgStyle & aAlgStyle

GetLinkedTypefaceL(CLinkedTypefaceSpecification &)

IMPORT_C voidGetLinkedTypefaceL(CLinkedTypefaceSpecification &aLinkedTypefaceSpec)

Parameters

CLinkedTypefaceSpecification & aLinkedTypefaceSpec

GetNearestFontInPixels(CFont *&, const TFontSpec &)

IMPORT_C TIntGetNearestFontInPixels(CFont *&aFont,
const TFontSpec &aFontSpec
)

Parameters

CFont *& aFont
const TFontSpec & aFontSpec

GetNearestFontInTwips(CFont *&, const TFontSpec &)

IMPORT_C TIntGetNearestFontInTwips(CFont *&aFont,
const TFontSpec &aFontSpec
)[virtual]

Gets the font which is the nearest to the given font specification.

When the font is no longer needed, call ReleaseFont().

Note that this deprecated function is replaced by the new GetNearestFontToDesignHeightInTwips() yielding (virtually) the same result. However clients are strongly encouraged to use the new GetNearestFontToMaxHeightInTwips() function instead. This will guarantee that every character within any given text string will fit within the given amount of twips, whereas the design height is an aesthetic unit decided by the font designer without strict physical meaning, which may result in cropped characters.

KErrNone if successful; a system-wide error code otherwise.

Use GetNearestFontToDesignHeightInTwips

Parameters

CFont *& aFontOn return, contains a pointer to the nearest font.
const TFontSpec & aFontSpecThe specification of the font to be matched.

GetNearestFontInTwipsAndCreateFont(CFont *&, TInt, const TFontSpec &, TInt)

TInt GetNearestFontInTwipsAndCreateFont(CFont *&aFont,
TIntaFbsMessage,
const TFontSpec &aFontSpec,
TIntaMaxHeight = 0
)[private]

Parameters

CFont *& aFont
TInt aFbsMessage
const TFontSpec & aFontSpec
TInt aMaxHeight = 0

GetNearestFontToDesignHeightInPixels(CFont *&, const TFontSpec &)

IMPORT_C TIntGetNearestFontToDesignHeightInPixels(CFont *&aFont,
const TFontSpec &aFontSpec
)

Parameters

CFont *& aFont
const TFontSpec & aFontSpec

GetNearestFontToDesignHeightInTwips(CFont *&, const TFontSpec &)

IMPORT_C TIntGetNearestFontToDesignHeightInTwips(CFont *&aFont,
const TFontSpec &aFontSpec
)[virtual]

Gets the font which is the nearest to the given font specification.

When the font is no longer needed, call ReleaseFont().

This new function replaces the deprecated GetNearestFontInTwips() yielding (virtually) the same result. However clients are strongly encouraged to use the new GetNearestFontToMaxHeightInTwips() function instead. This will guarantee that every character within any given text string will fit within the given amount of twips, whereas the design height is an aesthetic unit decided by the font designer without strict physical meaning, which may result in cropped characters.

KErrNone if successful; a system-wide error code otherwise.

Parameters

CFont *& aFontOn return, contains a pointer to the nearest font.
const TFontSpec & aFontSpecThe specification of the font to be matched.

GetNearestFontToMaxHeightInPixels(CFont *&, const TFontSpec &, TInt)

IMPORT_C TIntGetNearestFontToMaxHeightInPixels(CFont *&aFont,
const TFontSpec &aFontSpec,
TIntaMaxHeight
)

Parameters

CFont *& aFont
const TFontSpec & aFontSpec
TInt aMaxHeight

GetNearestFontToMaxHeightInTwips(CFont *&, const TFontSpec &, TInt)

IMPORT_C TIntGetNearestFontToMaxHeightInTwips(CFont *&aFont,
const TFontSpec &aFontSpec,
TIntaMaxHeight
)[virtual]

Gets the font which is the nearest to the given font specification.

When the font is no longer needed, call ReleaseFont().

The font and bitmap server returns a pointer to the nearest matching font from those available. Matches to max height of font - this does its best to return a font that will fit within the maximum height specified (but note that variations due to hinting algorithms may rarely result in this height being exceeded by up to one pixel). Problems can also be encountered with bitmap fonts where the typeface exists but doesn't have a font small enough.

KErrNone if successful; a system-wide error code otherwise.

Parameters

CFont *& aFontOn return, contains a pointer to the nearest font.
const TFontSpec & aFontSpecThe specification of the font to be matched.
TInt aMaxHeightThe maximum height within which the font must fit.

GetPixelSizeInTwips(TSize &)

voidGetPixelSizeInTwips(TSize &aSize)const [private]

Parameters

TSize & aSize

InstallFile(const TDesC &, TInt &)

IMPORT_C TIntInstallFile(const TDesC &aName,
TInt &aId
)

Parameters

const TDesC & aName
TInt & aId

IsFontLoaded(CFont *&, const TFontInfo &)

TBool IsFontLoaded(CFont *&aFont,
const TFontInfo &aFontInfo
)const [private]

Parameters

CFont *& aFont
const TFontInfo & aFontInfo

NewL(CGraphicsDevice *)

IMPORT_C CFbsTypefaceStore *NewL(CGraphicsDevice *aDevice)[static]

Parameters

CGraphicsDevice * aDevice

NumTypefaces()

IMPORT_C TIntNumTypefaces()const [virtual]

Gets the number of typefaces supported by the typeface store.

The number of supported typefaces.

RegisterLinkedTypeface(const CLinkedTypefaceSpecification &, TInt &)

IMPORT_C TIntRegisterLinkedTypeface(const CLinkedTypefaceSpecification &aLinkedTypefaceSpec,
TInt &aId
)

Parameters

const CLinkedTypefaceSpecification & aLinkedTypefaceSpec
TInt & aId

RegisterLinkedTypeface(const CLinkedTypefaceSpecification &)

IMPORT_C TIntRegisterLinkedTypeface(const CLinkedTypefaceSpecification &aLinkedTypefaceSpec)

Parameters

const CLinkedTypefaceSpecification & aLinkedTypefaceSpec

ReleaseTwipsCache()

IMPORT_C voidReleaseTwipsCache()

RemoveFile(TInt)

IMPORT_C voidRemoveFile(TIntaId = 0)

Parameters

TInt aId = 0

RemoveFontFileLocksL()

IMPORT_C voidRemoveFontFileLocksL()[static]

RemoveFontFileLocksL(const TDesC &, TBool)

IMPORT_C voidRemoveFontFileLocksL(const TDesC &aDrive,
TBoolaAllFonts
)[static]

Parameters

const TDesC & aDrive
TBool aAllFonts

RemoveFontFileLocksL(const TDesC &)

IMPORT_C voidRemoveFontFileLocksL(const TDesC &aFileName)[static]

Parameters

const TDesC & aFileName

SendGetNearestFontCommandNCreateFont(CFont *&, TInt, const TFontSpec &, TInt)

TInt SendGetNearestFontCommandNCreateFont(CFont *&aFont,
TIntaFbsMessage,
const TFontSpec &aFontSpec,
TIntaMaxHeight = 0
)[private]

Parameters

CFont *& aFont
TInt aFbsMessage
const TFontSpec & aFontSpec
TInt aMaxHeight = 0

SetDefaultBitmapType(TGlyphBitmapType)

IMPORT_C voidSetDefaultBitmapType(TGlyphBitmapTypeaType)const

Parameters

TGlyphBitmapType aType

SetDefaultLanguageForMetrics(TLanguage)

IMPORT_C voidSetDefaultLanguageForMetrics(TLanguageaLanguage)const

Parameters

TLanguage aLanguage

SetFontNameAliasL(const TDesC &, const TDesC &)

IMPORT_C voidSetFontNameAliasL(const TDesC &aFontAlias,
const TDesC &aFontName
)const

Parameters

const TDesC & aFontAlias
const TDesC & aFontName

SetSystemDefaultTypefaceNameL(const TDesC &)

IMPORT_C voidSetSystemDefaultTypefaceNameL(const TDesC &aFontTypefaceName)

Parameters

const TDesC & aFontTypefaceName

TypefaceSupport(TTypefaceSupport &, TInt)

IMPORT_C voidTypefaceSupport(TTypefaceSupport &aTypefaceSupport,
TIntaTypefaceIndex
)const [virtual]

Gets typeface information for a specified typeface index.

This information is returned in aTypefaceSupport, and includes the typeface name and typeface attributes, the number of font heights, the maximum and minimum font heights, and whether it is a scaleable typeface.

Parameters

TTypefaceSupport & aTypefaceSupportOn return, if the function executed successfully, this object contains the typeface information.
TInt aTypefaceIndexA typeface index number, in the range: zero to (NumTypefaces() - 1).

UpdateLinkedTypeface(const CLinkedTypefaceSpecification &)

IMPORT_C TIntUpdateLinkedTypeface(const CLinkedTypefaceSpecification &aLinkedTypefaceSpec)

Parameters

const CLinkedTypefaceSpecification & aLinkedTypefaceSpec

Member Data Documentation

CGraphicsDevice * iDevice

CGraphicsDevice *iDevice[private]

RFbsSession * iFbs

RFbsSession *iFbs[private]

CFontCache * iTwipsCache

CFontCache *iTwipsCache[private]