EPOC   SDK Home Glossary Indexes Previous Next Up

CFbsFont class


Contents


CFbsFont class — Font managed by FBSERV

Section Contents


Overview

Derivation

CBase

Abstract: CBase behaviour

CFont

Abstract: provides abstract font interface

CFbsFont

Font managed by font and bitmap server

Defined in

fbs.h

Link against

fbscli.lib

Description

CFbsFont is a CFont-derived class, for screen and off-screen bitmap fonts. This section defines the functions added to the class, in EPOC Release 5, to support the open font system.

To view the existing class documentation see CFbsFont in the C++ SDK.


Miscellaneous information


CharacterMetrics() — Get the character metrics

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

Compatibility

Applications that call this member function will not work correctly on a version of EPOC earlier than ER5.

Description

Returns the character metrics for aCode and puts a pointer to the compressed glyph bitmap in aBytes. This function is now deprecated because TCharacterMetrics cannot store metrics larger than 127 or less than 127 - use GetCharacterData() instead.

Arguments

TInt aCode

The code for the character to be checked

TUint8*& aBytes

a pointer to the compressed glyph bitmap is placed in aBytes

Return value

TCharacterMetrics

The character metrics for the font (eg Offset, ascent, height, adjust etc.)


RawTextWidthInPixels() — Get the width of text within a descriptor

TInt RawTextWidthInPixels(const TDesC& aText) const

Compatibility

Applications that call this member function will not work correctly on a version of EPOC earlier than ER5.

Description

Retrieves the text width, in pixels, without adjusting for side bearings, algorithmic style etc.

Arguments

const TDesC& aText

Any text descriptor (TPtrC, TPtr, _LIT, TBuf etc.)

Return value

TInt

The width (in pixels) of the text in the descriptor


GetCharacterData() — Get the character metrics and glyph bitmap

TBool GetCharacterData(TInt aCode,TOpenFontCharMetrics& aMetrics,const TUint8*& aBytes) const;

Compatibility

Applications that call this member function will not work correctly on a version of EPOC earlier than ER5.

Description

Retrieves the character metrics and the glyph bitmap.

This function works for both bitmap fonts and those handled by the Open Font System. It is better than CharacterMetrics() because TOpenFontCharMetrics can handle 16-bit metrics, and contains more information.

Arguments

TInt aCode

The character code (in code page 1252 for the non-Unicode build, otherwise in Unicode).

TOpenFontCharMetrics& aMetrics

The character metrics

const TUint8*& aBytes

a pointer to the compressed glyph bitmap is placed in aBytes

Return value

TBool

False if metrics cannot be obtained


GetFontMetrics() — Get the OpenFont metrics

TBool GetFontMetrics(TOpenFontMetrics& aMetrics) const;

Compatibility

Applications that call this member function will not work correctly on a version of EPOC earlier than ER5.

Description

Retrieves the font metrics if possible.

Arguments

TOpenFontMetrics& aMetrics

The font metrics

Return value

TBool

False if the metrics cannot be obtained


GetFaceAttrib() — Get the typeface attributes

TBool GetFaceAttrib(TOpenFontFaceAttrib& aAttrib) const;

Compatibility

Applications that call this member function will not work correctly on a version of EPOC earlier than ER5.

Description

Returns the typeface attributes if the font is an Open Font (that is, if IsOpenFont returns TRUE  — see below).

Note: 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.

Arguments

TOpenFontFaceAttrib& aAttrib

Typeface attributes

Return value

TBool

Returns FALSE if attributes cannot be obtained, and if the IsOpenFont() function is FALSE (not an Open Font)


IsOpenFont() — Check if font was created by the Open Font system

TBool IsOpenFont() const;

Compatibility

Applications that call this member function will not work correctly on a version of EPOC earlier than ER5.

Description

Returns TRUE if the font was created by the Open Font System (e.g., a TrueType font). The function returns FALSE if the font is a bitmap font loaded from a GDR file.

Note: If IsOpenFont() returns TRUE, the function GetFaceAttrib() will work.

Return value

TBool

True if font was created by the Open Font system  — eg a TrueType font.


HasCharacter() — Check if the font contains a particular character

TBool HasCharacter(TInt aCode) const;

Compatibility

Applications that call this member function will not work correctly on a version of EPOC earlier than ER5.

Description

Returns TRUE if the font contains the character aCode. This code is in the code page 1252 encoding in the narrow build, otherwise it is in Unicode

Arguments

TInt aCode

Character code to be checked

Return value

TBool

TRUE if the font contains aCode.

EPOC       SDK Home Glossary Indexes Previous Next Up