Original Symbian headers
Selected EUSER, Window Server, networking, graphics and device declarations
Loading...
Searching...
No Matches
CTypefaceStore Class Referenceabstract

Typeface store abstract base interface. More...

#include <gdi.h>

Inheritance diagram for CTypefaceStore:
CBase

Public Member Functions

IMPORT_C ~CTypefaceStore ()
 Destroys the typeface store and reclaims the memory allocated to it.
 
virtual TInt GetNearestFontInTwips (CFont *&aFont, const TFontSpec &aFontSpec)=0
 
virtual TInt GetNearestFontToDesignHeightInTwips (CFont *&aFont, const TFontSpec &aFontSpec)=0
 
virtual TInt GetNearestFontToMaxHeightInTwips (CFont *&aFont, const TFontSpec &aFontSpec, TInt aMaxHeight)=0
 
virtual TInt NumTypefaces () const =0
 Gets the number of typefaces supported by the typeface store.
 
virtual void TypefaceSupport (TTypefaceSupport &aTypefaceSupport, TInt aTypefaceIndex) const =0
 Gets typeface information for a specified typeface index.
 
virtual TInt FontHeightInTwips (TInt aTypefaceIndex, TInt aHeightIndex) const =0
 Gets the height of the font with specified height and typeface indices, in twips.
 
IMPORT_C void ReleaseFont (CFont *aFont)
 Releases the hold of a typeface store client on a specified font.
 
- Public Member Functions inherited from CBase
 CBase ()
 Default constructor.
 
virtual IMPORT_C ~CBase ()
 Virtual destructor.
 
TAny * operator new (TUint aSize, TAny *aBase) __NO_THROW
 Initialises the object to binary zeroes.
 
TAny * operator new (TUint aSize) __NO_THROW
 Allocates the object from the heap and then initialises its contents to binary zeroes.
 
TAny * operator new (TUint aSize, TLeave)
 Allocates the object from the heap and then initialises its contents to binary zeroes.
 
TAny * operator new (TUint aSize, TUint aExtraSize) __NO_THROW
 Allocates the object from the heap and then initialises its contents to binary zeroes.
 
TAny * operator new (TUint aSize, TLeave, TUint aExtraSize)
 Allocates the object from the heap and then initialises its contents to binary zeroes.
 

Static Public Member Functions

static IMPORT_C TInt BaselineOffset (TInt aHeight, TFontPrintPosition aPos)
 Gets the baseline offset, in twips, for any font in subscript or superscript form.
 
static IMPORT_C TInt SuperSubHeight (TInt aHeight, TFontPrintPosition aPos)
 Gets the height for a font in subscript or superscript form.
 
- Static Public Member Functions inherited from CBase
static IMPORT_C void Delete (CBase *aPtr)
 Deletes the specified object.
 

Protected Member Functions

IMPORT_C CTypefaceStore ()
 
IMPORT_C void ConstructL ()
 Second phase constructor.
 
IMPORT_C void AddFontL (CFont *aFont)
 Adds a hold, by a client of the typeface store, on the specified font.
 
IMPORT_C TBool IncrementFontCount (const CFont *aFont)
 Search for the font in iFontAccess and increment its count.
 
- Protected Member Functions inherited from CBase
virtual IMPORT_C TInt Extension_ (TUint aExtensionId, TAny *&a0, TAny *a1)
 Extension function.
 

Protected Attributes

CArrayFixFlat< TFontAccess > * iFontAccess
 A list of fonts accessed by clients of the typeface store, which pairs a font with a count of the number of clients accessing the font.
 

Detailed Description

Typeface store abstract base interface.

This class provides the interface to a store for typefaces.

See also CFontStore.

API status
Published to all clients. Released API.

Definition at line 864 of file gdi.h.

Constructor & Destructor Documentation

◆ ~CTypefaceStore()

IMPORT_C CTypefaceStore::~CTypefaceStore ( )

