CLinkedTypefaceSpecification Class Reference

class CLinkedTypefaceSpecification : public CBase

This class contains the specification of a linked typeface. It is made up of groups and typefaces.

Groups (CLinkedTypefaceGroup) must contain one or more typeface; the attributes of the group control how the rasterizer draws the typefaces within the group.

Typefaces (CLinkedTypefaceElementSpec) specify which individual typefaces make up the linked typeface. These are referred to as "elements" of the linked typeface.

Once the linked typeface has been created users can use it as if it were any other typeface assuming there is a rasteriser that supports this feature available. When selecting a character the rasterize searches each typeface in turn from the lowest index to the highest. When drawing text, the first typeface to contain the required character is used.

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

This class is not thread safe.

WARNING: Class for internal and partner use ONLY. Compatibility is not guaranteed in future releases.

CLinkedTypefaceElementSpec CLinkedTypefaceGroup KLinkedMaxTypefaces KMaxLinkedTypefaceGroups

Inherits from

  • CLinkedTypefaceSpecification

Constructor & Destructor Documentation

CLinkedTypefaceSpecification()

CLinkedTypefaceSpecification()[private]

~CLinkedTypefaceSpecification()

IMPORT_C~CLinkedTypefaceSpecification()

Default destructor

Member Functions Documentation

AddLinkedTypefaceGroupL(CLinkedTypefaceGroup &)

IMPORT_C voidAddLinkedTypefaceGroupL(CLinkedTypefaceGroup &aGroup)

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

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

Parameters

CLinkedTypefaceGroup & aGroupThe group to be added

AddTypefaceAtBackL(CLinkedTypefaceElementSpec &)

IMPORT_C voidAddTypefaceAtBackL(CLinkedTypefaceElementSpec &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 if adding is successful.

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

CLinkedTypefaceElementSpec & aElementSpec

AddTypefaceAtIndexL(CLinkedTypefaceElementSpec &, TInt)

IMPORT_C voidAddTypefaceAtIndexL(CLinkedTypefaceElementSpec &aElementSpec,
TIntaIndex
)

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 if adding is successful.

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

CLinkedTypefaceElementSpec & aElementSpecThe specification to be added.
TInt aIndexThe position at which the element spec will be added.

CanonicalIndex()

IMPORT_C TIntCanonicalIndex()

Function to return the index of the canonical (metrics) typeface. The typeface can be retrieved by passing the index to Typeface().

CLinkedTypefaceSpecification::Typeface()

Clear()

IMPORT_C voidClear()

Removes and destroys all groups and elements from the specification.

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

ConstructL(const TDesC &)

voidConstructL(const TDesC &aTypefaceName)[private]

Parameters

const TDesC & aTypefaceName

DoAddTypefaceL(CLinkedTypefaceElementSpec &, TInt)

voidDoAddTypefaceL(CLinkedTypefaceElementSpec &aElementSpec,
TIntaPos
)[private]

Parameters

CLinkedTypefaceElementSpec & aElementSpec
TInt aPos

FetchLinkedTypefaceSpecificationL(CFbsTypefaceStore &)

IMPORT_C voidFetchLinkedTypefaceSpecificationL(CFbsTypefaceStore &aStore)

Retrieves the linked typeface specification from the server; the name of the typeface to retrieve should be specified at construction. All typefaces and groups contained in the specification are removed before retrieval of the new data.

CLinkedTypefaceSpecification::NewLC()
leave
KErrNotSupported There is not a rasterizer available that supports linked typefaces
leave
KErrArgument The font specified does not exist or is not a linked typeface

Parameters

CFbsTypefaceStore & aStoreA pointer to the FontStore

Group(TInt)

IMPORT_C CLinkedTypefaceGroup *Group(TIntaGroupIndex)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 aGroupIndexThe linked typeface groups index within the specification

GroupById(TInt)

IMPORT_C CLinkedTypefaceGroup *GroupById(TIntaGroupId)const

Returns the linked typeface group with the specified group ID.

Parameters

TInt aGroupIdThe linked typeface group ID

GroupCount()

IMPORT_C TIntGroupCount()const

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

CLinkedTypefaceSpecification::Group()

Name()

IMPORT_C TPtrCName()const

The name of this linked typeface

NewLC(const TDesC &)

IMPORT_C CLinkedTypefaceSpecification *NewLC(const TDesC &aTypefaceName)[static]

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

The specification must contain at least one group and one typeface in order for registration to be successful.

Parameters

const TDesC & aTypefaceName

RegisterLinkedTypefaceL(CFbsTypefaceStore &)

IMPORT_C voidRegisterLinkedTypefaceL(CFbsTypefaceStore &aStore)

Creates the linked typeface so that it is available to use a normal typeface.

panic
EFbsPanicNoConnection There is no connection to the Font & Bitmap Server
leave
KErrNotFound One or more of the typeface elements do not exist
leave
KErrOverflow The linked typeface contains too many or 0 elements
leave
KErrArgument The typeface has no or more than one canonical element
leave
KErrAlreadyExists A typeface with the same name already exists
leave
KErrNotSupported There is not a rasterizer available that supports linked typefaces

Parameters

CFbsTypefaceStore & aStoreThe Typeface Store the linked typeface should be registered with

RemoveLinkedTypefaceGroup(TInt)

IMPORT_C TIntRemoveLinkedTypefaceGroup(TIntaGroupId)

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

Parameters

TInt aGroupIdThe Id of the group to be removed

RemoveTypeface(TInt)

IMPORT_C TIntRemoveTypeface(TIntaIndex)

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 aIndexthe index of the element spec to be removed

Typeface(TInt)

IMPORT_C CLinkedTypefaceElementSpec *Typeface(TIntaIndex)const

Returns the linked typeface at the specified index. The first typeface is at index 0, the last at TypefaceCount()-1. CLinkedTypefaceSpecification::NumberOfTypefaces()

Parameters

TInt aIndex

TypefaceCount()

IMPORT_C TIntTypefaceCount()const

The number of typeface that have been added to this object

UpdateLinkedTypefaceL(CFbsTypefaceStore &)

IMPORT_C voidUpdateLinkedTypefaceL(CFbsTypefaceStore &aStore)

Update the specification of an existing linked typeface.

Parameters

CFbsTypefaceStore & aStoreA typeface store

Member Data Documentation

CLinkedTypefaceSpecificationBody * iBody

CLinkedTypefaceSpecificationBody *iBody[private]