os/textandloc/fontservices/fontstore/tfs/T_FontMetrics.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description: 
    15 *
    16 */
    17 
    18 
    19 /**
    20  @file
    21  @test
    22  @internalComponent Internal Symbian test code
    23 */
    24 
    25 #include <ecom/ecom.h>
    26 #include <gdi.h>
    27 #include "T_FontMetrics.h"
    28 #include <graphics/openfontrasterizer.h>
    29 #include <graphics/openfontconstants.h>
    30 #include <graphics/gdi/glyphsample.h>
    31 
    32 const TInt CTFontMetrics::KRequiredHeight = 24;
    33 _LIT(KTypefaceName, "DejaVu Sans Condensed");
    34 _LIT(KFontFilePath, "z:\\resource\\fonts\\DejaVuSansCondensed.ttf");
    35 
    36 LOCAL_C void ResetAndDestroyRImplInfoPtrArray(TAny* aPtr)
    37 	{
    38 	RImplInfoPtrArray* array = reinterpret_cast <RImplInfoPtrArray*> (aPtr);
    39 	array->ResetAndDestroy();
    40 	}
    41 
    42 CTFontMetrics::CTFontMetrics(CTestStep* aStep) :
    43 	CTGraphicsBase(aStep)
    44 	{
    45 	}
    46 
    47 void CTFontMetrics::ConstructL()
    48 	{
    49     iHeap = UserHeap::ChunkHeap(NULL, 0x10000, 0x10000);
    50 	if (NULL == iHeap)
    51 		User::Leave(KErrNoMemory);
    52 	iHeap->__DbgMarkStart();
    53 	iFontStore = CFontStore::NewL(iHeap);
    54 	InstallRasterizerL();
    55 	AddFileL();
    56 	}
    57 
    58 CTFontMetrics::~CTFontMetrics()
    59 	{
    60 	delete iFontStore;
    61 	iHeap->__DbgMarkEnd(0);
    62 	iHeap->Close();
    63 	User::Heap().Check();
    64 	REComSession::FinalClose();
    65 	}
    66 
    67 /**
    68 Create a rasterizer and install it in the font store.
    69 */
    70 void CTFontMetrics::InstallRasterizerL()
    71 	{
    72 	RImplInfoPtrArray implementationArray;
    73 	TCleanupItem cleanup(ResetAndDestroyRImplInfoPtrArray, &implementationArray);
    74 	CleanupStack::PushL(cleanup);
    75 	const TUid uid = {KUidOpenFontRasterizerPlunginInterface};
    76 
    77 	TRAPD(error, REComSession::ListImplementationsL(uid, implementationArray));
    78 	TEST(error == KErrNone);
    79 	TEST(0 < implementationArray.Count());
    80 
    81 	COpenFontRasterizer* rasterizer =
    82 		COpenFontRasterizer::NewL(implementationArray[0]->ImplementationUid());
    83 	TRAP(error, iFontStore->InstallRasterizerL(rasterizer));
    84 	if (error)
    85 		{
    86 		delete rasterizer;
    87 		TEST(error == KErrNone);
    88 		}
    89 	CleanupStack::PopAndDestroy(&implementationArray); 	
    90 	}
    91 
    92 void CTFontMetrics::AddFileL()
    93 	{
    94 	iFontStore->AddFileL(KFontFilePath);
    95 	}
    96 
    97 TOpenFontSpec CTFontMetrics::GetTOpenFontSpec()
    98 	{
    99 	TOpenFontSpec openFontSpec;
   100 	openFontSpec.SetName(KTypefaceName);
   101 	openFontSpec.SetHeight(KRequiredHeight);
   102 	openFontSpec.SetItalic(EFalse);
   103 	openFontSpec.SetBold(EFalse);
   104 	return openFontSpec;
   105 	}
   106 
   107 void CTFontMetrics::RunTestCaseL(TInt aCurTestCase)
   108 	{
   109 	((CTFontMetricsStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
   110 	switch ( aCurTestCase )
   111 		{
   112 	case 1:
   113 		((CTFontMetricsStep*)iStep)->SetTestStepID(_L("GRAPHICS-FNTSTORE-0029"));
   114 		FontAccessInCTypefaceStore();
   115 		break;
   116 	case 2:
   117 		((CTFontMetricsStep*)iStep)->SetTestStepID(_L("GRAPHICS-FNTSTORE-0002"));
   118 		TLanguage2GlyphSample();
   119 		break;
   120 	case 3:
   121 		((CTFontMetricsStep*)iStep)->SetTestStepID(_L("GRAPHICS-FNTSTORE-0003"));
   122 		GetNearestFontToDesignHeightInPixels();
   123 		break;
   124 	case 4:
   125 		((CTFontMetricsStep*)iStep)->SetTestStepID(_L("GRAPHICS-FNTSTORE-0004"));
   126 		GetNearestFontToMaxHeightInPixels();
   127 		break;
   128 	case 5:
   129 		((CTFontMetricsStep*)iStep)->SetTestStepID(_L("GRAPHICS-FNTSTORE-0030"));
   130 		TestINC086513();
   131 		break;
   132 	case 6:
   133 		((CTFontMetricsStep*)iStep)->SetTestStepID(_L("GRAPHICS-FNTSTORE-0020"));
   134 		TestGetNearestFontToMaxHeightInPixels();
   135 		break;
   136 	case 7:
   137         	((CTFontMetricsStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
   138 		((CTFontMetricsStep*)iStep)->CloseTMSGraphicsStep();
   139 		TestComplete();
   140 		break;
   141 		}
   142 	((CTFontMetricsStep*)iStep)->RecordTestResultL();
   143 	}
   144 
   145 /**
   146    @SYMTestCaseID          GRAPHICS-FNTSTORE-0002
   147 
   148    @SYMPREQ                PREQ533
   149 
   150    @SYMREQ                 REQ3800
   151 
   152    @SYMTestCaseDesc        Verifying GlyphSample::TLanguage2TScript and GlyphSample::TScript2GlyphSample
   153 							with different TLanguage values.
   154 
   155    @SYMTestPriority        Critical
   156 
   157    @SYMTestStatus          Implemented
   158 
   159    @SYMTestActions         (1) Call TLanguage2TScript and then TScript2GlyphSample
   160 								with boundary cases ELangTest, ELangNone, ELangMaximum.
   161                            (2) Call TLanguage2TScript and then TScript2GlyphSample
   162 								with languages belonging to unsupported scripts.
   163                            (3) Call TLanguage2TScript and then TScript2GlyphSample
   164 								with languages belonging to Latin script.
   165                            (4) Repeat (3) for all other supported scripts.
   166 
   167    @SYMTestExpectedResults (1) and (2) - NULL
   168                            (3) and (4) - Languages belonging to the same script should return
   169 						   the same address value pointing to the same set of glyph samples.
   170 */
   171 void CTFontMetrics::TLanguage2GlyphSample()
   172 	{
   173 	// boundary cases
   174 	TEST(NULL == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangTest)).Ptr());
   175 	TEST(NULL == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangNone)).Ptr());
   176 	TEST(NULL == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangMaximum)).Ptr());
   177 	// Not yet supported
   178 	TEST(NULL == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangAmharic)).Ptr());
   179 	TEST(NULL == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangTigrinya)).Ptr());
   180 	TEST(NULL == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangArmenian)).Ptr());
   181 	TEST(NULL == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangTagalog)).Ptr());
   182 	TEST(NULL == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangBengali)).Ptr());
   183 	TEST(NULL == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangBurmese)).Ptr());
   184 	TEST(NULL == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangGeorgian)).Ptr());
   185 	TEST(NULL == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangGujarati)).Ptr());
   186 	TEST(NULL == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangKannada)).Ptr());
   187 	TEST(NULL == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangKhmer)).Ptr());
   188 	TEST(NULL == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangLao)).Ptr());
   189 	TEST(NULL == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangMalayalam)).Ptr());
   190 	TEST(NULL == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangMongolian)).Ptr());
   191 	TEST(NULL == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangPunjabi)).Ptr());
   192 	TEST(NULL == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangSinhalese)).Ptr());
   193 	TEST(NULL == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangTamil)).Ptr());
   194 	TEST(NULL == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangTelugu)).Ptr());
   195 	TEST(NULL == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangTibetan)).Ptr());
   196 	// Latin
   197 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangFrench)));
   198 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangGerman)));
   199 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangSpanish)));
   200 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangItalian)));
   201 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangSwedish)));
   202 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangDanish)));
   203 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangNorwegian)));
   204 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangFinnish)));
   205 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangAmerican)));
   206 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangSwissFrench)));
   207 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangSwissGerman)));
   208 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangPortuguese)));
   209 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangTurkish)));
   210 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangIcelandic)));
   211 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangHungarian)));
   212 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangDutch)));
   213 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangBelgianFlemish)));
   214 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangAustralian)));
   215 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangBelgianFrench)));
   216 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangAustrian)));
   217 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangNewZealand)));
   218 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangInternationalFrench)));
   219 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangCzech)));
   220 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangSlovak)));
   221 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangPolish)));
   222 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangSlovenian)));
   223 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangAfrikaans)));
   224 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangAlbanian)));
   225 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangCatalan)));
   226 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangCroatian)));
   227 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangCanadianEnglish)));
   228 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangInternationalEnglish)));
   229 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangSouthAfricanEnglish)));
   230 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEstonian)));
   231 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangCanadianFrench)));
   232 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangScotsGaelic)));
   233 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangIndonesian)));
   234 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangIrish)));
   235 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangSwissItalian)));
   236 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangLatvian)));
   237 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangLithuanian)));
   238 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangMalay)));
   239 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangMoldavian)));
   240 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangNorwegianNynorsk)));
   241 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangBrazilianPortuguese)));
   242 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangRomanian)));
   243 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangSomali)));
   244 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangInternationalSpanish)));
   245 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangLatinAmericanSpanish)));
   246 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangSwahili)));
   247 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangFinlandSwedish)));
   248 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangCyprusTurkish)));
   249 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangVietnamese)));
   250 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangWelsh)));
   251 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangZulu)));
   252 	// Greek
   253 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangGreek)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangCyprusGreek)));
   254 	// Cyrillic
   255 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangRussian)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangBelarussian)));
   256 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangRussian)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangBulgarian)));
   257 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangRussian)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangKazakh)));
   258 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangRussian)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangMacedonian)));
   259 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangRussian)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangSerbian)));
   260 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangRussian)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangTurkmen)));
   261 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangRussian)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangUkrainian)));
   262 	// Hebrew
   263 	TEST(NULL != GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangHebrew)).Ptr());
   264 	// Arabic
   265 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangArabic)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangFarsi)));
   266 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangArabic)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangUrdu)));
   267 	// Devanagari
   268 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangHindi)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangMarathi)));
   269 	// Thai
   270 	TEST(NULL != GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangThai)).Ptr());
   271 	// HanIdeographs
   272 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangTaiwanChinese)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangHongKongChinese)));
   273 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangTaiwanChinese)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangPrcChinese)));
   274 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangTaiwanChinese)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangJapanese)));
   275 	TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangTaiwanChinese)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangKorean)));
   276 	}
   277 
   278 /**
   279    @SYMTestCaseID          GRAPHICS-FNTSTORE-0003
   280 
   281    @SYMPREQ                PREQ533
   282 
   283    @SYMREQ                 REQ3800
   284 
   285    @SYMTestCaseDesc        Verifying font's metrics created by CFontStore::GetNearestFontToDesignHeightInPixels
   286 							with different TLanguage values.
   287 
   288    @SYMTestPriority        Critical
   289 
   290    @SYMTestStatus          Implemented
   291 
   292    @SYMTestActions         (1) Call GetNearestFontToDesignHeightInPixels with ELangNone.
   293                            (2) Call CFont's HeightInPixels, AscentInPixels, DescentInPixels, FontCapitalAscent,
   294 								FontStandardDescent, FontMaxAscent, FontMaxDescent, FontMaxHeight, and FontLineGap
   295 								to verify the font metrics of the returned font object.
   296                            (3) Repeat (1) and (2) with a Latin-based language, a Greek-based language, and a
   297 								Cyrillic-based language for the TLanguage parameter.
   298 
   299    @SYMTestExpectedResults See returned values in Verify_GetNearestFontToDesignHeightInPixels.
   300 */
   301 void CTFontMetrics::GetNearestFontToDesignHeightInPixels()
   302 	{
   303     INFO_PRINTF3(_L("iKPixelWidthInTwips = %d; iKPixelHeightInTwips = %d"), 
   304                 iFontStore->iKPixelWidthInTwips, iFontStore->iKPixelHeightInTwips);
   305     
   306 	TOpenFontSpec openFontSpec = GetTOpenFontSpec();
   307 
   308 	INFO_PRINTF1(_L("GetNearestFontToDesignHeightInPixels().ELangNone"));
   309 	CFont* font = NULL;
   310 	openFontSpec.SetScriptTypeForMetrics(ELangNone);
   311 	iFontStore->GetNearestFontToDesignHeightInPixels(font, openFontSpec);
   312 	Verify_GetNearestFontToDesignHeightInPixels(*font, openFontSpec.ScriptTypeForMetrics());
   313 	iFontStore->ReleaseFont(font);
   314 
   315 	INFO_PRINTF1(_L("GetNearestFontToDesignHeightInPixels().ELangFinnish"));
   316 	font = NULL;
   317 	openFontSpec.SetScriptTypeForMetrics(ELangFinnish);
   318 	iFontStore->GetNearestFontToDesignHeightInPixels(font, openFontSpec);
   319 	Verify_GetNearestFontToDesignHeightInPixels(*font, openFontSpec.ScriptTypeForMetrics());
   320 	iFontStore->ReleaseFont(font);
   321 
   322 	INFO_PRINTF1(_L("GetNearestFontToDesignHeightInPixels().ELangGreek"));
   323 	font = NULL;
   324 	openFontSpec.SetScriptTypeForMetrics(ELangGreek);
   325 	iFontStore->GetNearestFontToDesignHeightInPixels(font, openFontSpec);
   326 	Verify_GetNearestFontToDesignHeightInPixels(*font, openFontSpec.ScriptTypeForMetrics());
   327 	iFontStore->ReleaseFont(font);
   328 
   329 	INFO_PRINTF1(_L("GetNearestFontToDesignHeightInPixels().ELangRussian"));
   330 	font = NULL;
   331 	openFontSpec.SetScriptTypeForMetrics(ELangRussian);
   332 	iFontStore->GetNearestFontToDesignHeightInPixels(font, openFontSpec);
   333 	Verify_GetNearestFontToDesignHeightInPixels(*font, openFontSpec.ScriptTypeForMetrics());
   334 	iFontStore->ReleaseFont(font);
   335 	}
   336 
   337 void CTFontMetrics::Verify_GetNearestFontToDesignHeightInPixels(const CFont& aFont, TInt aScript)
   338 	{
   339 	VerifyTypefaceNameAndID(aFont);
   340     INFO_PRINTF4(_L("HeightInPixels() = %d; AscentInPixels() = %d; DescentInPixels() = %d"), 
   341             aFont.HeightInPixels(), aFont.AscentInPixels(), aFont.DescentInPixels());
   342     INFO_PRINTF4(_L("FontCapitalAscent() = %d; FontStandardDescent() = %d; FontMaxAscent() = %d"), 
   343             aFont.FontCapitalAscent(), aFont.FontStandardDescent(), aFont.FontMaxAscent());
   344     INFO_PRINTF4(_L("FontMaxDescent() = %d; FontMaxHeight() = %d; FontLineGap() = %d"), 
   345             aFont.FontMaxDescent(), aFont.FontMaxHeight(), aFont.FontLineGap());
   346 	// Old metrics
   347 	TEST(KRequiredHeight == aFont.HeightInPixels());
   348 	TEST(19 == aFont.AscentInPixels());
   349 	TEST(KRequiredHeight - aFont.AscentInPixels() == aFont.DescentInPixels());
   350 	// New metrics
   351 	TEST(18 == aFont.FontCapitalAscent());
   352 	TEST(5  == aFont.FontStandardDescent());
   353 	if (GlyphSample::EScriptNone == aScript ||
   354 	        GlyphSample::EScriptLatin == aScript ||
   355 	        GlyphSample::EScriptGreek == aScript ||
   356 	        GlyphSample::EScriptCyrillic == aScript)	
   357 		{
   358 		TEST(28 == aFont.FontMaxAscent());
   359 		TEST(8 	== aFont.FontMaxDescent());
   360 		TEST(42 == aFont.FontLineGap());
   361 		}
   362 	else TEST(1 == 0);
   363 	TEST(aFont.FontMaxAscent() + aFont.FontMaxDescent() == aFont.FontMaxHeight());
   364 	INFO_PRINTF2(_L("MaxCharWidthInPixels() returns %d"), aFont.MaxCharWidthInPixels());
   365 	}
   366 
   367 /**
   368    @SYMTestCaseID          GRAPHICS-FNTSTORE-0004
   369 
   370    @SYMPREQ                PREQ533
   371 
   372    @SYMREQ                 REQ3800
   373 
   374    @SYMTestCaseDesc        Verifying font's metrics created by CFontStore::GetNearestFontToMaxHeightInPixels
   375 							with different TLanguage values.
   376 
   377    @SYMTestPriority        Critical
   378 
   379    @SYMTestStatus          Implemented
   380 
   381    @SYMTestActions         (1) Call GetNearestFontToMaxHeightInPixels with ELangNone.
   382                            (2) Call CFont's HeightInPixels, AscentInPixels, DescentInPixels, FontCapitalAscent,
   383 								FontStandardDescent, FontMaxAscent, FontMaxDescent, FontMaxHeight, and FontLineGap
   384 								to verify the font metrics of the returned font object.
   385                            (3) Repeat (1) and (2) with a Latin-based language, a Greek-based language, and a
   386 								Cyrillic-based language for the TLanguage parameter.
   387 
   388    @SYMTestExpectedResults See returned values in Verify_GetNearestFontToMaxHeightInPixels.
   389 */
   390 void CTFontMetrics::GetNearestFontToMaxHeightInPixels()
   391 	{
   392 	TOpenFontSpec openFontSpec = GetTOpenFontSpec();
   393 
   394 	INFO_PRINTF1(_L("GetNearestFontToMaxHeightInPixels().ELangNone"));
   395 	CFont* font = NULL;
   396 	openFontSpec.SetScriptTypeForMetrics(ELangNone);
   397 	iFontStore->GetNearestFontToMaxHeightInPixels(font, openFontSpec, KRequiredHeight);
   398 	Verify_GetNearestFontToMaxHeightInPixels(*font, openFontSpec.ScriptTypeForMetrics());
   399 	iFontStore->ReleaseFont(font);
   400 
   401 	INFO_PRINTF1(_L("GetNearestFontToMaxHeightInPixels().ELangFinnish"));
   402 	font = NULL;
   403 	openFontSpec.SetScriptTypeForMetrics(ELangFinnish);
   404 	iFontStore->GetNearestFontToMaxHeightInPixels(font, openFontSpec, KRequiredHeight);
   405 	Verify_GetNearestFontToMaxHeightInPixels(*font, openFontSpec.ScriptTypeForMetrics());
   406 	iFontStore->ReleaseFont(font);
   407 
   408 	INFO_PRINTF1(_L("GetNearestFontToMaxHeightInPixels().ELangGreek"));
   409 	font = NULL;
   410 	openFontSpec.SetScriptTypeForMetrics(ELangGreek);
   411 	iFontStore->GetNearestFontToMaxHeightInPixels(font, openFontSpec, KRequiredHeight);
   412 	Verify_GetNearestFontToMaxHeightInPixels(*font, openFontSpec.ScriptTypeForMetrics());
   413 	iFontStore->ReleaseFont(font);
   414 
   415 	INFO_PRINTF1(_L("GetNearestFontToMaxHeightInPixels().ELangRussian"));
   416 	font = NULL;
   417 	openFontSpec.SetScriptTypeForMetrics(ELangRussian);
   418 	iFontStore->GetNearestFontToMaxHeightInPixels(font, openFontSpec, KRequiredHeight);
   419 	Verify_GetNearestFontToMaxHeightInPixels(*font, openFontSpec.ScriptTypeForMetrics());
   420 	iFontStore->ReleaseFont(font);
   421 	}
   422 
   423 void CTFontMetrics::Verify_GetNearestFontToMaxHeightInPixels(const CFont& aFont, TInt aScript)
   424 	{
   425 	VerifyTypefaceNameAndID(aFont);
   426     INFO_PRINTF4(_L("HeightInPixels() = %d; AscentInPixels() = %d; DescentInPixels() = %d"), 
   427             aFont.HeightInPixels(), aFont.AscentInPixels(), aFont.DescentInPixels());
   428     INFO_PRINTF4(_L("FontCapitalAscent() = %d; FontStandardDescent() = %d; FontMaxAscent() = %d"), 
   429             aFont.FontCapitalAscent(), aFont.FontStandardDescent(), aFont.FontMaxAscent());
   430     INFO_PRINTF4(_L("FontMaxDescent() = %d; FontMaxHeight() = %d; FontLineGap() = %d"), 
   431             aFont.FontMaxDescent(), aFont.FontMaxHeight(), aFont.FontLineGap());
   432 	if (GlyphSample::EScriptNone == aScript)
   433 		{
   434 		// Old metrics
   435         TEST(16 == aFont.HeightInPixels());
   436         TEST(13 == aFont.AscentInPixels());
   437         TEST(16 - 13 == aFont.DescentInPixels());
   438         // New metrics
   439         TEST(12 == aFont.FontCapitalAscent());
   440         TEST(3  == aFont.FontStandardDescent());
   441         TEST(19 == aFont.FontMaxAscent());
   442         TEST(6  == aFont.FontMaxDescent());
   443         TEST(KRequiredHeight + 1 == aFont.FontMaxHeight());
   444         TEST(31 == aFont.FontLineGap());
   445 		}
   446 	else if (GlyphSample::EScriptLatin == aScript ||
   447 	        GlyphSample::EScriptGreek == aScript ||
   448 	        GlyphSample::EScriptCyrillic == aScript)
   449 	    {
   450         // Old metrics
   451         TEST(24 == aFont.HeightInPixels());
   452         TEST(19 == aFont.AscentInPixels());
   453         TEST(24 - 19 == aFont.DescentInPixels());
   454         // New metrics
   455         TEST(18 == aFont.FontCapitalAscent());
   456         TEST(5  == aFont.FontStandardDescent());
   457         TEST(28 == aFont.FontMaxAscent());
   458         TEST(8  == aFont.FontMaxDescent());
   459         TEST(KRequiredHeight + 12 == aFont.FontMaxHeight());
   460         TEST(42 == aFont.FontLineGap());
   461 	    }
   462 	else TEST(1 == 0);
   463 	INFO_PRINTF2(_L("MaxCharWidthInPixels() returns %d"), aFont.MaxCharWidthInPixels());
   464 	}
   465 
   466 void CTFontMetrics::VerifyTypefaceNameAndID(const CFont& aFont)
   467 	{
   468 	const TUid uid = {268435523};
   469 	TEST(uid == aFont.TypeUid());
   470 	TEST(!aFont.FontSpecInTwips().iTypeface.iName.CompareC(KTypefaceName));
   471 	}
   472 
   473 /**
   474 	@SYMTestCaseID
   475 	GRAPHICS-FNTSTORE-0029
   476 
   477 	@SYMTestCaseDesc
   478 	Tests if CTypefaceStore::iFontAccess generates false positives and
   479 	thus prevents GetNearestFontToDesignHeightInPixels from returning the correct fonts.
   480 	
   481 	@SYMTestActions
   482 	1. Creates a TOpenFontSpec object.
   483 	2. Sets name, height, italic and bold
   484 	3. Setting design height to some arbitrary value.
   485 	4. Gets the font which is the nearest to the given font specification.
   486 	5. Checks for errors.	
   487 	6. Verifies that existing font object created with the GetNearestFontToDesignHeightInPixels
   488 	   (having the wrong font metrics) should not prevent us from getting a new font object 
   489 	   with the GetNearestFontToMaxHeightInPixels.
   490 	7. Calling the GetNearestFontToMaxHeightInPixels function with
   491 	   different languages should still refer to the same font object,
   492 	   unless the language has an impact on metrics.
   493 	 
   494 	@SYMTestExpectedResults
   495 	Test should pass
   496 */
   497 void CTFontMetrics::FontAccessInCTypefaceStore()
   498 	{
   499 	TOpenFontSpec openFontSpec = GetTOpenFontSpec();
   500 	const TInt KMaxHeight = 24;
   501 
   502 	TInt rc = KErrGeneral;
   503 
   504 	CFont* font01 = NULL;
   505 	rc = iFontStore->GetNearestFontToDesignHeightInPixels(font01, openFontSpec);
   506 	TEST(KErrNone == rc);
   507 	TEST(NULL != font01);
   508 
   509 	CFont* font02 = NULL;
   510 	rc = iFontStore->GetNearestFontToDesignHeightInPixels(font02, openFontSpec);
   511 	TEST(KErrNone == rc);
   512 	TEST(NULL != font02);
   513 
   514 	CFont* font03 = NULL;
   515 	rc = iFontStore->GetNearestFontToMaxHeightInPixels(font03, openFontSpec, KMaxHeight);
   516 	TEST(KErrNone == rc);
   517 	TEST(NULL != font03);
   518 
   519 	// Setting design height to some arbitrary value
   520 	CFont* font04 = NULL;
   521 	openFontSpec.SetHeight(0);
   522 	rc = iFontStore->GetNearestFontToMaxHeightInPixels(font04, openFontSpec, KMaxHeight);
   523 	TEST(KErrNone == rc);
   524 	TEST(NULL != font04);
   525 
   526 	// Setting design height to some arbitrary value
   527 	CFont* font05 = NULL;
   528 	openFontSpec.SetHeight(font03->HeightInPixels());
   529 	rc = iFontStore->GetNearestFontToMaxHeightInPixels(font05, openFontSpec, KMaxHeight);
   530 	TEST(KErrNone == rc);
   531 	TEST(NULL != font05);
   532 
   533 	// Setting design height to that of an old-API generated font object
   534 	CFont* font06 = NULL;
   535 	openFontSpec.SetHeight(font01->HeightInPixels());
   536 	rc = iFontStore->GetNearestFontToMaxHeightInPixels(font06, openFontSpec, KMaxHeight);
   537 	TEST(KErrNone == rc);
   538 	TEST(NULL != font06);
   539 
   540 	CFont* font07 = NULL;
   541 	openFontSpec.SetScriptTypeForMetrics(ELangEnglish);
   542 	rc = iFontStore->GetNearestFontToMaxHeightInPixels(font07, openFontSpec, KMaxHeight);
   543 	TEST(KErrNone == rc);
   544 	TEST(NULL != font07);
   545 
   546 	CFont* font08 = NULL;
   547 	openFontSpec.SetScriptTypeForMetrics(ELangSwedish);
   548 	rc = iFontStore->GetNearestFontToMaxHeightInPixels(font08, openFontSpec, KMaxHeight);
   549 	TEST(KErrNone == rc);
   550 	TEST(NULL != font08);
   551 
   552 	// Using the same font specifications should return font objects from cache.
   553 	TEST(font01 == font02);
   554 	TEST(font03 == font04);
   555 	TEST(font03 == font05);
   556 	// Design height should be ignored when calling the GetNearestFontToMaxHeight... API.
   557 	TEST(font01 != font03);
   558 	// The existing font object created with the GetNearestFontToDesignHeight... API
   559 	// (thus having the wrong font metrics) should NOT prevent us from getting a new font
   560 	// object with the GetNearestFontToMaxHeight... API (with improved metrics.)
   561 	TEST(font01 != font06);
   562 	// Languages belonging to the same script should return the same font object.
   563 	TEST(font07 == font08);
   564 	// Calling the GetNearestFontToMaxHeight... API with
   565 	// languages belonging to different scripts may refer to different font objects.
   566 	// (Actually different with DejaVu fonts between no script specified and latin script.)
   567 	TEST(font06 != font07);
   568 
   569 	iFontStore->ReleaseFont(font01);
   570 	iFontStore->ReleaseFont(font02);
   571 	iFontStore->ReleaseFont(font03);
   572 	iFontStore->ReleaseFont(font04);
   573 	iFontStore->ReleaseFont(font05);
   574 	iFontStore->ReleaseFont(font06);
   575 	iFontStore->ReleaseFont(font07);
   576 	iFontStore->ReleaseFont(font08);
   577 	}
   578 
   579 /**
   580 	@SYMTestCaseID
   581 	GRAPHICS-FNTSTORE-0030
   582 
   583 	@SYMTestCaseDesc
   584 	Tests if two loaded fonts are the same if their glyphs are the same. 
   585 	Second request for the font with different flags should give reference to the 
   586 	same font.
   587 
   588 	@SYMTestActions
   589 	1. Creates a TOpenFontSpec object and sets name, height, italic and bold.
   590 	2. Gets the font which is the nearest to the given font specification.
   591 	3. Checks for errors.
   592 	4. Gets the font specification in twips.
   593 	5. Gets the font which is the nearest to the given font specification.
   594 	6. Checks for errors.
   595 	7. Verifies the fonts are the same.
   596 	8. Releases the fonts.
   597 	
   598 	@SYMTestExpectedResults
   599 	The fonts should be the same.
   600 */
   601 void CTFontMetrics::TestINC086513()
   602 	{
   603 	TOpenFontSpec openFontSpec = GetTOpenFontSpec();
   604 	CFont* theFont = NULL;
   605 	TInt rc = iFontStore->GetNearestFontToDesignHeightInPixels(theFont, openFontSpec);
   606 	TEST(KErrNone == rc);
   607 	TFontSpec fontSpec = theFont->FontSpecInTwips();
   608 	TTypeface typeface;
   609 	typeface.iName=fontSpec.iTypeface.iName;
   610 	typeface.SetIsProportional(!fontSpec.iTypeface.IsProportional());
   611 	CFont* theFont1 = NULL;
   612 	rc = iFontStore->GetNearestFontToDesignHeightInPixels(theFont1, openFontSpec);
   613 	TEST(rc==KErrNone);
   614 
   615 	TEST(theFont1==theFont);//fonts should be the same
   616 
   617 	iFontStore->ReleaseFont(theFont1);
   618 	iFontStore->ReleaseFont(theFont);
   619 	}
   620 	
   621 /*
   622 This test first marks a font as 'in use' and later tries to 
   623 delete all the fonts in the font store by sending the special
   624 code KNullUid. Before this would crash the server because 
   625 there are still fonts in use, but now it would just return safely.
   626 */
   627 void CTFontMetrics::TestPDEF099034()
   628 	{
   629 	INFO_PRINTF1(_L("Trying to remove all fonts in the font store\r\n"));
   630 	
   631 	TOpenFontSpec openFontSpec = GetTOpenFontSpec();
   632 	CFont* font = NULL;
   633 	TInt ret = iFontStore->GetNearestFontToDesignHeightInPixels(font, openFontSpec);
   634 	TEST(ret == KErrNone);
   635 	
   636 	TUid uid;
   637 	uid.iUid=0;
   638 	iFontStore->RemoveFile(uid);
   639 	
   640 	iFontStore->ReleaseFont(font);
   641 	}
   642 
   643 /**
   644 	@SYMTestCaseID GRAPHICS-FNTSTORE-0020
   645 	
   646 	@SYMDEF DEF101441
   647 
   648 	@SYMTestCaseDesc Tests GetNearestFontToMaxHeightInPixels with boundary max height and above.
   649 					 Tests GetNearestFontToMaxHeightInPixels with boundary min height i,e 1.
   650 
   651 	@SYMTestPriority High
   652 	
   653 	@SYMTestStatus Implemented
   654 
   655 	@SYMTestActions 1. Call GetNearestFontToMaxHeightInPixels with max height as 1025
   656 					2  Call GetNearestFontToMaxHeightInPixels with max height as 1
   657 					3. Call GetNearestFontToMaxHeightInPixels with max height as 1024
   658 	API Calls:
   659 	CFontStore::GetNearestFontToMaxHeightInPixels()
   660 
   661 	@SYMTestExpectedResults 1. For first call it should return KErrTooBig
   662 							2. For second call it should return KErrArgument
   663 							3. For Third call it should create the font with out any problem
   664 							return KErrNone.
   665 */
   666 void CTFontMetrics::TestGetNearestFontToMaxHeightInPixels()
   667 	{
   668 	TOpenFontSpec openFontSpec = GetTOpenFontSpec();
   669 	CFont* theFont = NULL;
   670 	
   671 	TInt rc = iFontStore->GetNearestFontToMaxHeightInPixels(theFont, openFontSpec, 1025);
   672 	TEST(KErrTooBig == rc);
   673 	TEST(NULL == theFont);
   674 
   675 	rc = iFontStore->GetNearestFontToMaxHeightInPixels(theFont, openFontSpec, 1);
   676 	TEST(KErrArgument == rc);
   677 	TEST(NULL == theFont);
   678 
   679 	rc = iFontStore->GetNearestFontToMaxHeightInPixels(theFont, openFontSpec, 1024);
   680 	TEST(NULL != theFont);
   681 
   682 	iFontStore->ReleaseFont(theFont);
   683 	}
   684 
   685 //--------------
   686 __CONSTRUCT_STEP__(FontMetrics)