Update contrib.
1 // Copyright (c) 2006-2009 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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
19 @internalComponent - Internal Symbian test code
23 #if !defined(__TFONT_H__)
26 #include <test/testexecutestepbase.h>
27 #include <test/fontinjector.h>
28 #include "TGraphicsHarness.h"
31 //--------------------------------------------------------------
33 class CFbsFontEx : public CFbsFont
36 static CBitmapFont* FontAddress(CFbsFont* aFont);
39 //--------------------------------------------------------------
42 template<class C> class XTCallCounter : public MShellcode
45 XTCallCounter(CTGraphicsBase& aTestBase);
48 void ExecuteShellcode(TInt aFromFunction);
50 CTGraphicsBase& iTestBase;
52 XVtableInjector<C> iInjector;
53 TInt iVFCallsOutsideFBServ;
57 //--------------------------------------------------------------
59 class CTFont : public CTGraphicsBase
62 CTFont(CTestStep* aStep);
67 virtual void RunTestCaseL(TInt aCurTestCase);
70 void DoTextFormatsL();
71 void DoBitAlignmentL();
73 void DoAntiAliasedTextL();
74 void DoVerticalText();
75 void DoVerticalBoxL();
77 void DoSuperSubScriptL();
78 void DoTextFormatsInContextL();
81 void DrawTextInContext();
82 void DrawTextInContextBox();
83 void DrawTextInContextVertical();
89 void JustificationInContext();
90 void DisplayAsciiCharSet(const TDesC& aTypefaceName);
91 void DisplayBoldItalic(const TDesC& aTypefaceName);
92 void DisplayLargeChars();
93 TInt DisplayCharAndBounds(TInt aChar,TPoint aPos,TBool aVertical,TBool aUp);
94 void FontExternalizeL();
95 TInt TestFontL(const TFontSpec &aFsp);
96 TInt GetNearestFontToDesignHeightInPixels(CFbsFont*& aFont, const TFontSpec& aFontSpec);
97 TInt GetNearestFontToDesignHeightInTwips(CFbsFont*& aFont, const TFontSpec& aFontSpec);
101 CFbsScreenDevice* iDev;
103 XTCallCounter<CFont> iFontCallCounter;
104 XTCallCounter<COpenFont> iOpenFontCallCounter;
108 //--------------------------------------------------------------
110 class CTFontStep : public CTGraphicsStep
115 //from CTGraphicsStep
116 virtual CTGraphicsBase* CreateTestL();
117 virtual void TestSetupL();
118 virtual void TestClose();
121 _LIT(KTFontStep,"TFont");
123 #endif // __TFONT_H__