sl@0: /* sl@0: * Copyright (c) 1996-2009 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 __FNTSTD_H__ sl@0: #define __FNTSTD_H__ sl@0: sl@0: #include sl@0: #include sl@0: sl@0: /** sl@0: @internalComponent sl@0: */ sl@0: enum TFntStorePanic sl@0: { sl@0: EFntTypefaceIndexOutOfRange, sl@0: EFntHeightIndexOutOfRange, sl@0: EFntNoTypefaces, sl@0: EFntNoTypefaceFontBitmaps, sl@0: EFntTypefaceHasNoFontBitmaps, sl@0: EFntFontBitmapNotLoaded, sl@0: EFntFontAccessCountNonZero, sl@0: EFntFontStoreFileInUse, sl@0: EFntKPixelHeightInTwipsZero, sl@0: EFntSessionCacheIndexOutOfRange, sl@0: EFntMetricsIndexOutOfBounds, sl@0: EFntNoFontFound, sl@0: EFntRemovingAlreadyDeletedLinkedFont, sl@0: EFntOverFlow, sl@0: EFntMetricsNotOnHeap, sl@0: EFntPointerNotByteAligned, sl@0: }; sl@0: sl@0: /** sl@0: @internalComponent sl@0: */ sl@0: GLREF_C void Panic(TFntStorePanic aPanic); sl@0: sl@0: // COpenFontSessionCacheList is placed here rather than openfont.cpp because it is used in fntstore.cpp as well. sl@0: sl@0: class COpenFontSessionCache; sl@0: class COpenFont; sl@0: sl@0: class COpenFontSessionCacheList sl@0: /** sl@0: @internalComponent sl@0: */ sl@0: { sl@0: public: sl@0: inline COpenFontSessionCacheList(); sl@0: TInt AddCache(COpenFontSessionCache* aCache); sl@0: COpenFontSessionCache* FindCache(TInt aSessionHandle) const; sl@0: void Delete(RHeap* aHeap); sl@0: void DeleteCache(RHeap* aHeap,TInt aSessionHandle); sl@0: void DeleteFontGlyphs(RHeap* aHeap,const COpenFont* aFont); sl@0: private: sl@0: enum { EMaxNumCaches = 256 }; sl@0: private: sl@0: TInt iSessionHandleArray[EMaxNumCaches]; sl@0: TInt iCacheOffsetArray[EMaxNumCaches]; sl@0: }; sl@0: sl@0: inline COpenFontSessionCacheList::COpenFontSessionCacheList() sl@0: { sl@0: Mem::FillZ(this, sizeof(COpenFontSessionCacheList)); sl@0: } sl@0: sl@0: /** sl@0: @internalComponent sl@0: */ sl@0: #ifdef __GCC32__ sl@0: #define PACKED_STRUCTURE_PREFIX sl@0: #define PACKED_STRUCTURE_SUFFIX __attribute__(( __packed__)) sl@0: #elif defined(__ARMCC__) sl@0: #define PACKED_STRUCTURE_PREFIX __packed sl@0: #define PACKED_STRUCTURE_SUFFIX sl@0: #else sl@0: #define PACKED_STRUCTURE_PREFIX sl@0: #define PACKED_STRUCTURE_SUFFIX sl@0: #endif sl@0: sl@0: PACKED_STRUCTURE_PREFIX class TBitmapFontCharacterOffset sl@0: /** sl@0: Class to store an offset to the given position of a characters binary data in the sl@0: bitmap section of the font file. sl@0: @internalComponent sl@0: */ sl@0: sl@0: { sl@0: public: sl@0: TBitmapFontCharacterOffset(); sl@0: void InternalizeL(RReadStream& aStream); sl@0: public: sl@0: TUint16 iBitmapOffset; // restricts bitmap to 64k sl@0: } PACKED_STRUCTURE_SUFFIX; sl@0: sl@0: PACKED_STRUCTURE_PREFIX class TBitmapFontCharacterMetrics sl@0: /** sl@0: Character metrics stored in .GDR files. sl@0: sl@0: This structure cannot be changed without changing the format of bitmap font sl@0: files (.GDR files). This is because a pointer to TBitmapFontCharacterMetrics is made to point sl@0: to part of the .GDR file in ROM. sl@0: @internalComponent sl@0: */ sl@0: sl@0: { sl@0: public: sl@0: TBitmapFontCharacterMetrics(); sl@0: void InternalizeL(RReadStream& aStream); sl@0: sl@0: TInt8 iAscentInPixels; sl@0: TInt8 iHeightInPixels; sl@0: TInt8 iLeftAdjustInPixels; sl@0: TInt8 iMoveInPixels; sl@0: TInt8 iRightAdjustInPixels; sl@0: } PACKED_STRUCTURE_SUFFIX; sl@0: sl@0: #endif