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