CFbsFont Class Reference

class CFbsFont : public CFont

Font managed by the font and bitmap server. CFbsFont objects are used for screen and off-screen bitmap fonts. They are usually obtained by calls to the CBitmapDevice::GetNearestFontInPixels() and MGraphicsDeviceMap::GetNearestFontInTwips() functions. The class implements a number of functions inherited from CFont . CBitmapDevice::GetNearestFontInPixels() MGraphicsDeviceMap::GetNearestFontInTwips()

Inherits from

Public Member Functions
IMPORT_C TCharacterMetrics CharacterMetrics ( TInt , const TUint8 *&)
IMPORT_C TBool GetFaceAttrib ( TOpenFontFaceAttrib &)
IMPORT_C TBool GetFontMetrics ( TOpenFontMetrics &)
IMPORT_C TInt Handle ()
IMPORT_C TBool HasCharacter ( TInt )
IMPORT_C TBool IsOpenFont ()
IMPORT_C TInt RawTextWidthInPixels (const TDesC &)
IMPORT_C TInt TextWidthInPixels (const TDesC &)
IMPORT_C void TextWidthInPixels (const TDesC &, SCharWidth &)
IMPORT_C TInt TextWidthInPixels (const TDesC &, const TMeasureTextInput *)
IMPORT_C void TextWidthInPixels (const TDesC &, const TMeasureTextInput *, SCharWidth &)
Protected Member Functions
CFbsFont ()
CFbsFont (const CFbsFont &)
~CFbsFont ()
IMPORT_C CBitmapFont * Address ()
IMPORT_C TInt Duplicate ( TInt )
IMPORT_C void Reset ()
Private Member Functions
IMPORT_C TInt DoAscentInPixels ()
IMPORT_C TInt DoBaselineOffsetInPixels ()
IMPORT_C TInt DoCharWidthInPixels ( TChar )
IMPORT_C TInt DoExtendedFunction ( TUid , TAny *)
TInt DoFontDeleteShaping ( TFontShapeDeleteFunctionParameters *)
TInt DoFontGetShaping ( TFontShapeFunctionParameters *)
IMPORT_C TFontSpec DoFontSpecInTwips ()
IMPORT_C CFont::TCharacterDataAvailability DoGetCharacterData ( TUint , TOpenFontCharMetrics &, const TUint8 *&, TSize &)
IMPORT_C TInt DoHeightInPixels ()
IMPORT_C TInt DoMaxCharWidthInPixels ()
IMPORT_C TInt DoMaxNormalCharWidthInPixels ()
IMPORT_C TInt DoTextCount (const TDesC &, TInt )
IMPORT_C TInt DoTextCount (const TDesC &, TInt , TInt &)
IMPORT_C TInt DoTextWidthInPixels (const TDesC &)
TInt DoTextWidthInPixels (const TDesC &, const TMeasureTextInput *)
TUid DoTypeUid ()
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()
CFont::AscentInPixels()const
CFont::BaselineOffsetInPixels()const
CFont::CharWidthInPixels(TChar)const
CFont::CharactersJoin(TInt,TInt)
CFont::DescentInPixels()const
CFont::DoGetCharacterPosition(TPositionParam &)const
CFont::ExtendedFunction(TUid,TAny *)const
CFont::FontCapitalAscent()const
CFont::FontLineGap()const
CFont::FontMaxAscent()const
CFont::FontMaxDescent()const
CFont::FontMaxHeight()const
CFont::FontSpecInTwips()const
CFont::FontStandardDescent()const
CFont::GetCharacterData(TUint,TOpenFontCharMetrics &,const TUint8 *&,TSize &)const
CFont::GetCharacterPosition(TPositionParam &)const
CFont::GetCharacterPosition2(TPositionParam &,RShapeInfo &)const
CFont::HeightInPixels()const
CFont::MaxCharWidthInPixels()const
CFont::MaxNormalCharWidthInPixels()const
CFont::MeasureText(const TDesC &,const TMeasureTextInput *,TMeasureTextOutput *)const
CFont::TextCount(const TDesC &,TInt)const
CFont::TextCount(const TDesC &,TInt,TInt &)const
CFont::TypeUid()const
CFont::WidthZeroInPixels()const
CFont::~CFont()
Inherited Enumerations
CFont:TCharacterDataAvailability
CFont:TTextDirection
Protected Attributes
CBitmapFont * iAddressPointer
RFbsSession * iFbs
TInt iHandle
TInt iServerHandle

