sl@0: // Copyright (c) 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: // Contains utility classes/functions which are sl@0: // shared across multiple test steps. sl@0: sl@0: #ifndef GRAPHICSFONTUTILS_H sl@0: #define GRAPHICSFONTUTILS_H sl@0: sl@0: #include sl@0: class CFontStore; sl@0: class CFbsFont; sl@0: class MOpenFontShapingExtension; sl@0: class CBitmapFont; sl@0: sl@0: /** sl@0: Helper class that converts a character code to a glyph code. sl@0: To do this requires calling into a font rasterizer from this sl@0: process, therefore the rasterizer must be loaded in this sl@0: process - to do this it must create its own fontstore and load sl@0: its own instance of a font rasterizer. This class performs sl@0: no shaping of characters. sl@0: sl@0: @note This class and/or its implementation should not be sl@0: copied or used as refernce code - the proper implementation sl@0: would not create a new fontstore, but instead either parse the sl@0: font table of the associated font itself, or use the sl@0: FBS server-side fontstore. sl@0: */ sl@0: class CCharCodeConverter : public CBase sl@0: { sl@0: public: sl@0: IMPORT_C static CCharCodeConverter* NewL(); sl@0: IMPORT_C static CCharCodeConverter* NewLC(); sl@0: IMPORT_C ~CCharCodeConverter(); sl@0: IMPORT_C void UseFontL(CFbsFont* aFont); sl@0: IMPORT_C TInt GlyphCodeL(TInt aCharCode) const; sl@0: private: sl@0: CCharCodeConverter(); sl@0: void ConstructL(); sl@0: void LoadOpenFontLibraries(CFontStore* aFontStore); sl@0: private: sl@0: CFontStore* iFontStore; sl@0: CBitmapFont* iFont; sl@0: MOpenFontShapingExtension* iGlyphIndexExt; sl@0: }; sl@0: sl@0: #endif // GRAPHICSFONTUTILS_H