os/graphics/graphicstest/graphicstestharness/inc/graphicsfontutils.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // Contains utility classes/functions which are
    15 // shared across multiple test steps.
    16 
    17 #ifndef GRAPHICSFONTUTILS_H
    18 #define GRAPHICSFONTUTILS_H
    19 
    20 #include <e32base.h>
    21 class CFontStore;
    22 class CFbsFont;
    23 class MOpenFontShapingExtension;
    24 class CBitmapFont;
    25 
    26 /**
    27 Helper class that converts a character code to a glyph code. 
    28 To do this requires calling into a font rasterizer from this
    29 process, therefore the rasterizer must be loaded in this 
    30 process - to do this it must create its own fontstore and load
    31 its own instance of a font rasterizer. This class performs 
    32 no shaping of characters.
    33 
    34 @note This class and/or its implementation should not be 
    35     copied or used as refernce code - the proper implementation
    36     would not create a new fontstore, but instead either parse the
    37     font table of the associated font itself, or use the
    38     FBS server-side fontstore. 
    39  */
    40 class CCharCodeConverter : public CBase
    41     {
    42 public:
    43     IMPORT_C static CCharCodeConverter* NewL();
    44     IMPORT_C static CCharCodeConverter* NewLC();
    45     IMPORT_C ~CCharCodeConverter();    
    46     IMPORT_C void UseFontL(CFbsFont* aFont);
    47     IMPORT_C TInt GlyphCodeL(TInt aCharCode) const;
    48 private:
    49     CCharCodeConverter();
    50     void ConstructL();
    51     void LoadOpenFontLibraries(CFontStore* aFontStore);    
    52 private:
    53     CFontStore* iFontStore;
    54     CBitmapFont* iFont;
    55     MOpenFontShapingExtension* iGlyphIndexExt;
    56     };
    57 
    58 #endif // GRAPHICSFONTUTILS_H