graphicsdeviceinterface/bitgdi/tbit/TFont.h
changeset 0 5d03bc08d59c
equal deleted inserted replaced
-1:000000000000 0:5d03bc08d59c
       
     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".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @test
       
    19  @internalComponent - Internal Symbian test code 
       
    20 */
       
    21 
       
    22 
       
    23 #if !defined(__TFONT_H__)
       
    24 #define __TFONT_H__
       
    25 
       
    26 #include <test/testexecutestepbase.h>
       
    27 #include <test/fontinjector.h>
       
    28 #include "TGraphicsHarness.h"
       
    29 
       
    30 
       
    31 //--------------------------------------------------------------
       
    32 
       
    33 class CFbsFontEx : public CFbsFont
       
    34 	{
       
    35 public:
       
    36 	static CBitmapFont* FontAddress(CFbsFont* aFont);
       
    37 	};
       
    38 
       
    39 //--------------------------------------------------------------
       
    40 
       
    41 #ifdef __WINS__
       
    42 template<class C> class XTCallCounter : public MShellcode
       
    43 	{
       
    44 public:
       
    45 	XTCallCounter(CTGraphicsBase& aTestBase);
       
    46 private:
       
    47 	// From MShellcode
       
    48 	void ExecuteShellcode(TInt aFromFunction);
       
    49 private:
       
    50 	CTGraphicsBase& iTestBase;
       
    51 public:
       
    52 	XVtableInjector<C> iInjector;
       
    53 	TInt iVFCallsOutsideFBServ;
       
    54 	};
       
    55 #endif
       
    56 
       
    57 //--------------------------------------------------------------
       
    58 
       
    59 class CTFont : public CTGraphicsBase
       
    60 	{
       
    61 public:
       
    62 	CTFont(CTestStep* aStep);
       
    63 	~CTFont();
       
    64 	void ConstructL();
       
    65 protected:
       
    66 //from 	CTGraphicsStep
       
    67 	virtual void RunTestCaseL(TInt aCurTestCase);
       
    68 public:
       
    69 	void DoAllFontsL();
       
    70 	void DoTextFormatsL();
       
    71 	void DoBitAlignmentL();
       
    72 	void DoLargeFontsL();
       
    73 	void DoAntiAliasedTextL();
       
    74 	void DoVerticalText();
       
    75 	void DoVerticalBoxL();
       
    76 	void DoUlStL();
       
    77 	void DoSuperSubScriptL();
       
    78 	void DoTextFormatsInContextL();
       
    79 private:
       
    80 	void ResetGc();
       
    81 	void DrawTextInContext();
       
    82 	void DrawTextInContextBox();
       
    83 	void DrawTextInContextVertical();
       
    84 	void Box();
       
    85 	void Underline();
       
    86 	void Clipping();
       
    87 	void Justification();
       
    88 	void BoxInContext();
       
    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);
       
    98 private:
       
    99 	CFbsFont* iFont;
       
   100 	CFbsBitGc* iGc;
       
   101 	CFbsScreenDevice* iDev;
       
   102 #ifdef __WINS__
       
   103 	XTCallCounter<CFont> iFontCallCounter;
       
   104 	XTCallCounter<COpenFont> iOpenFontCallCounter;
       
   105 #endif
       
   106 	};
       
   107 
       
   108 //--------------------------------------------------------------
       
   109 
       
   110 class CTFontStep : public CTGraphicsStep
       
   111 	{
       
   112 public:
       
   113 	CTFontStep();
       
   114 protected:	
       
   115 	//from CTGraphicsStep
       
   116 	virtual CTGraphicsBase* CreateTestL();
       
   117 	virtual void TestSetupL();
       
   118 	virtual void TestClose();
       
   119 	};
       
   120 
       
   121 _LIT(KTFontStep,"TFont");
       
   122 
       
   123 #endif	// __TFONT_H__