Destroys the typeface store and reclaims the memory allocated to it.

(generated from Symbian Developer Library)

◆ CTypefaceStore()

IMPORT_C CTypefaceStore::CTypefaceStore ( )
protected

Member Function Documentation

◆ AddFontL()

IMPORT_C void CTypefaceStore::AddFontL ( CFont *  aFont)
protected

Adds a hold, by a client of the typeface store, on the specified font.

If the specified font is not currently accessed by any clients of the typeface store then the font is added to the font list and the access count set to 1. If it is currently accessed then the access count for the font is incremented by 1.

Parameters
aFontPointer to the device specific font accessed.

(generated from Symbian Developer Library)

◆ BaselineOffset()

static IMPORT_C TInt CTypefaceStore::BaselineOffset ( TInt  aHeight,
TFontPrintPosition  aPos 
)
static

Gets the baseline offset, in twips, for any font in subscript or superscript form.

If the print position is normal then zero is returned. If it is superscript then the baseline offset returned is a percentage, KSuperscriptOffsetPercentage, of aHeight. If it is subscript then the baseline offset returned is a percentage, KSubscriptOffsetPercentage, of aHeight.

Parameters
aHeightThe height of a font.
aPosThe print position of the required font: superscript, subscript or normal.

(generated from Symbian Developer Library)

◆ ConstructL()

IMPORT_C void CTypefaceStore::ConstructL ( )
protected

Second phase constructor.

(generated from Symbian Developer Library)

◆ FontHeightInTwips()

virtual TInt CTypefaceStore::FontHeightInTwips ( TInt  aTypefaceIndex,
TInt  aHeightIndex 
) const
pure virtual

Gets the height of the font with specified height and typeface indices, in twips.

The value returned is rounded up or down to the nearest font height in twips.

Parameters
aTypefaceIndexA typeface index number, in the range: 0 to (NumTypefaces() - 1).
aHeightIndexA font height index number.
Returns
The height of the font, in twips.

◆ GetNearestFontInTwips()

TInt CTypefaceStore::GetNearestFontInTwips ( CFont *&  aFont,
const TFontSpec &  aFontSpec 
)
pure virtual
Gets the font which is the nearest to the given font specification.

When the font is no longer needed, call @c ReleaseFont().

Note that this deprecated function is replaced by the new @c GetNearestFontToDesignHeightInTwips() 
yielding (virtually) the same result. However clients are strongly encouraged to use the new
@c GetNearestFontToMaxHeightInTwips() function instead. This will guarantee that every 
character within any given text string will fit within the given amount of twips, whereas the design 
height is an aesthetic unit decided by the font designer without strict physical meaning, which 
may result in cropped characters.

@param aFont On return, contains a pointer to the nearest font.
@param aFontSpec The specification of the font to be matched.
@return KErrNone if successful; a system-wide error code otherwise.
@deprecated Use GetNearestFontToDesignHeightInTwips
API status
Published to all clients.
Parameters
aFontOn return, contains a pointer to the nearest font.
aFontSpecThe specification of the font to be matched.

(generated from Symbian Developer Library)

◆ GetNearestFontToDesignHeightInTwips()

TInt CTypefaceStore::GetNearestFontToDesignHeightInTwips ( CFont *&  aFont,
const TFontSpec &  aFontSpec 
)
pure virtual
Gets the font which is the nearest to the given font specification.

When the font is no longer needed, call @c ReleaseFont().

This new function replaces the deprecated @c GetNearestFontInTwips() yielding (virtually) the 
same result. However clients are strongly encouraged to use the new
@c GetNearestFontToMaxHeightInTwips() function instead. This will guarantee that every 
character within any given text string will fit within the given amount of twips, whereas the design 
height is an aesthetic unit decided by the font designer without strict physical meaning, which 
may result in cropped characters.

