#include <fntstore.h>
class CFontStore : public CTypefaceStore |
Public Attributes | |
---|---|
TInt | iKPixelHeightInTwips |
TInt | iKPixelWidthInTwips |
Inherited Attributes | |
---|---|
CTypefaceStore::iFontAccess |
A store for fonts.
Stores and handles both open and fixed-size fonts. Open fonts are made from open (scalable) typefaces by Open Font plug-in rasterizers. Fonts of other typefaces are stored in a limited number of fixed sizes. However, which is being used is transparent to the user of this class. For example the GetNearestFont...() functions get a bitmap font which may be retrieved from memory or generated via a rasterizer.
TInt | iKPixelHeightInTwips |
The height of 1000 pixels in twips.
This is set in the constructor. If the appropriate HALData attributes are set (EDisplayYPixels and EDisplayYTwips) then the value is calculated using these; otherwise the value is set to 11860.
TInt | iKPixelWidthInTwips |
The width of 1000 pixels in twips.
This is set in the constructor. If the appropriate HALData attributes are set (EDisplayXPixels and EDisplayXTwips) then the value is calculated using these; otherwise the value is set to 11860.
Finds or creates a font file object to support a font file. The specified font file must be accessible to any process, i.e. not located inside an application's private directory.
If an appropriate font file object exists then no new open font file is created. In this case the reference count of the font file object is incremented.
Notes:
If aName is recognised as an open font file, creates a COpenFontFile, which will manage the font file specified by aName, and adds it to the file store's list of open font files.
The list of open font files is used when getting the nearest font for a font specification (i.e. by the GetNearestFont...() functions of this class) if the font is generated via a rasterizer.
The appropriate rasterizer, which supports the font format of the font file, is used to generate the open font file using COpenFontRasterizer::NewFontFileL().
If aName is not recognised as an open font file then CFontStoreFile tries to open the file as a Symbian Bitmap font.
Parameter | Description |
---|---|
aName | The full path and filename of the font file to be supported. |
Returns: The UID of the font file object supporting aName.
IMPORT_C TInt | CreateLinkedTypeface | ( | const TLinkedTypefaceSpecificationArgs & | aLinkedTypefaceSpec, |
TInt | aSession, | |||
TInt & | aId | |||
) |
TGlyphBitmapType | DefaultBitmapType | ( | ) | const [inline] |
Returns a default bitmap type.
See also: TGlyphBitmapType
Returns: A default bitmap type.
IMPORT_C void | DeleteSessionCache | ( | TInt | aSessionHandle | ) |
Deletes the glyph cache belonging to a particular client.
Called by ~CFbClient().
Parameter | Description |
---|---|
aSessionHandle | A session handle. |
Returns a font height, in pixels, for a certain typeface and height index.
The font height is a height allowed for the typeface represented by aTypefaceIndex. The height returned increases with aHeightIndex.
If aTypefaceIndex<0 the function panics with EFntTypefaceIndexOutOfRange. If aTypefaceIndex is greater than the number of typefaces or aHeightIndex<0 then the function returns 0. If aHeightIndex is greater than the number of heights then the function returns the biggest height.
See also: TypefaceSupport()
Parameter | Description |
---|---|
aTypefaceIndex | An index number representing a typeface, which is valid in the range 0 to (NumTypefaces() - 1). |
aHeightIndex | A font height index number, which is valid in the range 0 to (TTypefaceSupport::iNumHeights - 1). Note that the typeface support object for the typeface can be got using TypefaceSupport(). |
Returns: The height of a font, in pixels.
Reimplemented from CTypefaceStore::FontHeightInTwips(TInt,TInt)const
Returns a font height, in twips, for a certain typeface and height index.
The font height is a height allowed for the typeface represented by aTypefaceIndex. The height returned increases with aHeightIndex.
If aTypefaceIndex<0 the function panics with EFntTypefaceIndexOutOfRange. If aTypefaceIndex is greater than the number of typefaces or aHeightIndex<0 then the function returns 0. If aHeightIndex is greater than the number of heights then the function returns the biggest height.
See also: TypefaceSupport()
Parameter | Description |
---|---|
aTypefaceIndex | An index number representing a typeface, which is valid in the range 0 to (NumTypefaces() - 1). |
aHeightIndex | A font height index number, which is valid in the range 0 to (TTypefaceSupport::iNumHeights - 1). Note that the typeface support object for the typeface can be got using TypefaceSupport(). |
Returns: The height of a font, in twips.
Gets a bitmap font using the given font UID and algorithmic style.
Tries to find a bitmap font in the font store with the given UID. If successful, the given algorithmic style is applied to the font and this font (which may be a suitable one already existing in the store, or may be a newly generated font) is stored in aFont. If unsuccessful then no font is stored in aFont.
Parameter | Description |
---|---|
aFont | On return, a device-dependent font. |
aUid | A bitmap font UID. |
aAlgStyle | An algorithmic style to apply to the font. |
Returns: KErrNone if the font is found, KErrNotFound if the font is not found, or another system-wide error code.
Retrieves the full path and filename of the font with the specified name. This function searches through all open font files currently loaded by font store.
Parameter | Description |
---|---|
aFontName | The full name of the font to search for |
aFilePath | An empty descriptor to have the file name filled in |
Returns: ETrue if the font is found; EFalse if not
IMPORT_C void | GetLinkedTypefaceL | ( | TLinkedTypefaceSpecificationArgs & | aLinkedTypefaceSpec | ) |
Gets the font which is the nearest to the given font specification.
Note that this deprecated function is replaced by the new GetNearestFontToDesignHeightInPixels() yielding (virtually) the same result. However clients are strongly encouraged to use the new GetNearestFontToMaxHeightInPixels() function instead. This will guarantee that every character within any given text string will fit within the given amount of pixels, whereas the design height is an aesthetic unit decided by the font designer without strict physical meaning, which may result in cropped characters.
DeprecatedUse GetNearestFontToDesignHeightInPixels
Parameter | Description |
---|---|
aFont | On return, contains a pointer to the nearest font. |
aFontSpec | The specification of the font to be matched. |
Returns: KErrNone if successful; a system-wide error code otherwise.
IMPORT_C TInt | GetNearestFontInPixels | ( | CFont *& | aFont, |
const TOpenFontSpec & | aFontSpec | |||
) |
Gets the font which is the nearest to the given font specification.
Note that this deprecated function is replaced by the new GetNearestFontToDesignHeightInPixels() yielding (virtually) the same result. However clients are strongly encouraged to use the new GetNearestFontToMaxHeightInPixels() function instead. This will guarantee that every character within any given text string will fit within the given amount of pixels, whereas the design height is an aesthetic unit decided by the font designer without strict physical meaning, which may result in cropped characters.
DeprecatedUse GetNearestFontToDesignHeightInPixels
Parameter | Description |
---|---|
aFont | On return, contains a pointer to the nearest font. |
aFontSpec | The specification of the font to be matched. |
Returns: KErrNone if successful; a system-wide error code otherwise.
Reimplemented from CTypefaceStore::GetNearestFontInTwips(CFont *&,const TFontSpec &)
IMPORT_C TInt | GetNearestFontInTwips | ( | CFont *& | aFont, |
const TOpenFontSpec & | aFontSpec | |||
) |
Gets the font which is the nearest to the given font specification.
Note that this deprecated function is replaced by the new GetNearestFontToDesignHeightInTwips() yielding (virtually) the same result. However clients are strongly encouraged to use the new 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.
DeprecatedUse GetNearestFontToDesignHeightInTwips
Parameter | Description |
---|---|
aFont | On return, contains a pointer to the nearest font. |
aFontSpec | The specification of the font to be matched. |
Returns: KErrNone if successful; a system-wide error code otherwise.
Gets the font which is the nearest to the given font specification.
This new function replaces the deprecated GetNearestFontInPixels() yielding (virtually) the same result. However clients are strongly encouraged to use the new GetNearestFontToMaxHeightInPixels() function instead. This will guarantee that every character within any given text string will fit within the given amount of pixels, whereas the design height is an aesthetic unit decided by the font designer without strict physical meaning, which may result in cropped characters.
Parameter | Description |
---|---|
aFont | On return, contains a pointer to the nearest font. |
aFontSpec | The specification of the font to be matched. |
Returns: KErrNone if successful; a system-wide error code otherwise.
IMPORT_C TInt | GetNearestFontToDesignHeightInPixels | ( | CFont *& | aFont, |
const TOpenFontSpec & | aFontSpec | |||
) |
Gets the font which is the nearest to the given font specification.
This new function replaces the deprecated GetNearestFontInPixels() yielding (virtually) the same result. However clients are strongly encouraged to use the new GetNearestFontToMaxHeightInPixels() function instead. This will guarantee that every character within any given text string will fit within the given amount of pixels, whereas the design height is an aesthetic unit decided by the font designer without strict physical meaning, which may result in cropped characters.
Parameter | Description |
---|---|
aFont | On return, contains a pointer to the nearest font. |
aFontSpec | The specification of the font to be matched. |
Returns: KErrNone if successful; a system-wide error code otherwise.
IMPORT_C TInt | GetNearestFontToDesignHeightInTwips | ( | CFont *& | aFont, |
const TOpenFontSpec & | aFontSpec | |||
) |
Gets the font which is the nearest to the given font specification.
This new function replaces the deprecated GetNearestFontInTwips() yielding (virtually) the same result. However clients are strongly encouraged to use the new 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.
Parameter | Description |
---|---|
aFont | On return, contains a pointer to the nearest font. |
aFontSpec | The specification of the font to be matched. |
Returns: KErrNone if successful; a system-wide error code otherwise.
IMPORT_C TInt | GetNearestFontToMaxHeightInPixels | ( | CFont *& | aFont, |
const TFontSpec & | aFontSpec, | |||
TInt | aMaxHeight | |||
) |
Gets the font which is the nearest to the given font specification.
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.
Parameter | Description |
---|---|
aFont | On return, contains a pointer to the nearest font. |
aFontSpec | The specification of the font to be matched. |
aMaxHeight | The maximum height within which the font must fit. If maximum height is greater than 1024 pixels, the function returns KErrTooBig. And returns KErrArgument if equals to 1 pixel. This overrides the height specified in aFontSpec. |
Returns: KErrNone if successful; a system-wide error code otherwise.
IMPORT_C TInt | GetNearestFontToMaxHeightInPixels | ( | CFont *& | aFont, |
const TOpenFontSpec & | aFontSpec, | |||
TInt | aMaxHeight | |||
) |
Gets the font which is the nearest to the given font specification.
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.
Parameter | Description |
---|---|
aFont | On return, contains a pointer to the nearest font. |
aFontSpec | The specification of the font to be matched. |
aMaxHeight | The maximum height within which the font must fit. If maximum height is greater than 1024 pixels, the function returns KErrTooBig. And returns KErrArgument if equals to 1 pixel. This overrides the height specified in aFontSpec. |
Returns: KErrNone if successful; a system-wide error code otherwise.
IMPORT_C TInt | GetNearestFontToMaxHeightInTwips | ( | CFont *& | aFont, |
const TOpenFontSpec & | aFontSpec, | |||
TInt | aMaxHeight | |||
) |
Gets the font which is the nearest to the given font specification.
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.
Parameter | Description |
---|---|
aFont | On return, contains a pointer to the nearest font. |
aFontSpec | The specification of the font to be matched. |
aMaxHeight | The maximum height within which the font must fit. If maximum height is greater than 1024 pixels, the function returns KErrTooBig. And returns KErrArgument if equals to 1 pixel. This overrides the height specified in aFontSpec. |
Returns: KErrNone if successful; a system-wide error code otherwise.
CArrayPtrFlat< COpenFontFile > * | GetOpenFontFileList | ( | ) |
Returns the list of COpenFontFiles owned by the CFontStore object
COpenFontSessionCacheList * | GetSessionCacheList | ( | ) |
Returns the list of session caches owned by the COpenFonts
TInt | GetShaperCacheMemUsage | ( | ) |
Returns the total cache memory used by all the COpenFonts in the system
Returns: Total cache memory usage
This function checks the supplied typeface name against the existing bitmap and open typefaces, to see if it present.
Parameter | Description |
---|---|
aName | The name of the typeface family name to be checked. |
Returns: ETrue if the typeface is present, EFalse otherwise.
IMPORT_C void | InstallRasterizerL | ( | COpenFontRasterizer * | aRasterizer | ) |
Installs and takes ownership of an Open Font rasterizer.
Parameter | Description |
---|---|
aRasterizer | A pointer to an Open Font rasterizer. |
IMPORT_C void | InstallShaperFactoryL | ( | CShaperFactory * | aShaperFactory | ) |
Install and takes ownership of the shaper
Parameter | Description |
---|---|
aShaperFactory | A pointer to a shaper factory. |
IMPORT_C void | LoadFontsAtStartupL | ( | ) |
Performs the loading of font files at boot time. This is a three stage procedure.
1. Copies linked fonts to be updated from their temporary directory into the linked fonts folder 2. Loads all the linked fonts from the linked fonts folder. 3. Loads all remaining font files from *:
IMPORT_C CFontStore * | NewL | ( | RHeap * | aHeap | ) | [static] |
Creates a new CFontStore object.
Sets iKPixelWidthInTwips and iKPixelHeightInTwips.
Sets the default bitmap type, used when getting bitmap fonts, to EMonochromeGlyphBitmap.
Also initialises other private member variable values .
Parameter | Description |
---|---|
aHeap | A pointer to the heap class used for memory allocation. |
IMPORT_C TInt | NumTypefaces | ( | ) | const [virtual] |
Reimplemented from CTypefaceStore::NumTypefaces()const
Gets the number of typefaces held in the font store.
Note that this includes both open font typefaces and non-scalable typefaces.
Returns: The number of supported typefaces.
IMPORT_C void | RemoveFile | ( | TUid | aFileUid | ) |
Releases a hold on one or all font file objects (COpenFontFiles or CFontStoreFiles).
If aFileUid identifies a font file object, then the reference count for this object is decremented. If this brings the reference count down to zero then the font file object and typefaces associated with this file are removed from the font store, provided no fonts associated with this file are being accessed. If one or more fonts are being accessed then the file removal request will be ignored.
If, on the other hand, aFileUid's value is NULL, then all font file objects are removed, along with all fonts and typefaces in the font store, provided that no fonts in the font store are being accessed (i.e. iFontAccess is empty), otherwise it has no effect.
(If aFileUid is invalid, then no objects are removed.)
Parameter | Description |
---|---|
aFileUid | UID of a hold on a font file object to be released, or KNullUid if all font file objects are to be removed. |
void | SetDefaultBitmapType | ( | TGlyphBitmapType | aType | ) | [inline] |
Sets a default bitmap type.
See also: TGlyphBitmapType
Parameter | Description |
---|---|
aType | A default bitmap type. |
void | SetShaperCacheMemUsage | ( | TInt | aUsage | ) |
Updates the total cache memory used by all the COpenFonts in the system
Parameter | Description |
---|---|
aUsage | New value of total cache memory usage |
IMPORT_C void | TypefaceSupport | ( | TTypefaceSupport & | aTypefaceSupport, |
TInt | aTypefaceIndex | |||
) | const [virtual] |
Reimplemented from CTypefaceStore::TypefaceSupport(TTypefaceSupport &,TInt)const
Gets a typeface support object for the typeface in the font store represented by the given index.
Returns benignly with an empty TTypefaceSupport if the index is too high; this can happen if another process removes a typeface after the first process has already got the number of typefaces. However, if the aTypefaceIndex<0 the function panics with EFntTypefaceIndexOutOfRange.
Parameter | Description |
---|---|
aTypefaceSupport | On return, a typeface support object. |
aTypefaceIndex | An index number representing a typeface, which is valid if in the range 0 to (NumTypefaces() - 1). |
IMPORT_C void | UpdateLinkedTypefaceL | ( | const TLinkedTypefaceSpecificationArgs & | aLinkedTypefaceSpec | ) |