Location:
FNTSTORE.H
Link against: fntstr.lib
class CFontStore : public CTypefaceStore;
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.
CBase
- Base class for all classes to be instantiated on the heap
CTypefaceStore
- Typeface store abstract base interface
CFontStore
- A store for fonts
Defined in CFontStore
:
AddFileL()
, DefaultBitmapType()
, DeleteSessionCache()
, FontHeightInPixels()
, FontHeightInTwips()
, GetFontById()
, GetNearestFontInPixels()
, GetNearestFontInPixels()
, GetNearestFontInTwips()
, GetNearestFontToDesignHeightInPixels()
, GetNearestFontToDesignHeightInPixels()
, GetNearestFontToDesignHeightInTwips()
, GetNearestFontToMaxHeightInPixels()
, GetNearestFontToMaxHeightInPixels()
, GetNearestFontToMaxHeightInTwips()
, InstallRasterizerL()
, InstallShaperFactoryL()
, NewL()
, NumTypefaces()
, RemoveFile()
, SetDefaultBitmapType()
, TypefaceSupport()
, iKPixelHeightInTwips
, iKPixelWidthInTwips
, ~CFontStore()
Inherited from CBase
:
Delete()
,
Extension_()
,
operator new()
Inherited from CTypefaceStore
:
AddFontL()
,
BaselineOffset()
,
ConstructL()
,
IncrementFontCount()
,
ReleaseFont()
,
SuperSubHeight()
,
iFontAccess
static IMPORT_C CFontStore *NewL(RHeap *aHeap);
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 .
|
|
|
IMPORT_C TUid AddFileL(const TDesC &aName);
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.
|
|
|
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 is removed from the font store, as well as the fonts and typefaces associated with this file.
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. However, in this case the function first checks that no fonts in the font store are being accessed (i.e. iFontAccess is empty); if one or more fonts are being accessed then a panic is raised with the value EFntFontAccessCountNonZero.
(If aFileUid is invalid, then no objects are removed.)
|
IMPORT_C TInt GetNearestFontInPixels(CFont *&aFont, const TFontSpec &aFontSpec);
Gets the font which is the nearest to the given font specification.
|
|
IMPORT_C TInt GetNearestFontToDesignHeightInPixels(CFont *&aFont, const TFontSpec &aFontSpec);
Gets the font which is the nearest to the given font specification. Matching to design height gives no guarantees on the actual physical size of the font.
|
|
IMPORT_C TInt GetNearestFontToMaxHeightInPixels(CFont *&aFont, const TFontSpec &aFontSpec, TInt aMaxHeight);
Gets the font which is the nearest to the given font specification. Matching to maximum height returns a font that will fit within the height specified.
|
|
IMPORT_C TInt GetNearestFontInTwips(CFont *&aFont, const TOpenFontSpec &aFontSpec);
Gets the font which is the nearest to the given font specification.
|
|
IMPORT_C TInt GetNearestFontInPixels(CFont *&aFont, const TOpenFontSpec &aFontSpec);
Gets the font which is the nearest to the given font specification.
|
|
IMPORT_C TInt GetNearestFontToDesignHeightInTwips(CFont *&aFont, const TOpenFontSpec &aFontSpec);
Gets the font which is the nearest to the given font specification. Matching to design height gives no guarantees on the actual physical size of the font.
|
|
IMPORT_C TInt GetNearestFontToDesignHeightInPixels(CFont *&aFont, const TOpenFontSpec &aFontSpec);
Gets the font which is the nearest to the given font specification. Matching to design height gives no guarantees on the actual physical size of the font.
|
|
IMPORT_C TInt GetNearestFontToMaxHeightInTwips(CFont *&aFont, const TOpenFontSpec &aFontSpec, TInt aMaxHeight);
Gets the font which is the nearest to the given font specification. Matching to maximum height returns a font that will fit within the height specified.
|
|
IMPORT_C TInt GetNearestFontToMaxHeightInPixels(CFont *&aFont, const TOpenFontSpec &aFontSpec, TInt aMaxHeight);
Gets the font which is the nearest to the given font specification. Matching to maximum height returns a font that will fit within the height specified.
|
|
IMPORT_C TInt GetFontById(CFont *&aFont, TUid aUid, const TAlgStyle &aAlgStyle);
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.
|
|
virtual IMPORT_C TInt NumTypefaces() const;
Gets the number of typefaces held in the font store.
Note that this includes both open font typefaces and non-scalable typefaces.
|
virtual IMPORT_C void TypefaceSupport(TTypefaceSupport &aTypefaceSupport, TInt aTypefaceIndex) 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.
|
virtual IMPORT_C TInt FontHeightInTwips(TInt aTypefaceIndex, TInt aHeightIndex) 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.
|
|
IMPORT_C TInt FontHeightInPixels(TInt aTypefaceIndex, TInt aHeightIndex) const;
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.
|
|
IMPORT_C void InstallRasterizerL(COpenFontRasterizer *aRasterizer);
Installs and takes ownership of an Open Font rasterizer.
|
IMPORT_C void DeleteSessionCache(TInt aSessionHandle);
Deletes the glyph cache belonging to a particular client.
Called by ~CFbClient().
|
inline TGlyphBitmapType DefaultBitmapType() const;
Returns a default bitmap type.
|
inline void SetDefaultBitmapType(TGlyphBitmapType aType);
Sets a default bitmap type.
|
IMPORT_C void InstallShaperFactoryL(CShaperFactory *aShaperFactory);
Install and takes ownership of the shaper
|
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.
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.