@param aFont On return, contains a pointer to the nearest font.
@param aFontSpec The specification of the font to be matched.
@return KErrNone if successful; a system-wide error code otherwise.
API status
Published to all clients. Released API.
Parameters
aFontOn return, contains a pointer to the nearest font.
aFontSpecThe specification of the font to be matched.

(generated from Symbian Developer Library)

◆ GetNearestFontToMaxHeightInTwips()

TInt CTypefaceStore::GetNearestFontToMaxHeightInTwips ( CFont *&  aFont,
const TFontSpec &  aFontSpec,
TInt  aMaxHeight 
)
pure virtual
Gets the font which is the nearest to the given font specification.

When the font is no longer needed, call @c ReleaseFont().

The font and bitmap server returns a pointer to the nearest matching font 
from those available. Matches to max height of font - this does its best 
to return a font that will fit within the maximum height specified (but 
note that variations due to hinting algorithms may rarely result in this 
height being exceeded by up to one pixel). Problems can also be 
encountered with bitmap fonts where the typeface exists but doesn't have 
a font small enough.

@param aFont On return, contains a pointer to the nearest font.
@param aFontSpec The specification of the font to be matched.
@param aMaxHeight The maximum height within which the font must fit.
@return KErrNone if successful; a system-wide error code otherwise.
API status
Published to all clients. Released API.
Parameters
aFontOn return, contains a pointer to the nearest font.
aFontSpecThe specification of the font to be matched.
aMaxHeightThe maximum height within which the font must fit.

(generated from Symbian Developer Library)

◆ IncrementFontCount()

IMPORT_C TBool CTypefaceStore::IncrementFontCount ( const CFont *  aFont)
protected

Search for the font in iFontAccess and increment its count.

Parameters
aFontFont to search for.

(generated from Symbian Developer Library)

◆ NumTypefaces()

virtual TInt CTypefaceStore::NumTypefaces ( ) const
pure virtual

Gets the number of typefaces supported by the typeface store.

Returns
The number of supported typefaces.

◆ ReleaseFont()

IMPORT_C void CTypefaceStore::ReleaseFont ( CFont *  aFont)

Releases the hold of a typeface store client on a specified font.

Decrements the access-count for the specified font by one. If this reduces the access-count to zero then the font is no longer needed by any client, and is deleted from the typeface store list.

Parameters
aFontThe font to be released by the client.

(generated from Symbian Developer Library)

◆ SuperSubHeight()

static IMPORT_C TInt CTypefaceStore::SuperSubHeight ( TInt  aHeight,
TFontPrintPosition  aPos 
)
static

Gets the height for a font in subscript or superscript form.

If the print position is normal then aHeight is returned unchanged. If it is superscript or subscript then the height returned is a percentage, KSuperSubScalingPercentage, of aHeight.

Parameters
aHeightThe height of a font.
aPosThe print position of the font: superscript, subscript or normal.

(generated from Symbian Developer Library)

◆ TypefaceSupport()

virtual void CTypefaceStore::TypefaceSupport ( TTypefaceSupport &  aTypefaceSupport,
TInt  aTypefaceIndex 
) const
pure virtual

Gets typeface information for a specified typeface index.

This information is returned in aTypefaceSupport, and includes the typeface name and typeface attributes, the number of font heights, the maximum and minimum font heights, and whether it is a scaleable typeface.

Parameters
aTypefaceSupportOn return, if the function executed successfully, this object contains the typeface information.
aTypefaceIndexA typeface index number, in the range: zero to (NumTypefaces() - 1).

Member Data Documentation

◆ iFontAccess

CArrayFixFlat<TFontAccess>* CTypefaceStore::iFontAccess
protected

A list of fonts accessed by clients of the typeface store, which pairs a font with a count of the number of clients accessing the font.

Implemented as an array of TFontAccess objects.

An object is added to this array for every font accessed. If the font is released by all clients, and the access count drops to zero, the font is removed from the list.

Definition at line 996 of file gdi.h.


The documentation for this class was generated from the following files: