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 TCharacterMetricsCharacterMetrics(TInt, const TUint8 *&)
IMPORT_C TBoolGetFaceAttrib(TOpenFontFaceAttrib &)
IMPORT_C TBoolGetFontMetrics(TOpenFontMetrics &)
IMPORT_C TIntHandle()
IMPORT_C TBoolHasCharacter(TInt)
IMPORT_C TBoolIsOpenFont()
IMPORT_C TIntRawTextWidthInPixels(const TDesC &)
IMPORT_C TIntTextWidthInPixels(const TDesC &)
IMPORT_C voidTextWidthInPixels(const TDesC &, SCharWidth &)
IMPORT_C TIntTextWidthInPixels(const TDesC &, const TMeasureTextInput *)
IMPORT_C voidTextWidthInPixels(const TDesC &, const TMeasureTextInput *, SCharWidth &)
Protected Member Functions
CFbsFont()
CFbsFont(const CFbsFont &)
~CFbsFont()
IMPORT_C CBitmapFont *Address()
IMPORT_C TIntDuplicate(TInt)
IMPORT_C voidReset()
Private Member Functions
IMPORT_C TIntDoAscentInPixels()
IMPORT_C TIntDoBaselineOffsetInPixels()
IMPORT_C TIntDoCharWidthInPixels(TChar)
IMPORT_C TIntDoExtendedFunction(TUid, TAny *)
TInt DoFontDeleteShaping(TFontShapeDeleteFunctionParameters *)
TInt DoFontGetShaping(TFontShapeFunctionParameters *)
IMPORT_C TFontSpecDoFontSpecInTwips()
IMPORT_C CFont::TCharacterDataAvailabilityDoGetCharacterData(TUint, TOpenFontCharMetrics &, const TUint8 *&, TSize &)
IMPORT_C TIntDoHeightInPixels()
IMPORT_C TIntDoMaxCharWidthInPixels()
IMPORT_C TIntDoMaxNormalCharWidthInPixels()
IMPORT_C TIntDoTextCount(const TDesC &, TInt)
IMPORT_C TIntDoTextCount(const TDesC &, TInt, TInt &)
IMPORT_C TIntDoTextWidthInPixels(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_CCFbsFont()[protected]

CFbsFont(const CFbsFont &)

IMPORT_CCFbsFont(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 TCharacterMetricsCharacterMetrics(TIntaCode,
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 aCodeThe code for the character to be checked.
const TUint8 *& aBytesOn return, contains a pointer to the compressed glyph bitmap.

DoAscentInPixels()

IMPORT_C TIntDoAscentInPixels()const [private, virtual]

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

DoBaselineOffsetInPixels()

IMPORT_C TIntDoBaselineOffsetInPixels()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 TIntDoCharWidthInPixels(TCharaChar)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 aCharThe character whose width should be determined.

DoExtendedFunction(TUid, TAny *)

IMPORT_C TIntDoExtendedFunction(TUidaFunctionId,
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 = NULLPointer 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 * aParamInput parameter block

DoFontGetShaping(TFontShapeFunctionParameters *)

TInt DoFontGetShaping(TFontShapeFunctionParameters *aParam)const [private]

help DoExtendedFunction to perform KFontGetShaping function

Parameters

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

DoFontSpecInTwips()

IMPORT_C TFontSpecDoFontSpecInTwips()const [private, virtual]

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

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

IMPORT_C CFont::TCharacterDataAvailabilityDoGetCharacterData(TUintaCode,
TOpenFontCharMetrics &aMetrics,
const TUint8 *&aBitmap,
TSize &aBitmapSize
)const [private, virtual]

Gets the character metrics and the glyph bitmap.

Parameters

TUint aCodeThe character code in Unicode.
TOpenFontCharMetrics & aMetricsOn return, contains the character metrics.
const TUint8 *& aBitmapOn return, contains a pointer to the compressed glyph bitmap.
TSize & aBitmapSizeThe 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 TIntDoHeightInPixels()const [private, virtual]

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

DoMaxCharWidthInPixels()

IMPORT_C TIntDoMaxCharWidthInPixels()const [private, virtual]

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

DoMaxNormalCharWidthInPixels()

IMPORT_C TIntDoMaxNormalCharWidthInPixels()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 TIntDoTextCount(const TDesC &aText,
TIntaWidthInPixels
)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 & aTextThe descriptor.
TInt aWidthInPixelsThe available width for character display

DoTextCount(const TDesC &, TInt, TInt &)

IMPORT_C TIntDoTextCount(const TDesC &aText,
TIntaWidthInPixels,
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 & aTextThe descriptor.
TInt aWidthInPixelsThe available width for character display.
TInt & aExcessWidthInPixelsThe excess width after displaying the portion of the descriptor, in pixels.

DoTextWidthInPixels(const TDesC &)

IMPORT_C TIntDoTextWidthInPixels(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 & aTextThe 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 & aTextThe descriptor whose width should be determined.
const TMeasureTextInput * aParamParameter 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 TIntDuplicate(TIntaHandle)[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 aHandleThe handle to an existing CFbsFont.

GetFaceAttrib(TOpenFontFaceAttrib &)

IMPORT_C TBoolGetFaceAttrib(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 & aAttribOn return, contains the typeface attributes.

GetFontMetrics(TOpenFontMetrics &)

IMPORT_C TBoolGetFontMetrics(TOpenFontMetrics &aMetrics)const

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

Parameters

TOpenFontMetrics & aMetricsOn return, contains the font metrics

Handle()

IMPORT_C TIntHandle()const

Gets the Font and Bitmap server handle of the font.

HasCharacter(TInt)

IMPORT_C TBoolHasCharacter(TIntaCode)const

Tests whether the font contains a particular character.

Parameters

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

IsOpenFont()

IMPORT_C TBoolIsOpenFont()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 TIntRawTextWidthInPixels(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 & aTextAny text descriptor (TPtrC, TPtr, _LIT, TBuf etc.).

Reset()

IMPORT_C voidReset()[protected]

TextWidthInPixels(const TDesC &)

IMPORT_C TIntTextWidthInPixels(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 & aTextThe descriptor whose width should be determined.

TextWidthInPixels(const TDesC &, SCharWidth &)

IMPORT_C voidTextWidthInPixels(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 & aTextThe descriptor whose width should be determined.
SCharWidth & aCharWidthThe 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 TIntTextWidthInPixels(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 & aTextThe descriptor whose width should be determined.
const TMeasureTextInput * aParamParameter block that controls how much of aText is measured

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

IMPORT_C voidTextWidthInPixels(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 & aTextThe descriptor whose width should be determined.
const TMeasureTextInput * aParamParameter block that controls how much of aText is measured
SCharWidth & aCharWidthThe 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]