Constructor & Destructor Documentation

CFbsFont()

IMPORT_C CFbsFont ( ) [protected]

CFbsFont(const CFbsFont &)

IMPORT_C CFbsFont ( const CFbsFont & aFont ) [protected]

Parameters

const CFbsFont & aFont

~CFbsFont()

IMPORT_C ~CFbsFont ( ) [protected]

Member Functions Documentation

Address()

IMPORT_C CBitmapFont * Address ( ) const [protected]

CharacterMetrics(TInt, const TUint8 *&)

IMPORT_C TCharacterMetrics CharacterMetrics ( TInt aCode,
const TUint8 *& aBytes
) const

Gets the character metrics and a pointer to the compressed glyph bitmap for the specified character. This function is deprecated, because TCharacterMetrics cannot store metrics larger than 127 or less than 127 use GetCharacterData() instead.

Parameters

TInt aCode The code for the character to be checked.
const TUint8 *& aBytes On return, contains a pointer to the compressed glyph bitmap.

DoAscentInPixels()

IMPORT_C TInt DoAscentInPixels ( ) const [private, virtual]

Gets the font ascent in pixels. CFont::AscentInPixels()

DoBaselineOffsetInPixels()

IMPORT_C TInt DoBaselineOffsetInPixels ( ) const [private, virtual]

Gets the baseline offset, in pixels. The offset is how far a font is raised or lowered from its normal baseline. CFont::BaselineOffsetInPixels()

DoCharWidthInPixels(TChar)

IMPORT_C TInt DoCharWidthInPixels ( TChar aChar ) const [private, virtual]

Gets the width of the specified character in this font, in pixels.

Note: For OpenType fonts this function returns the horizontal advance of the character, which may be different from the actual width.

CFont::CharWidthInPixels()

Parameters

TChar aChar The character whose width should be determined.

DoExtendedFunction(TUid, TAny *)

IMPORT_C TInt DoExtendedFunction ( TUid aFunctionId,
TAny * aParam = NULL
) const [private, virtual]

API extension system that enables the caller to access a particular API extension function. As an overload of this function in a derived class it calls its immediate parent implementation for any extension function Uid that it does not recognize and handle.

Parameters

TUid aFunctionId
TAny * aParam = NULL Pointer to an arbitrary parameter block that can be used to provide and/or return information to/from the particular extension function, defaults to NULL.

DoFontDeleteShaping(TFontShapeDeleteFunctionParameters *)

TInt DoFontDeleteShaping ( TFontShapeDeleteFunctionParameters * aParam ) const [private]

help DoExtendedFunction to perform KFontDeleteShaping function

Parameters

TFontShapeDeleteFunctionParameters * aParam Input parameter block

DoFontGetShaping(TFontShapeFunctionParameters *)

TInt DoFontGetShaping ( TFontShapeFunctionParameters * aParam ) const [private]

help DoExtendedFunction to perform KFontGetShaping function

Parameters

TFontShapeFunctionParameters * aParam Input & output parameter block, if successful aParam->iShapeHeaderOutput points to the shape data.

DoFontSpecInTwips()

IMPORT_C TFontSpec DoFontSpecInTwips ( ) const [private, virtual]

Gets the font specification of this font in twips. CFont::FontSpecInTwips()

DoGetCharacterData(TUint, TOpenFontCharMetrics &, const TUint8 *&, TSize &)

IMPORT_C CFont::TCharacterDataAvailability DoGetCharacterData ( TUint aCode,
TOpenFontCharMetrics & aMetrics,
const TUint8 *& aBitmap,
TSize & aBitmapSize
) const [private, virtual]

Gets the character metrics and the glyph bitmap.

Parameters

TUint aCode The character code in Unicode.
TOpenFontCharMetrics & aMetrics On return, contains the character metrics.
const TUint8 *& aBitmap On return, contains a pointer to the compressed glyph bitmap.
TSize & aBitmapSize The size of the returned glyph bitmap in pixels. This is not necessarily the same as the size implied by the returned metrics, which may incorporate algorithmic multiplication.

DoHeightInPixels()

IMPORT_C TInt DoHeightInPixels ( ) const [private, virtual]

Gets the font height in pixels. CFont::HeightInPixels()

DoMaxCharWidthInPixels()

IMPORT_C TInt DoMaxCharWidthInPixels ( ) const [private, virtual]

Gets the width of the widest character in this font, in pixels. CFont::MaxCharWidthInPixels()

DoMaxNormalCharWidthInPixels()

IMPORT_C TInt DoMaxNormalCharWidthInPixels ( ) const [private, virtual]

Gets the width of the widest normal character in this font, in pixels. Normal characters include all character in a character set except non-alphabetic characters (e.g. the copyright symbol, or a block graphics symbol, for example). CFont::MaxNormalCharWidthInPixels()

DoTextCount(const TDesC &, TInt)

IMPORT_C TInt DoTextCount ( const TDesC & aText,
TInt aWidthInPixels
) const [private, virtual]

Gets how much of the specified descriptor can be displayed in this font without exceeding the specified width.

Note: This function does not display any of the descriptor itself. It is used before display, to test whether the whole descriptor can be displayed. CFont::TextCount()

Parameters

const TDesC & aText The descriptor.
TInt aWidthInPixels The available width for character display

DoTextCount(const TDesC &, TInt, TInt &)

IMPORT_C TInt DoTextCount ( const TDesC & aText,
TInt aWidthInPixels,
TInt & aExcessWidthInPixels
) const [private, virtual]

Gets how much of the specified descriptor can be displayed in this font without exceeding the specified width. It also returns the excess width defined as the specified available width minus the width of the portion of the descriptor which can be displayed without exceeding the available width. CFont::TextCount() TextCount()

Parameters

const TDesC & aText The descriptor.
TInt aWidthInPixels The available width for character display.
TInt & aExcessWidthInPixels The excess width after displaying the portion of the descriptor, in pixels.

DoTextWidthInPixels(const TDesC &)

IMPORT_C TInt DoTextWidthInPixels ( const TDesC & aText ) const [private, virtual]

Gets the width of the specified descriptor when displayed in this font, in pixels. CFont::TextWidthInPixels()

Parameters

const TDesC & aText The descriptor whose width should be determined.

DoTextWidthInPixels(const TDesC &, const TMeasureTextInput *)

TInt DoTextWidthInPixels ( const TDesC & aText,
const TMeasureTextInput * aParam
) const [private]

Gets the width of the specified descriptor when displayed in this font, in pixels.

Parameters

const TDesC & aText The descriptor whose width should be determined.
const TMeasureTextInput * aParam Parameter block that controls how much of aText is measured

DoTypeUid()

TUid DoTypeUid ( ) const [private, inline, virtual]

Gets the font's UID. All CFbsFont objects have the constant UID KCFbsFontUid. It is safe to cast from CFont* to CFbsFont* if CFont::TypeUid() returns KCFbsFontUid. CFont::TypeUid()

Duplicate(TInt)

IMPORT_C TInt Duplicate ( TInt aHandle ) [protected]

Duplicates a font. This function does not create a copy of the font. It just assigns another handle to the bitmap in the font and bitmap server, and sets this object's handle to that.

Parameters

TInt aHandle The handle to an existing CFbsFont.

GetFaceAttrib(TOpenFontFaceAttrib &)

IMPORT_C TBool GetFaceAttrib ( TOpenFontFaceAttrib & aAttrib ) const

Gets the typeface attributes of Open Font System fonts. Notes: Typeface attributes are different from the font metrics; they are not metrics, which are different for every different size, but size-independent attributes of the typeface, like name and style. This function can be used if IsOpenFont() returns true i.e. the font is an Open Font.

Parameters

TOpenFontFaceAttrib & aAttrib On return, contains the typeface attributes.

GetFontMetrics(TOpenFontMetrics &)

IMPORT_C TBool GetFontMetrics ( TOpenFontMetrics & aMetrics ) const

Gets the open font metrics. If the metrics cannot be obtained the function returns EFalse.

Parameters

TOpenFontMetrics & aMetrics On return, contains the font metrics

Handle()

IMPORT_C TInt Handle ( ) const

Gets the Font and Bitmap server handle of the font.

HasCharacter(TInt)

IMPORT_C TBool HasCharacter ( TInt aCode ) const

Tests whether the font contains a particular character.

Parameters

TInt aCode Character code to be tested. This code is in the code page 1252 encoding in v5, otherwise it is in Unicode

IsOpenFont()

IMPORT_C TBool IsOpenFont ( ) const

Tests whether the font is an Open Font system font. Note: If this function returns ETrue, the function GetFaceAttrib() will work.

RawTextWidthInPixels(const TDesC &)

IMPORT_C TInt RawTextWidthInPixels ( const TDesC & aText ) const

Gets the raw width of the text in the descriptor, in pixels. DEPRECATED: Same as MeasureText(const TDesC&). This is the width of the text without adjusting for side bearings, algorithmic style etc.

Parameters

const TDesC & aText Any text descriptor (TPtrC, TPtr, _LIT, TBuf etc.).

Reset()

IMPORT_C void Reset ( ) [protected]

TextWidthInPixels(const TDesC &)

IMPORT_C TInt TextWidthInPixels ( const TDesC & aText ) const

Gets the width of the specified descriptor when displayed in this font, in pixels. Override of the base class to resolve name clash with other TextWidthInPixels variant. CFont::TextWidthInPixels()

Parameters

const TDesC & aText The descriptor whose width should be determined.

TextWidthInPixels(const TDesC &, SCharWidth &)

IMPORT_C void TextWidthInPixels ( const TDesC & aText,
SCharWidth & aCharWidth
) const

Gets the text width, move and adjusts of the specified descriptor when displayed in this font.

Parameters

const TDesC & aText The descriptor whose width should be determined.
SCharWidth & aCharWidth The width of the specified descriptor when displayed in this font, in pixels (including information on the width, move and adjusts of the descriptor).

TextWidthInPixels(const TDesC &, const TMeasureTextInput *)

IMPORT_C TInt TextWidthInPixels ( const TDesC & aText,
const TMeasureTextInput * aParam
) const

Gets the width of the specified descriptor when displayed in this font, in pixels. Override of the base class to resolve name clash with other TextWidthInPixels variant. CFont::TextWidthInPixels()

Parameters

const TDesC & aText The descriptor whose width should be determined.
const TMeasureTextInput * aParam Parameter block that controls how much of aText is measured

TextWidthInPixels(const TDesC &, const TMeasureTextInput *, SCharWidth &)

IMPORT_C void TextWidthInPixels ( const TDesC & aText,
const TMeasureTextInput * aParam,
SCharWidth & aCharWidth
) const

Gets the text width, move and adjusts of the specified descriptor when displayed in this font.

Parameters

const TDesC & aText The descriptor whose width should be determined.
const TMeasureTextInput * aParam Parameter block that controls how much of aText is measured
SCharWidth & aCharWidth The width of the specified descriptor when displayed in this font, in pixels (including information on the width, move and adjusts of the descriptor).

Member Data Documentation

CBitmapFont * iAddressPointer

CBitmapFont * iAddressPointer [protected]

RFbsSession * iFbs

RFbsSession * iFbs [protected]

TInt iHandle

TInt iHandle [protected]

TInt iServerHandle

TInt iServerHandle [protected]