»
Symbian OS v6.1 Edition for C++ »
API Reference »
Fonts »
CFbsTypefaceStore
Location: fbs.h
Link against: gdi.lib
CFbsTypefaceStore
Support
Supported from 5.0
Description
Font and bitmap server typeface store.
Derivation
CBase | Base class for all classes to be instantiated on the heap |
CFbsTypefaceStore | Font and bitmap server typeface store |
CTypefaceStore | Typeface store abstract base interface |
|
Defined in CFbsTypefaceStore
:
AddFile()
, FontHeightInPixels()
, FontHeightInTwips()
, GetFontById()
, GetNearestFontInPixels()
, GetNearestFontInTwips()
, InstallFile()
, NewL()
, NumTypefaces()
, RemoveFile()
, TypefaceSupport()
, ~CFbsTypefaceStore()
Inherited from CBase
:
operator new()
Inherited from CTypefaceStore
:
BaselineOffset()
,
ReleaseFont()
,
SuperSubHeight()
Construction and destruction
static CFbsTypefaceStore* NewL(CGraphicsDevice* aDevice);
Description
Allocates and constructs a CFbsTypefaceStore
, specifying a graphics device.
Parameters
CGraphicsDevice* aDevice |
A pointer to a graphics device. |
|
Return value
CFbsTypefaceStore* |
A pointer to the newly created typeface store. |
|
~CFbsTypefaceStore();
Description
Destructor.
TInt AddFile(const TDesC& aName,TInt& aId);
Description
Adds a font store file to the typeface store.
This function adds the typeface to a reference counted list of fonts. Each client that adds the typeface to the store increases the reference count. The count is decremented when a client using the typeface is destroyed or calls the RemoveFile()
function. The typeface is removed from the store only when the the reference count is zero (it is not being used by any clients).
The InstallFile()
function is similar, except that the typeface is not reference counted, and is hence not removed when all the clients using it are destroyed.
Parameters
const TDesC& aName |
A descriptor containing the filename of the typeface store |
TInt& aId |
On return, contains the id of the typeface. |
|
Return value
TInt |
KErrNone if successful, otherwise another of the system-wide error codes. |
|
See also:
TInt FontHeightInPixels(TInt aTypefaceIndex,TInt aHeightIndex) const;
Description
Gets the height of the font with specified height and typeface indices, in pixels.
The value returned is rounded up or down to the nearest font height in pixels.
Parameters
TInt aTypefaceIndex |
A typeface index number, in the range: 0 to (NumTypefaces() - 1 ).
|
TInt aHeightIndex |
A font height index number, in the range: 0 to (iNumHeights - 1 ).
Note: TTypefaceSupport::iNumHeights is returned by TypefaceSupport() .
|
|
Return value
TInt |
The height of the font, in pixels.
|
|
virtual TInt FontHeightInTwips(TInt aTypefaceIndex,TInt aHeightIndex) const;
Description
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
TInt aTypefaceIndex
|
A typeface index number, in the range: 0 to (NumTypefaces() - 1 ).
|
TInt aHeightIndex
|
A font height index number, in the range: 0 to (iNumHeights - 1 ).
Note: TTypefaceSupport::iNumHeights is returned by TypefaceSupport() .
|
|
Return value
TInt |
The height of the font, in twips. |
|
See also:
TInt GetFontById(CFont*& aFont,TUid aUid,const TAlgStyle& aAlgStyle);
Description
Gets font by unique identifier.
Parameters
CFont*& aFont |
On return, contains a pointer to the retrieved font. |
TUid aUid |
The unique identifier of the font to be retrieved. |
const TAlgStyle& aAlgStyle
|
Algorithmic style to be applied.
e.g. Sets things like algorithmic bolding, or slant for pseudo-italics. |
|
Return value
TInt |
KErrNone if successful, otherwise another of the system-wide error codes. |
|
TInt GetNearestFontInPixels(CFont*& aFont,const TFontSpec& aFontSpec);
Description
Gets the nearest bitmap font in the current graphics map, in pixels, to the given font specification.
Parameters
CFont*& aFont |
On return, contains a pointer to the nearest bitmap font. |
const TFontSpec& aFontSpec |
The device dependent font specification of the font to be found.
|
|
Return value
TInt |
KErrNone if no nearest font can be found or if there was no error, KErrNoMemory if a nearest font can be found but no memory can be allocated to it in the font store, or another of the system-wide error codes.
|
|
virtual TInt GetNearestFontInTwips(CFont*& aFont,const TFontSpec& aFontSpec);
Description
Gets the bitmap font in the current graphics map, in twips, which is nearest to the specified font specification.
Parameters
CFont*& aFont |
On return, contains a pointer to the nearest bitmap font. |
const TFontSpec& aFontSpec |
The device independent font specification of the font to be found.
|
|
Return value
TInt |
KErrNone if no nearest font can be found or if there was no error, KErrNoMemory if a nearest font can be found but no memory can be allocated to it in the font store, or another of the system-wide error codes.
|
|
See also:
TInt InstallFile(const TDesC& aName,TInt& aId);
Description
Installs a font store file into the typeface store.
Installed files remain in the typeface store even after the client which added them is destroyed. They can be removed using RemoveFile()
.
Parameters
const TDesC& aName |
The name of the file to be installed. |
TInt& aId |
On return, contains the id of the installed file. |
|
Return value
TInt
|
KErrNone if successful, otherwise another of the system-wide error codes. |
|
See also:
virtual TInt NumTypefaces() const;
Description
Gets the number of typefaces supported by this store.
Return value
TInt
|
The number of supported typefaces.
|
|
See also:
void RemoveFile(TInt aId=0);
Description
Decrements the font store files reference count and removes the typeface when the reference count is zero.
This function decrements the reference count of a file which was added using AddFile()
, and removes it from the store if the reference count reaches zero. If the font was not found in the list of reference-counted files (see AddFile()
) it is assumed to be an installed file (see InstallFile()
) and an attempt is made to remove it anyway.
Note:
The id passed to this function has a different meaning depending on whether or not the file is a Symbian-format bitmap file. If it is a Symbian-format bitmap file the id is a UID, and is the same from one session to the next. If it is an Open Font System file (e.g., a TrueType file) the id is an arbitrary number. Consequently the id may vary from one session to the next, and should not be saved in a file — however it may be kept and used by a client as long as the client is running.
Parameters
TInt aId=0 |
The id of the file to be removed/decremented. Set by AddFile() or InstallFile() . |
|
See also:
virtual void TypefaceSupport(TTypefaceSupport& aTypefaceSupport,TInt aTypefaceIndex) const;
Description
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
TTypefaceSupport& aTypefaceSupport |
On return, if the function executed successfully, this object contains the typeface information.
|
TInt aTypefaceIndex |
A typeface index number, in the range: zero to (NumTypefaces() - 1 ).
|
|
See also: