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.
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) |
Private Attributes | |
---|---|
RPointerArray< CLinkedTypefaceGroup > | iGroups |
HBufC * | iLinkedTypefaceFileName |
HBufC * | iLinkedTypefaceName |
RPointerArray< COpenFontLinkedTypefaceElementSpec > | iTypefaces |
IMPORT_C | ~COpenFontLinkedTypefaceSpecification | ( | ) |
Default destructor
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
CLinkedTypefaceGroup & aGroup | The group to be added |
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()
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
COpenFontLinkedTypefaceElementSpec & aElementSpec |
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()
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
COpenFontLinkedTypefaceElementSpec & aElementSpec | The specification to be added. |
TInt aIndex | The position at which the element spec will be added. |
IMPORT_C TInt | CanonicalIndex | ( | ) | const |
Returns the index of the canonical (metrics) typeface.
The can be retrieved by passing the index to Typeface().
The index to the canonical typeface; KErrNoFound The canonical doesn't exist; KErrOverflow There is more than one canonical
void | ConstructL | ( | const TLinkedTypefaceSpecificationArgs & | aSpecArgs | ) | [private] |
const TLinkedTypefaceSpecificationArgs & aSpecArgs |
void | DoAddTypefaceL | ( | COpenFontLinkedTypefaceElementSpec & | aElementSpec, |
TInt | aPos | |||
) | [private] |
COpenFontLinkedTypefaceElementSpec & aElementSpec | |
TInt aPos |
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.
The linked typeface group specified or NULL if it doesn't exist
TInt aIndex |
IMPORT_C CLinkedTypefaceGroup * | GroupById | ( | TInt | aGroupId | ) | const |
Returns the linked typeface group with the specified group ID.
The linked typeface group specified or NULL if it doesn't exist
TInt aGroupId | The linked typeface group ID |
IMPORT_C TInt | GroupCount | ( | ) | const |
Returns the number of groups that this linked typeface specification contains.
CLinkedTypefaceSpecification::Group()
TInt Number of groups
IMPORT_C TPtrC | Name | ( | ) | const |
Returns the name of this linked typeface The name of this linked typeface
IMPORT_C COpenFontLinkedTypefaceSpecification * | NewLC | ( | const TDesC & | aName | ) | [static] |
This function constructs the linked typeface specification and places it on the CleanupStack.
CLinkedTypefaceSpecification* A linked typeface specification object
const TDesC & aName | The name of the linked typeface. This name should not be the same as an existing typeface. |
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.
A linked typeface specification object
const TLinkedTypefaceSpecificationArgs & aSpecArgs | The TLinkedTypefaceSpecificationArgs container passed from font and bitmap server |
IMPORT_C TInt | RemoveLinkedTypefaceGroup | ( | TInt | aGroupId | ) |
This will remove the group and all the elements associated with it.
TInt aGroupId | The Id of the group to be removed |
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.
KErrNotFound If the index is negative or larger than the number of typeface elements or the element doesn't exist
TInt aIndex | the index of the element spec to be removed |
IMPORT_C COpenFontLinkedTypefaceElementSpec * | Typeface | ( | TInt | aIndex | ) | const |
Returns the linked typeface at the specified index.
The linked typeface; NULL if there is no typeface at the specified index
COpenFontLinkedTypefaceSpecification::NumberOfTypefaces()
TInt aIndex |
IMPORT_C TInt | TypefaceCount | ( | ) | const |
Returns the number of typefaces that have been added to this specification The number of typefaces that have been added to this specification
RPointerArray< COpenFontLinkedTypefaceElementSpec > | iTypefaces | [private] |