COpenFontLinkedTypefaceSpecification Class Reference

class COpenFontLinkedTypefaceSpecification : public CBase

This class contains the specification of a linked typeface passed from font store to a rasterizer. It is made up of groups and typefaces. A group ( CLinkedTypefaceGroup ) contains a number of attributes that can apply to similar typefaces within the linked typeface. One or more typeface may belong to a group. Typefaces ( COpenFontLinkedTypefaceElementSpec ) specifiy which typefaces are used within this linked font.

After creation, the linked typeface can be used as if it were any other typeface. This assumes that there is a rasteriser that supports this feature available. When looking up characters the first typeface containing the required character is used.

KMaxLinkedTypefaces and KMaxLinkedTypefaceGroups define the maximum number of typefaces and groups that can be added to the specification.

COpenFontLinkedTypefaceElementSpec CLinkedTypefaceGroup CLinkedTypefaceSpecification CLinkedTypefaceElementSpec

Inherits from

  • COpenFontLinkedTypefaceSpecification
Public Member Functions
~COpenFontLinkedTypefaceSpecification ()
IMPORT_C void AddLinkedTypefaceGroupL ( CLinkedTypefaceGroup &)
IMPORT_C void AddTypefaceAtBackL ( COpenFontLinkedTypefaceElementSpec &)
IMPORT_C void AddTypefaceAtIndexL ( COpenFontLinkedTypefaceElementSpec &, TInt )
IMPORT_C TInt CanonicalIndex ()
IMPORT_C const CLinkedTypefaceGroup * Group ( TInt )
IMPORT_C CLinkedTypefaceGroup * GroupById ( TInt )
IMPORT_C TInt GroupCount ()
IMPORT_C TPtrC Name ()
IMPORT_C COpenFontLinkedTypefaceSpecification * NewLC (const TDesC &)
IMPORT_C COpenFontLinkedTypefaceSpecification * NewLC (const TLinkedTypefaceSpecificationArgs &)
IMPORT_C TInt RemoveLinkedTypefaceGroup ( TInt )
IMPORT_C TInt RemoveTypeface ( TInt )
IMPORT_C COpenFontLinkedTypefaceElementSpec * Typeface ( TInt )
IMPORT_C TInt TypefaceCount ()
Private Member Functions
COpenFontLinkedTypefaceSpecification ()
void ConstructL (const TDesC &)
void ConstructL (const TLinkedTypefaceSpecificationArgs &)
void DoAddTypefaceL ( COpenFontLinkedTypefaceElementSpec &, 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()
Private Attributes
RPointerArray < CLinkedTypefaceGroup > iGroups
HBufC * iLinkedTypefaceFileName
HBufC * iLinkedTypefaceName
RPointerArray < COpenFontLinkedTypefaceElementSpec > iTypefaces

Constructor & Destructor Documentation

COpenFontLinkedTypefaceSpecification()

COpenFontLinkedTypefaceSpecification ( ) [private]

~COpenFontLinkedTypefaceSpecification()

IMPORT_C ~COpenFontLinkedTypefaceSpecification ( )

Default destructor

Member Functions Documentation

AddLinkedTypefaceGroupL(CLinkedTypefaceGroup &)

IMPORT_C void AddLinkedTypefaceGroupL ( CLinkedTypefaceGroup & aGroup )

Adds the group specified to this specification The specification takes ownership of the group if addition is successful.

COpenFontLinkedTypefaceSpecification::RemoveLinkedTypefaceGroup()
leave
KErrAlreadyExists A group with the same ID is already present in the specification

Parameters

CLinkedTypefaceGroup & aGroup The group to be added

AddTypefaceAtBackL(COpenFontLinkedTypefaceElementSpec &)

IMPORT_C void AddTypefaceAtBackL ( COpenFontLinkedTypefaceElementSpec & aElementSpec )

Adds the supplied CLinkedTypefaceElementSpec to the Linked Typeface specification. The element is placed at the back of the specification. Adding a canonical element will only be successful if one has not already been added. The specification takes ownership of the element specification.

CLinkedTypefaceSpecification::AddTypefaceAtIndexL() CLinkedTypefaceSpecification::RemoveTypeface() KMaxLinkedTypefaces
leave
KErrArgument If the element is canonical and a canonical element already exists or if the group ID doesn't exist
leave
KErrNoMemory There was not enough memory available to perform this operation
leave
KErrOverflow The typeface specification is full; adding would exceed KMaxLinkedTypefaces

Parameters

COpenFontLinkedTypefaceElementSpec & aElementSpec

AddTypefaceAtIndexL(COpenFontLinkedTypefaceElementSpec &, TInt)

IMPORT_C void AddTypefaceAtIndexL ( COpenFontLinkedTypefaceElementSpec & aElementSpec,
TInt aIndex
)

Adds the supplied CLinkedTypefaceElementSpec to the Linked Typeface specification. The element is placed at the specified index. Adding a canonical element will only be successful if one has not already been added. The specification takes ownership of the element specification.

CLinkedTypefaceSpecification::AddTypefaceAtBackL() CLinkedTypefaceSpecification::RemoveTypeface() KMaxLinkedTypefaces
leave
KErrArgument If the element is canonical and a canonical element already exists or if the group ID doesn't exist
leave
KErrNoMemory There was not enough memory available to perform this operation
leave
KErrOverflow The typeface specification is full; adding would exceed KMaxLinkedTypefaces

Parameters

COpenFontLinkedTypefaceElementSpec & aElementSpec The specification to be added.
TInt aIndex The position at which the element spec will be added.

CanonicalIndex()

IMPORT_C TInt CanonicalIndex ( ) const

Returns the index of the canonical (metrics) typeface.

The can be retrieved by passing the index to Typeface() .

COpenFontLinkedTypefaceSpecification::Typeface()

ConstructL(const TDesC &)

void ConstructL ( const TDesC & aName ) [private]

Parameters

const TDesC & aName

ConstructL(const TLinkedTypefaceSpecificationArgs &)

void ConstructL ( const TLinkedTypefaceSpecificationArgs & aSpecArgs ) [private]

Parameters

const TLinkedTypefaceSpecificationArgs & aSpecArgs

DoAddTypefaceL(COpenFontLinkedTypefaceElementSpec &, TInt)

void DoAddTypefaceL ( COpenFontLinkedTypefaceElementSpec & aElementSpec,
TInt aPos
) [private]

Parameters

COpenFontLinkedTypefaceElementSpec & aElementSpec
TInt aPos

Group(TInt)

IMPORT_C const CLinkedTypefaceGroup * Group ( TInt aIndex ) const

Returns the linked typeface group at the specified index within the specification. The Index ranges from 0 to the value returned by NumberOfGroups()-1.

Parameters

TInt aIndex

GroupById(TInt)

IMPORT_C CLinkedTypefaceGroup * GroupById ( TInt aGroupId ) const

Returns the linked typeface group with the specified group ID.

Parameters

TInt aGroupId The linked typeface group ID

GroupCount()

IMPORT_C TInt GroupCount ( ) const

Returns the number of groups that this linked typeface specification contains.

CLinkedTypefaceSpecification::Group()

Name()

IMPORT_C TPtrC Name ( ) const

Returns the name of this linked typeface

NewLC(const TDesC &)

IMPORT_C COpenFontLinkedTypefaceSpecification * NewLC ( const TDesC & aName ) [static]

This function constructs the linked typeface specification and places it on the CleanupStack .

Parameters

const TDesC & aName The name of the linked typeface. This name should not be the same as an existing typeface.

NewLC(const TLinkedTypefaceSpecificationArgs &)

IMPORT_C COpenFontLinkedTypefaceSpecification * NewLC ( const TLinkedTypefaceSpecificationArgs & aSpecArgs ) [static]

This function constructs the linked typeface specification from the passed TLinkedTypefaceSpecificationArgs and places it on the CleanupStack .

WARNING: Function for internal use ONLY. Compatibility is not guaranteed in future releases.

Parameters

const TLinkedTypefaceSpecificationArgs & aSpecArgs The TLinkedTypefaceSpecificationArgs container passed from font and bitmap server

RemoveLinkedTypefaceGroup(TInt)

IMPORT_C TInt RemoveLinkedTypefaceGroup ( TInt aGroupId )

This will remove the group and all the elements associated with it.

Parameters

TInt aGroupId The Id of the group to be removed

RemoveTypeface(TInt)

IMPORT_C TInt RemoveTypeface ( TInt aIndex )

Removes the element spec at the specified index from this specification. This function deletes the element spec. If the element is the only one within its group the group is also removed and deleted from the specification.

Parameters

TInt aIndex the index of the element spec to be removed

Typeface(TInt)

IMPORT_C COpenFontLinkedTypefaceElementSpec * Typeface ( TInt aIndex ) const

Returns the linked typeface at the specified index.

COpenFontLinkedTypefaceSpecification::NumberOfTypefaces()

Parameters

TInt aIndex

TypefaceCount()

IMPORT_C TInt TypefaceCount ( ) const

Returns the number of typefaces that have been added to this specification

Member Data Documentation

RPointerArray< CLinkedTypefaceGroup > iGroups

RPointerArray < CLinkedTypefaceGroup > iGroups [private]

HBufC * iLinkedTypefaceFileName

HBufC * iLinkedTypefaceFileName [private]

HBufC * iLinkedTypefaceName

HBufC * iLinkedTypefaceName [private]

RPointerArray< COpenFontLinkedTypefaceElementSpec > iTypefaces

RPointerArray < COpenFontLinkedTypefaceElementSpec > iTypefaces [private]