sl@0: /* sl@0: * Copyright (c) 1995-2010 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * sl@0: */ sl@0: sl@0: sl@0: #ifndef FNTSTORE_H__ sl@0: #define FNTSTORE_H__ sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: sl@0: /** Defines the maximum number of linked typefaces that may be placed in a linked typeface specification sl@0: WARNING: Constant for internal use ONLY. Compatibility is not guaranteed in future releases. sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: const TInt KMaxLinkedTypefaces = 12; sl@0: /** Defines the maximum number of linked typeface groups that may be placed in a linked typeface specification sl@0: WARNING: Constant for internal use ONLY. Compatibility is not guaranteed in future releases. sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: const TInt KMaxLinkedTypefaceGroups = 12; sl@0: sl@0: class CLinkedTypefaceSpecification; sl@0: class TLinkedTypefaceSpecificationArgs; sl@0: class CFbClient; sl@0: class CFontStoreFile; sl@0: class CFontBitmap; sl@0: class RReadStream; sl@0: class TTypefaceFontBitmap; sl@0: class TShapeHeader; sl@0: class TShapeMessageParameters; sl@0: class CTypefaceSupportInfo; sl@0: class COpenFontRasterizer; sl@0: class CLinkedTypefaceGroup; sl@0: IMPORT_C extern const TInt8 KLinkedFontDrive; sl@0: IMPORT_C extern const TUint32 KFontTable_GlyphOutline_CacheMaxMem; sl@0: sl@0: /** sl@0: WARNING: Class for internal use ONLY. Compatibility is not guaranteed in future releases. sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: class TCharacterMetrics sl@0: { sl@0: public: sl@0: IMPORT_C TCharacterMetrics(); sl@0: sl@0: public: sl@0: TInt16 iAscentInPixels; sl@0: TInt16 iHeightInPixels; sl@0: TInt16 iLeftAdjustInPixels; sl@0: TInt16 iMoveInPixels; sl@0: TInt16 iRightAdjustInPixels; sl@0: }; sl@0: sl@0: /** sl@0: An algorithmic style for how a font is drawn. sl@0: sl@0: Holds attributes such as whether the font is bold or italic, and the width sl@0: and height factors. This is used as an input parameter for the GetFontById() method sl@0: of some font management classes. See CWsScreenDevice::GetFontById() for more information. sl@0: @publishedAll sl@0: @released sl@0: @see CWsScreenDevice::GetFontById() sl@0: @see CFbsTypefaceStore::GetFontById() sl@0: @see CFbsDevice::GetFontById() sl@0: */ sl@0: class TAlgStyle sl@0: { sl@0: public: sl@0: IMPORT_C TAlgStyle(); sl@0: IMPORT_C void SetIsBold(TBool aIsBold); sl@0: IMPORT_C void SetIsItalic(TBool aIsItalic); sl@0: IMPORT_C void SetIsMono(TBool aIsMono); sl@0: IMPORT_C void SetWidthFactor(TInt aWidthFactor); sl@0: IMPORT_C void SetHeightFactor(TInt aHeightFactor); sl@0: IMPORT_C TBool IsBold() const; sl@0: IMPORT_C TBool IsItalic() const; sl@0: IMPORT_C TBool IsMono() const; sl@0: IMPORT_C TInt WidthFactor() const; sl@0: IMPORT_C TInt HeightFactor() const; sl@0: IMPORT_C TBool operator==(const TAlgStyle& aAlgStyle) const; sl@0: TBool operator!=(const TAlgStyle& aAlgStyle) const; sl@0: public: sl@0: /** Baseline offset in pixels. */ sl@0: TInt iBaselineOffsetInPixels; sl@0: private: sl@0: enum sl@0: { sl@0: EBold=1, sl@0: EItalic=2, sl@0: EMono=4, sl@0: }; sl@0: /** This member is private and not intended for use. */ sl@0: TInt8 iFlags; sl@0: /** This member is private and not intended for use. */ sl@0: TInt8 iWidthFactor; sl@0: /** This member is private and not intended for use. */ sl@0: TInt8 iHeightFactor; sl@0: }; sl@0: sl@0: /** sl@0: Bitmap font class. sl@0: An object of this class may either access and use a bitmap font (a CFontBitmap) sl@0: or an open font (a COpenFont). sl@0: Stored in a CFontStore. sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: class CBitmapFont : public CFont sl@0: { sl@0: friend class CFbsFont; sl@0: friend class CFontStore; sl@0: friend class CFbsBitGc; sl@0: public: sl@0: // New functions sl@0: TUid Uid() const; sl@0: IMPORT_C TCharacterMetrics CharacterMetrics(TInt aCode,const TUint8*& aBytes) const; sl@0: IMPORT_C TBool GetCharacterData(TInt aSessionHandle, TInt aCode, TOpenFontCharMetrics& aMetrics, const TUint8*& aBitmap) const; sl@0: IMPORT_C TBool Rasterize(TInt aSessionHandle,TInt aCode,TOpenFontGlyphData* aGlyphData) const; sl@0: IMPORT_C void GetFontMetrics(TOpenFontMetrics& aMetrics) const; sl@0: IMPORT_C TBool GetFaceAttrib(TOpenFontFaceAttrib& aAttrib) const; sl@0: IMPORT_C TInt BitmapEncoding() const; sl@0: IMPORT_C TBool HasCharacterL(TInt aCode) const; sl@0: IMPORT_C TBool CharacterNeedsToBeRasterized(TInt aSessionHandle,TInt aCode) const; sl@0: IMPORT_C TShapeHeader* ShapeTextL(const TDesC16& aText, sl@0: TInt aSessionHandle, const TShapeMessageParameters& aParams); sl@0: IMPORT_C void DeleteShape(TInt aSessionHandle,TShapeHeader* aHeader); sl@0: IMPORT_C void operator delete(TAny*); sl@0: inline TBool IsOpenFont() const; sl@0: inline COpenFont* OpenFont() const; sl@0: inline TGlyphBitmapType GlyphBitmapType() const; sl@0: IMPORT_C TUint32 UniqueFontId(); sl@0: IMPORT_C TInt GetFontTable(TUint32 aTag, TAny*& aTableContent, sl@0: TInt& aLength, TInt aSessionHandle); sl@0: IMPORT_C TInt GetGlyphOutline(TUint aCode, sl@0: TBool aHinted, TAny*& aOutline, TInt& aLength, TInt aSessionHandle); sl@0: IMPORT_C void ReleaseGlyphOutlines(TInt aCount, const TUint* aCodes, sl@0: TBool aHinted, TInt aSessionHandle); sl@0: IMPORT_C void ReleaseFontTable(TUint32 aTag, TInt aSessionHandle); sl@0: sl@0: private: sl@0: // From CFont sl@0: IMPORT_C virtual TUid DoTypeUid() const; sl@0: IMPORT_C virtual TInt DoHeightInPixels() const; sl@0: IMPORT_C virtual TInt DoAscentInPixels() const; sl@0: IMPORT_C virtual TInt DoCharWidthInPixels(TChar aChar) const; sl@0: IMPORT_C virtual TInt DoTextWidthInPixels(const TDesC &aText) const; sl@0: IMPORT_C virtual TInt DoBaselineOffsetInPixels() const; sl@0: IMPORT_C virtual TInt DoTextCount(const TDesC &aText, TInt aWidthInPixels) const; sl@0: IMPORT_C virtual TInt DoTextCount(const TDesC &aText, TInt aWidthInPixels, TInt &aExcessWidthInPixels) const; sl@0: IMPORT_C virtual TInt DoMaxCharWidthInPixels() const; sl@0: IMPORT_C virtual TInt DoMaxNormalCharWidthInPixels() const; sl@0: IMPORT_C virtual TFontSpec DoFontSpecInTwips() const; sl@0: IMPORT_C virtual TInt DoExtendedFunction(TUid aFunctionId, TAny* aParam = NULL) const; sl@0: sl@0: private: sl@0: CBitmapFont(RHeap* aHeap,const TFontSpec& aFontSpecInTwips, const TAlgStyle& aAlgStyle, CFontBitmap* aFontBitmap); sl@0: CBitmapFont(RHeap* aHeap,const TFontSpec& aFontSpecInTwips, const TAlgStyle& aAlgStyle, COpenFont* aOpenFont); sl@0: void ConstructL(); sl@0: ~CBitmapFont(); sl@0: static CBitmapFont* NewL(RHeap* aHeap, const TFontSpec& aFontSpecInTwips, const TAlgStyle& aAlgStyle, CFontBitmap* aFontBitmap); sl@0: static CBitmapFont* NewL(RHeap* aHeap, const TFontSpec& aFontSpecInTwips, const TAlgStyle& aAlgStyle, COpenFont* aOpenFont); sl@0: inline void operator delete(TAny*, TAny*) {} sl@0: TInt Width(TInt aNum) const; sl@0: TInt Height(TInt aNum) const; sl@0: CFontBitmap* FontBitmap() const; sl@0: void InstallOpenFontShaper(COpenFont* aOpenFont, CShaper::TInput& aShaperInput); sl@0: TInt DoTextWidthInPixels(const TDesC &aText, const TMeasureTextInput* aParam) const; sl@0: void SetUniqueFontId(TUint32 aUniqueFontId); sl@0: sl@0: private: sl@0: TFontSpec iFontSpecInTwips; sl@0: sl@0: public: sl@0: /** The algorithmic font style. */ sl@0: TAlgStyle iAlgStyle; // must not move this member sl@0: sl@0: private: sl@0: // Binary Compatibility warning - data member iOpenFont is referenced by inline methods sl@0: RHeap* iHeap; sl@0: TInt iFontBitmapOffset; sl@0: sl@0: // In order to be able to work with the flexible memory model, iOpenFont is sl@0: // actually an offset from the address of this class. sl@0: // iOpenFont's type remains unchanged. sl@0: // As Qt code that uses OpenFont() must be able to run on new and old versions sl@0: // of Symbian OS, it must be able to determine whether iOpenFont is a pointer or sl@0: // an offset at run-time. Therefore an offset will have its lowest significant bit set to 1. sl@0: // If iOpenFont is null, this object is not an open font. sl@0: // Assumption: a pointer always has least significant bit value of zero. sl@0: COpenFont* iOpenFont; // if iOpenFont is non-null this is an open font and many functions are forwarded to it sl@0: sl@0: TUint32 iReserved; sl@0: TUint32 iUniqueFontId; // unique id for this instance of this font sl@0: }; sl@0: sl@0: /** sl@0: WARNING: Class for internal and partner use ONLY. Compatibility is not guaranteed in future releases. sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: class TLinkedTypefaceGroupArgs sl@0: { sl@0: public: sl@0: TInt iGroupId; sl@0: CLinkedTypefaceGroup::TScalingOption iScalingOption; sl@0: CLinkedTypefaceGroup::TBaselineShift iBaselineShift; sl@0: TInt iAntialiasingThreshold; sl@0: TInt iBoldnessPercentage; sl@0: TInt iItalicAngle; sl@0: public: sl@0: void operator =(const CLinkedTypefaceGroup* aRhs); sl@0: }; sl@0: sl@0: class COpenFontLinkedTypefaceElementSpec; sl@0: class COpenFontLinkedTypefaceSpecification; sl@0: sl@0: /** sl@0: WARNING: Class for internal and partner use ONLY. Compatibility is not guaranteed in future releases. sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: class TLinkedTypefaceElementSpecArgs sl@0: { sl@0: public: sl@0: TBufC iName; sl@0: TBool iIsCanonical; sl@0: TInt iGroupId; sl@0: sl@0: void operator = (const CLinkedTypefaceElementSpec* aRhs); sl@0: void operator = (const COpenFontLinkedTypefaceElementSpec* aRhs); sl@0: }; sl@0: sl@0: /** sl@0: WARNING: Class for internal and partner use ONLY. Compatibility is not guaranteed in future releases. sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: class TLinkedTypefaceSpecificationArgs sl@0: { sl@0: public: sl@0: TBufC iName; sl@0: TLinkedTypefaceElementSpecArgs iTypefaces[KMaxLinkedTypefaces]; sl@0: TLinkedTypefaceGroupArgs iGroups[KMaxLinkedTypefaceGroups]; sl@0: TInt iSize; sl@0: TInt iGroupSize; sl@0: TInt iCanonicalIndex; sl@0: sl@0: IMPORT_C void operator = (const CLinkedTypefaceSpecification& aRhs); sl@0: IMPORT_C void operator = (const COpenFontLinkedTypefaceSpecification& aRhs); sl@0: }; sl@0: sl@0: sl@0: sl@0: class TUnhintedOutlineId; sl@0: class THintedOutlineId; sl@0: class CFontTableCache; sl@0: class CUnhintedOutlineCache; sl@0: class CHintedOutlineCache; sl@0: class TFontTableGlyphOutlineCacheMemMonitor; sl@0: sl@0: class CFontStore : public CTypefaceStore sl@0: /** sl@0: A store for fonts. sl@0: sl@0: Stores and handles both open and fixed-size fonts. Open fonts are made from sl@0: open (scalable) typefaces by Open Font plug-in rasterizers. Fonts of other sl@0: typefaces are stored in a limited number of fixed sizes. However, which is sl@0: being used is transparent to the user of this class. For example the GetNearestFont...() sl@0: functions get a bitmap font which may be retrieved from memory or generated sl@0: via a rasterizer. sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: { sl@0: friend class CLinkedFonts; sl@0: friend class CLinkedTypefaceSpecification; sl@0: sl@0: public: sl@0: IMPORT_C static CFontStore* NewL(RHeap* aHeap); sl@0: IMPORT_C ~CFontStore(); sl@0: IMPORT_C TUid AddFileL(const TDesC& aName); sl@0: IMPORT_C void RemoveFile(TUid aFileUid); sl@0: IMPORT_C TInt GetNearestFontInTwips(CFont *&aFont, const TFontSpec& aFontSpec); sl@0: IMPORT_C TInt GetNearestFontInPixels(CFont *&aFont, const TFontSpec &aFontSpec); sl@0: IMPORT_C TInt GetNearestFontToDesignHeightInTwips(CFont *&aFont, const TFontSpec& aFontSpec); sl@0: IMPORT_C TInt GetNearestFontToDesignHeightInPixels(CFont *&aFont, const TFontSpec& aFontSpec); sl@0: IMPORT_C TInt GetNearestFontToMaxHeightInTwips(CFont*& aFont, const TFontSpec& aFontSpec, TInt aMaxHeight); sl@0: IMPORT_C TInt GetNearestFontToMaxHeightInPixels(CFont*& aFont, const TFontSpec& aFontSpec, TInt aMaxHeight); sl@0: IMPORT_C TInt GetNearestFontInTwips(CFont *&aFont, const TOpenFontSpec& aFontSpec); sl@0: IMPORT_C TInt GetNearestFontInPixels(CFont *&aFont, const TOpenFontSpec &aFontSpec); sl@0: IMPORT_C TInt GetNearestFontToDesignHeightInTwips(CFont *&aFont, const TOpenFontSpec& aFontSpec); sl@0: IMPORT_C TInt GetNearestFontToDesignHeightInPixels(CFont *&aFont, const TOpenFontSpec& aFontSpec); sl@0: IMPORT_C TInt GetNearestFontToMaxHeightInTwips(CFont*& aFont, const TOpenFontSpec& aFontSpec, TInt aMaxHeight); sl@0: IMPORT_C TInt GetNearestFontToMaxHeightInPixels(CFont*& aFont, const TOpenFontSpec& aFontSpec, TInt aMaxHeight); sl@0: IMPORT_C TInt GetFontById(CFont *&aFont,TUid aUid,const TAlgStyle& aAlgStyle); sl@0: IMPORT_C TInt NumTypefaces() const; sl@0: IMPORT_C void TypefaceSupport(TTypefaceSupport &aTypefaceSupport,TInt aTypefaceIndex) const; sl@0: IMPORT_C TInt FontHeightInTwips(TInt aTypefaceIndex,TInt aHeightIndex) const; sl@0: IMPORT_C TInt FontHeightInPixels(TInt aTypefaceIndex,TInt aHeightIndex) const; sl@0: IMPORT_C void InstallRasterizerL(COpenFontRasterizer* aRasterizer); sl@0: IMPORT_C void DeleteSessionCache(TInt aSessionHandle); sl@0: inline TGlyphBitmapType DefaultBitmapType() const; sl@0: inline void SetDefaultBitmapType(TGlyphBitmapType aType); sl@0: IMPORT_C void InstallShaperFactoryL(CShaperFactory* aShaperFactory); sl@0: const CArrayPtrFlat* ShaperFactoryList() const; sl@0: COpenFontSessionCacheList* GetSessionCacheList(); sl@0: TInt GetShaperCacheMemUsage(); sl@0: void SetShaperCacheMemUsage(TInt aUsage); sl@0: CArrayPtrFlat* GetOpenFontFileList(); sl@0: void IncNumShaperCaches(); sl@0: void DecNumShaperCaches(); sl@0: TInt GetNumShaperCaches(); sl@0: IMPORT_C TInt CreateLinkedTypeface(const TLinkedTypefaceSpecificationArgs &aLinkedTypefaceSpec, TInt aSession, TInt& aId); sl@0: IMPORT_C void GetLinkedTypefaceL(TLinkedTypefaceSpecificationArgs &aLinkedTypefaceSpec); sl@0: IMPORT_C TBool HaveTypefaceFamilyName(const TDesC& aName); sl@0: IMPORT_C void UpdateLinkedTypefaceL(const TLinkedTypefaceSpecificationArgs& aLinkedTypefaceSpec); sl@0: IMPORT_C void LoadFontsAtStartupL(); sl@0: IMPORT_C TBool GetFontFilePath(const TDesC& aFontName, TFileName& aFilePath) const; sl@0: IMPORT_C void CleanupCacheOnFbsSessionTermination(TInt aSessionHandle); sl@0: sl@0: TInt CacheFontTable(TUid aFileUid, TUint32 aTag, TAny*& aContent, TInt aLength); sl@0: TInt ReleaseFontTable(TUid aFileUid, TUint32 aTag, TInt aSessionHandle); sl@0: TInt FindFontTableInCache(TUid aFileUid, TUint32 aTag, TAny*& aContent, TInt& aLength); sl@0: TInt IncFontTableRefCount(TUid aFileUid, TUint32 aTag, TInt aSessionHandle); sl@0: TInt DecFontTableRefCount(TUid aFileUid, TUint32 aTag, TInt aSessionHandle); sl@0: TInt CacheUnhintedOutline(const TUnhintedOutlineId& aOutlineId, TAny* aData, sl@0: TInt aLength, TAny*& aOutline, TInt& aLen); sl@0: TInt CacheHintedOutline(const THintedOutlineId& aOutlineId, TAny* aData, TInt aLength, sl@0: TAny*& aOutline, TInt& aLen); sl@0: TInt ReleaseUnhintedOutline(const TUnhintedOutlineId& aOutlineId, TInt aSessionHandle); sl@0: TInt ReleaseHintedOutline(const THintedOutlineId& aOutlineId, TInt aSessionHandle); sl@0: TInt IncreaseUnhintedOutlineRefCount(const TUnhintedOutlineId& aOutlineId, TInt aSessionHandle); sl@0: TInt IncreaseHintedOutlineRefCount(const THintedOutlineId& aOutlineId, TInt aSessionHandle); sl@0: TInt FindUnhintedOutlineInCache(const TUnhintedOutlineId& aOutlineId, TAny*& aData, sl@0: TInt &aLength); sl@0: TInt FindHintedOutlineInCache(const THintedOutlineId& aOutlineId, TAny*& aData, TInt& aLength); sl@0: void CleanupCacheOnOpenFontRemoval(COpenFont* aFont); sl@0: void CleanupCacheOnOpenFontFileRemoval(COpenFontFile* aFontFile); sl@0: sl@0: private: sl@0: CFontStore(RHeap* aHeap); sl@0: void ConstructL(); sl@0: void InternalizeFontStoreFileL(CFontStoreFile* aFontStoreFile, TInt aFontVersion); sl@0: TTypeface* GetNearestTypeface(const TTypeface& aTypeface) const; sl@0: TTypefaceFontBitmap GetNearestTypefaceFontBitmap(const TFontSpec& aFontSpecInPixels, TInt aMaxHeight); sl@0: CFontBitmap* GetFontBitmapById(TUid aUid); sl@0: TBool IsFontLoaded(CFont*& aFont, const TAlgStyle& aAlgStyle, const TFontSpec& aFontSpecInPixels, TUid aUid, TInt aMaxHeight = 0) const; sl@0: TBool IsFontLoaded(CFont*& aFont, const TAlgStyle& aAlgStyle, const TOpenFontSpec& aFontSpecInPixels, TInt aMaxHeight) const; sl@0: CBitmapFont* NewFontL(const TFontSpec& aFontSpecInTwips,const TAlgStyle& aAlgStyle,CFontBitmap* aFontBitmap); sl@0: CBitmapFont* NewFontL(const TOpenFontSpec& aFontSpecInTwips,const TAlgStyle& aAlgStyle,COpenFont* aOpenFont); sl@0: TInt VerticalPixelsToTwips(TInt aPixelHeight) const; sl@0: TInt VerticalTwipsToPixels(TInt aTwipsHeight) const; sl@0: void GetNearestBitmapFontInPixelsL(CFont*& aFont, TFontSpec& aFontSpec, TInt aMaxHeight); sl@0: void GetNearestOpenFontInPixelsL( sl@0: CFont*& aFont, TOpenFontSpec& aActualFontSpec, const TOpenFontSpec& aDesiredFontSpec, TInt aMaxHeight); sl@0: TInt GetNearestRealFontInPixels(CFont*& aFont, const TOpenFontSpec& aFontSpec, TInt aMaxHeight); sl@0: TInt GetNearestFontInPixelsL(CFont*& aFont, const TOpenFontSpec& aFontSpec, TInt aMaxHeight); sl@0: TInt CreateLinkedTypefaceL(const TLinkedTypefaceSpecificationArgs &aLinkedTypefaceSpec, TInt aSession, TInt& aId); sl@0: TInt GetCanonicalIndex(TInt aTypefaceIndex) const; sl@0: void TypefaceSupportLinked(TTypefaceSupport &aTypefaceSupport, TInt aTypefaceIndex) const; sl@0: TInt GetNearestFontInPixels(CFont*& aFont, const TOpenFontSpec& aFontSpec, TInt aMaxHeight); sl@0: void SanityCheckForTtfL(RFile& aFile, TUint aFontFileSize, TBool aStrictChecking); sl@0: void SanityCheckFontFileL(TParse& aParse); sl@0: TInt GetNearestOpenFontInPixelsByFontName(COpenFont*& aNearestOpenFont, TOpenFontSpec& aActualFontSpec, const TOpenFontSpec& aDesiredFontSpec, TInt aMaxHeight); sl@0: TInt GetNearestOpenFontInPixelsBySimilarity(COpenFont*& aNearestOpenFont, TOpenFontSpec& aActualFontSpec, const TOpenFontSpec& aDesiredFontSpec, TInt aMaxHeight); sl@0: TInt AddTypefacesToSupportList(COpenFontFile* aOpenFontFile); sl@0: void RemoveTypefacesFromSupportList(COpenFontFile* aOpenFontFile); sl@0: TInt FindBitmapFontFileIndexByUid(TUid aUid); sl@0: TBool IncRefCountOfLoadedFont(const TParse& aFileName, TUid& aFontUid); sl@0: TBool LoadFileAsOpenFontL(const TParse& aFileName, TUid& aFontUid); sl@0: TUid LoadFileAsBitmapFontL(const TParse& aParse); sl@0: static void CleanupRemoveFontFile(TAny* aCleanupInfo); sl@0: const TAny* FontLinkingInterface() const; sl@0: TInt ValidateLinkedFontSpecificationL(COpenFontLinkedTypefaceSpecification& aSpec, TBool aOverwrite) const; sl@0: void GenerateLinkedFontFileL(COpenFontLinkedTypefaceSpecification& aSpec, const TAny* aExtension, TBool aUpdate); sl@0: void LoadFontsL(const TDesC& aFontsDir); sl@0: void AddSanityCheckedFontL(const TParse& aFileName, TUid& aUid); sl@0: public: sl@0: /** The width of 1000 pixels in twips. sl@0: sl@0: This is set in the constructor. If the appropriate HALData attributes are sl@0: set (EDisplayXPixels and EDisplayXTwips) then the value is calculated using sl@0: these; otherwise the value is set to 11860. */ sl@0: TInt iKPixelWidthInTwips; sl@0: sl@0: /** The height of 1000 pixels in twips. sl@0: sl@0: This is set in the constructor. If the appropriate HALData attributes are sl@0: set (EDisplayYPixels and EDisplayYTwips) then the value is calculated using sl@0: these; otherwise the value is set to 11860. */ sl@0: TInt iKPixelHeightInTwips; sl@0: sl@0: private: sl@0: // Binary Compatibility warning - data member iDefaultBitmapType is referenced by inline methods sl@0: RFs iFs; sl@0: RHeap* iHeap; sl@0: CArrayPtrFlat iFontStoreFileList; sl@0: CArrayPtrFlat iTypefaceList; sl@0: CArrayPtrFlat iFontBitmapList; sl@0: CArrayFixFlat iTypefaceFontBitmapList; sl@0: CArrayPtrFlat iOpenFontFileList; sl@0: TInt iReserved[2]; // keep iDefaultBitmapType at the correct offset sl@0: CFontTableCache *iFontTableCache; sl@0: CUnhintedOutlineCache *iUnhintedOutlineCache; sl@0: CHintedOutlineCache *iHintedOutlineCache; sl@0: TFontTableGlyphOutlineCacheMemMonitor *iCacheMemMon; sl@0: CArrayPtrFlat iOpenFontRasterizerList; sl@0: COpenFontSessionCacheList* iOpenFontSessionCacheList; sl@0: TInt iOpenFontUid; sl@0: TGlyphBitmapType iDefaultBitmapType; sl@0: CArrayPtrFlat iShaperFactoryList; sl@0: TInt iOpenFontShaperCacheMemUsage; sl@0: TInt iNumberOfShaperCaches; sl@0: RPointerArray iOpenFontTypefaceSupportList; sl@0: TAny* iUnused; sl@0: TAny* iUnused2; sl@0: TUint32 iUniqueFontIdCount; sl@0: }; sl@0: sl@0: // inline functions start here sl@0: sl@0: /** Returns whether the bitmap font object is an open font (a COpenFont) rather sl@0: than a bitmap font (a CFontBitmap). sl@0: sl@0: @return ETrue if the bitmap font object is using an open font (a COpenFont); sl@0: EFalse if it is using a bitmap font (a CFontBitmap). sl@0: @see OpenFont() sl@0: */ sl@0: inline TBool CBitmapFont::IsOpenFont() const sl@0: { sl@0: return iOpenFont != NULL; sl@0: } sl@0: sl@0: sl@0: /** Returns a pointer to the open font being used by the bitmap font object. sl@0: sl@0: @return A pointer to an open font. sl@0: @see IsOpenFont() sl@0: */ sl@0: inline COpenFont* CBitmapFont::OpenFont() const sl@0: { sl@0: if (reinterpret_cast(iOpenFont) & 1) sl@0: { sl@0: return reinterpret_cast(const_cast(PtrAdd(this, reinterpret_cast(iOpenFont) & ~1))); sl@0: } sl@0: else sl@0: { sl@0: return iOpenFont; sl@0: } sl@0: } sl@0: sl@0: /** Gets the anti-aliasing setting for the font, see TGlyphBitmapType for sl@0: the range of values. sl@0: sl@0: This is only applicable to open fonts (COpenFonts) not bitmap fonts (CBitmapFonts). sl@0: sl@0: Note that this setting is stored in the device-independent font specification sl@0: which is set when the bitmap font object is constructed. sl@0: sl@0: @return The anti-aliasing setting for the font. sl@0: @see IsOpenFont() sl@0: @see TGlyphBitmapType sl@0: @see COpenFont sl@0: @see CBitmapFont sl@0: */ sl@0: inline TGlyphBitmapType CBitmapFont::GlyphBitmapType() const sl@0: { sl@0: return iFontSpecInTwips.iFontStyle.BitmapType(); sl@0: } sl@0: sl@0: /** Returns a default bitmap type. sl@0: sl@0: @return A default bitmap type. sl@0: @see TGlyphBitmapType sl@0: */ sl@0: inline TGlyphBitmapType CFontStore::DefaultBitmapType() const sl@0: { sl@0: return iDefaultBitmapType; sl@0: } sl@0: sl@0: /** Sets a default bitmap type. sl@0: sl@0: @param aType A default bitmap type. sl@0: @see TGlyphBitmapType sl@0: */ sl@0: inline void CFontStore::SetDefaultBitmapType(TGlyphBitmapType aType) sl@0: { sl@0: iDefaultBitmapType = aType; sl@0: } sl@0: sl@0: #endif sl@0: