os/graphics/graphicsdeviceinterface/bitgdi/tbit/TFont.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 2006-2009 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
//
sl@0
    15
sl@0
    16
/**
sl@0
    17
 @file
sl@0
    18
 @test
sl@0
    19
 @internalComponent - Internal Symbian test code 
sl@0
    20
*/
sl@0
    21
sl@0
    22
sl@0
    23
#if !defined(__TFONT_H__)
sl@0
    24
#define __TFONT_H__
sl@0
    25
sl@0
    26
#include <test/testexecutestepbase.h>
sl@0
    27
#include <test/fontinjector.h>
sl@0
    28
#include "TGraphicsHarness.h"
sl@0
    29
sl@0
    30
sl@0
    31
//--------------------------------------------------------------
sl@0
    32
sl@0
    33
class CFbsFontEx : public CFbsFont
sl@0
    34
	{
sl@0
    35
public:
sl@0
    36
	static CBitmapFont* FontAddress(CFbsFont* aFont);
sl@0
    37
	};
sl@0
    38
sl@0
    39
//--------------------------------------------------------------
sl@0
    40
sl@0
    41
#ifdef __WINS__
sl@0
    42
template<class C> class XTCallCounter : public MShellcode
sl@0
    43
	{
sl@0
    44
public:
sl@0
    45
	XTCallCounter(CTGraphicsBase& aTestBase);
sl@0
    46
private:
sl@0
    47
	// From MShellcode
sl@0
    48
	void ExecuteShellcode(TInt aFromFunction);
sl@0
    49
private:
sl@0
    50
	CTGraphicsBase& iTestBase;
sl@0
    51
public:
sl@0
    52
	XVtableInjector<C> iInjector;
sl@0
    53
	TInt iVFCallsOutsideFBServ;
sl@0
    54
	};
sl@0
    55
#endif
sl@0
    56
sl@0
    57
//--------------------------------------------------------------
sl@0
    58
sl@0
    59
class CTFont : public CTGraphicsBase
sl@0
    60
	{
sl@0
    61
public:
sl@0
    62
	CTFont(CTestStep* aStep);
sl@0
    63
	~CTFont();
sl@0
    64
	void ConstructL();
sl@0
    65
protected:
sl@0
    66
//from 	CTGraphicsStep
sl@0
    67
	virtual void RunTestCaseL(TInt aCurTestCase);
sl@0
    68
public:
sl@0
    69
	void DoAllFontsL();
sl@0
    70
	void DoTextFormatsL();
sl@0
    71
	void DoBitAlignmentL();
sl@0
    72
	void DoLargeFontsL();
sl@0
    73
	void DoAntiAliasedTextL();
sl@0
    74
	void DoVerticalText();
sl@0
    75
	void DoVerticalBoxL();
sl@0
    76
	void DoUlStL();
sl@0
    77
	void DoSuperSubScriptL();
sl@0
    78
	void DoTextFormatsInContextL();
sl@0
    79
private:
sl@0
    80
	void ResetGc();
sl@0
    81
	void DrawTextInContext();
sl@0
    82
	void DrawTextInContextBox();
sl@0
    83
	void DrawTextInContextVertical();
sl@0
    84
	void Box();
sl@0
    85
	void Underline();
sl@0
    86
	void Clipping();
sl@0
    87
	void Justification();
sl@0
    88
	void BoxInContext();
sl@0
    89
	void JustificationInContext();
sl@0
    90
	void DisplayAsciiCharSet(const TDesC& aTypefaceName);
sl@0
    91
	void DisplayBoldItalic(const TDesC& aTypefaceName);
sl@0
    92
	void DisplayLargeChars();
sl@0
    93
	TInt DisplayCharAndBounds(TInt aChar,TPoint aPos,TBool aVertical,TBool aUp);
sl@0
    94
	void FontExternalizeL();
sl@0
    95
	TInt TestFontL(const TFontSpec &aFsp);
sl@0
    96
	TInt GetNearestFontToDesignHeightInPixels(CFbsFont*& aFont, const TFontSpec& aFontSpec);
sl@0
    97
	TInt GetNearestFontToDesignHeightInTwips(CFbsFont*& aFont, const TFontSpec& aFontSpec);
sl@0
    98
private:
sl@0
    99
	CFbsFont* iFont;
sl@0
   100
	CFbsBitGc* iGc;
sl@0
   101
	CFbsScreenDevice* iDev;
sl@0
   102
#ifdef __WINS__
sl@0
   103
	XTCallCounter<CFont> iFontCallCounter;
sl@0
   104
	XTCallCounter<COpenFont> iOpenFontCallCounter;
sl@0
   105
#endif
sl@0
   106
	};
sl@0
   107
sl@0
   108
//--------------------------------------------------------------
sl@0
   109
sl@0
   110
class CTFontStep : public CTGraphicsStep
sl@0
   111
	{
sl@0
   112
public:
sl@0
   113
	CTFontStep();
sl@0
   114
protected:	
sl@0
   115
	//from CTGraphicsStep
sl@0
   116
	virtual CTGraphicsBase* CreateTestL();
sl@0
   117
	virtual void TestSetupL();
sl@0
   118
	virtual void TestClose();
sl@0
   119
	};
sl@0
   120
sl@0
   121
_LIT(KTFontStep,"TFont");
sl@0
   122
sl@0
   123
#endif	// __TFONT_H__