sl@0: /* sl@0: * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * sl@0: */ sl@0: sl@0: sl@0: /** sl@0: @file sl@0: @test sl@0: @internalComponent Internal Symbian test code sl@0: */ sl@0: sl@0: #include sl@0: #include sl@0: #include "T_FontMetrics.h" sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: const TInt CTFontMetrics::KRequiredHeight = 24; sl@0: _LIT(KTypefaceName, "DejaVu Sans Condensed"); sl@0: _LIT(KFontFilePath, "z:\\resource\\fonts\\DejaVuSansCondensed.ttf"); sl@0: sl@0: LOCAL_C void ResetAndDestroyRImplInfoPtrArray(TAny* aPtr) sl@0: { sl@0: RImplInfoPtrArray* array = reinterpret_cast (aPtr); sl@0: array->ResetAndDestroy(); sl@0: } sl@0: sl@0: CTFontMetrics::CTFontMetrics(CTestStep* aStep) : sl@0: CTGraphicsBase(aStep) sl@0: { sl@0: } sl@0: sl@0: void CTFontMetrics::ConstructL() sl@0: { sl@0: iHeap = UserHeap::ChunkHeap(NULL, 0x10000, 0x10000); sl@0: if (NULL == iHeap) sl@0: User::Leave(KErrNoMemory); sl@0: iHeap->__DbgMarkStart(); sl@0: iFontStore = CFontStore::NewL(iHeap); sl@0: InstallRasterizerL(); sl@0: AddFileL(); sl@0: } sl@0: sl@0: CTFontMetrics::~CTFontMetrics() sl@0: { sl@0: delete iFontStore; sl@0: iHeap->__DbgMarkEnd(0); sl@0: iHeap->Close(); sl@0: User::Heap().Check(); sl@0: REComSession::FinalClose(); sl@0: } sl@0: sl@0: /** sl@0: Create a rasterizer and install it in the font store. sl@0: */ sl@0: void CTFontMetrics::InstallRasterizerL() sl@0: { sl@0: RImplInfoPtrArray implementationArray; sl@0: TCleanupItem cleanup(ResetAndDestroyRImplInfoPtrArray, &implementationArray); sl@0: CleanupStack::PushL(cleanup); sl@0: const TUid uid = {KUidOpenFontRasterizerPlunginInterface}; sl@0: sl@0: TRAPD(error, REComSession::ListImplementationsL(uid, implementationArray)); sl@0: TEST(error == KErrNone); sl@0: TEST(0 < implementationArray.Count()); sl@0: sl@0: COpenFontRasterizer* rasterizer = sl@0: COpenFontRasterizer::NewL(implementationArray[0]->ImplementationUid()); sl@0: TRAP(error, iFontStore->InstallRasterizerL(rasterizer)); sl@0: if (error) sl@0: { sl@0: delete rasterizer; sl@0: TEST(error == KErrNone); sl@0: } sl@0: CleanupStack::PopAndDestroy(&implementationArray); sl@0: } sl@0: sl@0: void CTFontMetrics::AddFileL() sl@0: { sl@0: iFontStore->AddFileL(KFontFilePath); sl@0: } sl@0: sl@0: TOpenFontSpec CTFontMetrics::GetTOpenFontSpec() sl@0: { sl@0: TOpenFontSpec openFontSpec; sl@0: openFontSpec.SetName(KTypefaceName); sl@0: openFontSpec.SetHeight(KRequiredHeight); sl@0: openFontSpec.SetItalic(EFalse); sl@0: openFontSpec.SetBold(EFalse); sl@0: return openFontSpec; sl@0: } sl@0: sl@0: void CTFontMetrics::RunTestCaseL(TInt aCurTestCase) sl@0: { sl@0: ((CTFontMetricsStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName); sl@0: switch ( aCurTestCase ) sl@0: { sl@0: case 1: sl@0: ((CTFontMetricsStep*)iStep)->SetTestStepID(_L("GRAPHICS-FNTSTORE-0029")); sl@0: FontAccessInCTypefaceStore(); sl@0: break; sl@0: case 2: sl@0: ((CTFontMetricsStep*)iStep)->SetTestStepID(_L("GRAPHICS-FNTSTORE-0002")); sl@0: TLanguage2GlyphSample(); sl@0: break; sl@0: case 3: sl@0: ((CTFontMetricsStep*)iStep)->SetTestStepID(_L("GRAPHICS-FNTSTORE-0003")); sl@0: GetNearestFontToDesignHeightInPixels(); sl@0: break; sl@0: case 4: sl@0: ((CTFontMetricsStep*)iStep)->SetTestStepID(_L("GRAPHICS-FNTSTORE-0004")); sl@0: GetNearestFontToMaxHeightInPixels(); sl@0: break; sl@0: case 5: sl@0: ((CTFontMetricsStep*)iStep)->SetTestStepID(_L("GRAPHICS-FNTSTORE-0030")); sl@0: TestINC086513(); sl@0: break; sl@0: case 6: sl@0: ((CTFontMetricsStep*)iStep)->SetTestStepID(_L("GRAPHICS-FNTSTORE-0020")); sl@0: TestGetNearestFontToMaxHeightInPixels(); sl@0: break; sl@0: case 7: sl@0: ((CTFontMetricsStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName); sl@0: ((CTFontMetricsStep*)iStep)->CloseTMSGraphicsStep(); sl@0: TestComplete(); sl@0: break; sl@0: } sl@0: ((CTFontMetricsStep*)iStep)->RecordTestResultL(); sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID GRAPHICS-FNTSTORE-0002 sl@0: sl@0: @SYMPREQ PREQ533 sl@0: sl@0: @SYMREQ REQ3800 sl@0: sl@0: @SYMTestCaseDesc Verifying GlyphSample::TLanguage2TScript and GlyphSample::TScript2GlyphSample sl@0: with different TLanguage values. sl@0: sl@0: @SYMTestPriority Critical sl@0: sl@0: @SYMTestStatus Implemented sl@0: sl@0: @SYMTestActions (1) Call TLanguage2TScript and then TScript2GlyphSample sl@0: with boundary cases ELangTest, ELangNone, ELangMaximum. sl@0: (2) Call TLanguage2TScript and then TScript2GlyphSample sl@0: with languages belonging to unsupported scripts. sl@0: (3) Call TLanguage2TScript and then TScript2GlyphSample sl@0: with languages belonging to Latin script. sl@0: (4) Repeat (3) for all other supported scripts. sl@0: sl@0: @SYMTestExpectedResults (1) and (2) - NULL sl@0: (3) and (4) - Languages belonging to the same script should return sl@0: the same address value pointing to the same set of glyph samples. sl@0: */ sl@0: void CTFontMetrics::TLanguage2GlyphSample() sl@0: { sl@0: // boundary cases sl@0: TEST(NULL == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangTest)).Ptr()); sl@0: TEST(NULL == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangNone)).Ptr()); sl@0: TEST(NULL == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangMaximum)).Ptr()); sl@0: // Not yet supported sl@0: TEST(NULL == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangAmharic)).Ptr()); sl@0: TEST(NULL == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangTigrinya)).Ptr()); sl@0: TEST(NULL == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangArmenian)).Ptr()); sl@0: TEST(NULL == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangTagalog)).Ptr()); sl@0: TEST(NULL == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangBengali)).Ptr()); sl@0: TEST(NULL == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangBurmese)).Ptr()); sl@0: TEST(NULL == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangGeorgian)).Ptr()); sl@0: TEST(NULL == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangGujarati)).Ptr()); sl@0: TEST(NULL == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangKannada)).Ptr()); sl@0: TEST(NULL == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangKhmer)).Ptr()); sl@0: TEST(NULL == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangLao)).Ptr()); sl@0: TEST(NULL == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangMalayalam)).Ptr()); sl@0: TEST(NULL == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangMongolian)).Ptr()); sl@0: TEST(NULL == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangPunjabi)).Ptr()); sl@0: TEST(NULL == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangSinhalese)).Ptr()); sl@0: TEST(NULL == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangTamil)).Ptr()); sl@0: TEST(NULL == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangTelugu)).Ptr()); sl@0: TEST(NULL == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangTibetan)).Ptr()); sl@0: // Latin sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangFrench))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangGerman))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangSpanish))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangItalian))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangSwedish))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangDanish))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangNorwegian))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangFinnish))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangAmerican))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangSwissFrench))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangSwissGerman))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangPortuguese))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangTurkish))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangIcelandic))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangHungarian))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangDutch))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangBelgianFlemish))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangAustralian))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangBelgianFrench))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangAustrian))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangNewZealand))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangInternationalFrench))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangCzech))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangSlovak))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangPolish))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangSlovenian))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangAfrikaans))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangAlbanian))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangCatalan))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangCroatian))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangCanadianEnglish))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangInternationalEnglish))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangSouthAfricanEnglish))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEstonian))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangCanadianFrench))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangScotsGaelic))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangIndonesian))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangIrish))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangSwissItalian))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangLatvian))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangLithuanian))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangMalay))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangMoldavian))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangNorwegianNynorsk))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangBrazilianPortuguese))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangRomanian))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangSomali))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangInternationalSpanish))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangLatinAmericanSpanish))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangSwahili))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangFinlandSwedish))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangCyprusTurkish))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangVietnamese))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangWelsh))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangEnglish)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangZulu))); sl@0: // Greek sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangGreek)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangCyprusGreek))); sl@0: // Cyrillic sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangRussian)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangBelarussian))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangRussian)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangBulgarian))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangRussian)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangKazakh))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangRussian)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangMacedonian))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangRussian)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangSerbian))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangRussian)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangTurkmen))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangRussian)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangUkrainian))); sl@0: // Hebrew sl@0: TEST(NULL != GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangHebrew)).Ptr()); sl@0: // Arabic sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangArabic)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangFarsi))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangArabic)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangUrdu))); sl@0: // Devanagari sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangHindi)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangMarathi))); sl@0: // Thai sl@0: TEST(NULL != GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangThai)).Ptr()); sl@0: // HanIdeographs sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangTaiwanChinese)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangHongKongChinese))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangTaiwanChinese)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangPrcChinese))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangTaiwanChinese)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangJapanese))); sl@0: TEST(GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangTaiwanChinese)) == GlyphSample::TScript2GlyphSample(GlyphSample::TLanguage2TScript(ELangKorean))); sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID GRAPHICS-FNTSTORE-0003 sl@0: sl@0: @SYMPREQ PREQ533 sl@0: sl@0: @SYMREQ REQ3800 sl@0: sl@0: @SYMTestCaseDesc Verifying font's metrics created by CFontStore::GetNearestFontToDesignHeightInPixels sl@0: with different TLanguage values. sl@0: sl@0: @SYMTestPriority Critical sl@0: sl@0: @SYMTestStatus Implemented sl@0: sl@0: @SYMTestActions (1) Call GetNearestFontToDesignHeightInPixels with ELangNone. sl@0: (2) Call CFont's HeightInPixels, AscentInPixels, DescentInPixels, FontCapitalAscent, sl@0: FontStandardDescent, FontMaxAscent, FontMaxDescent, FontMaxHeight, and FontLineGap sl@0: to verify the font metrics of the returned font object. sl@0: (3) Repeat (1) and (2) with a Latin-based language, a Greek-based language, and a sl@0: Cyrillic-based language for the TLanguage parameter. sl@0: sl@0: @SYMTestExpectedResults See returned values in Verify_GetNearestFontToDesignHeightInPixels. sl@0: */ sl@0: void CTFontMetrics::GetNearestFontToDesignHeightInPixels() sl@0: { sl@0: INFO_PRINTF3(_L("iKPixelWidthInTwips = %d; iKPixelHeightInTwips = %d"), sl@0: iFontStore->iKPixelWidthInTwips, iFontStore->iKPixelHeightInTwips); sl@0: sl@0: TOpenFontSpec openFontSpec = GetTOpenFontSpec(); sl@0: sl@0: INFO_PRINTF1(_L("GetNearestFontToDesignHeightInPixels().ELangNone")); sl@0: CFont* font = NULL; sl@0: openFontSpec.SetScriptTypeForMetrics(ELangNone); sl@0: iFontStore->GetNearestFontToDesignHeightInPixels(font, openFontSpec); sl@0: Verify_GetNearestFontToDesignHeightInPixels(*font, openFontSpec.ScriptTypeForMetrics()); sl@0: iFontStore->ReleaseFont(font); sl@0: sl@0: INFO_PRINTF1(_L("GetNearestFontToDesignHeightInPixels().ELangFinnish")); sl@0: font = NULL; sl@0: openFontSpec.SetScriptTypeForMetrics(ELangFinnish); sl@0: iFontStore->GetNearestFontToDesignHeightInPixels(font, openFontSpec); sl@0: Verify_GetNearestFontToDesignHeightInPixels(*font, openFontSpec.ScriptTypeForMetrics()); sl@0: iFontStore->ReleaseFont(font); sl@0: sl@0: INFO_PRINTF1(_L("GetNearestFontToDesignHeightInPixels().ELangGreek")); sl@0: font = NULL; sl@0: openFontSpec.SetScriptTypeForMetrics(ELangGreek); sl@0: iFontStore->GetNearestFontToDesignHeightInPixels(font, openFontSpec); sl@0: Verify_GetNearestFontToDesignHeightInPixels(*font, openFontSpec.ScriptTypeForMetrics()); sl@0: iFontStore->ReleaseFont(font); sl@0: sl@0: INFO_PRINTF1(_L("GetNearestFontToDesignHeightInPixels().ELangRussian")); sl@0: font = NULL; sl@0: openFontSpec.SetScriptTypeForMetrics(ELangRussian); sl@0: iFontStore->GetNearestFontToDesignHeightInPixels(font, openFontSpec); sl@0: Verify_GetNearestFontToDesignHeightInPixels(*font, openFontSpec.ScriptTypeForMetrics()); sl@0: iFontStore->ReleaseFont(font); sl@0: } sl@0: sl@0: void CTFontMetrics::Verify_GetNearestFontToDesignHeightInPixels(const CFont& aFont, TInt aScript) sl@0: { sl@0: VerifyTypefaceNameAndID(aFont); sl@0: INFO_PRINTF4(_L("HeightInPixels() = %d; AscentInPixels() = %d; DescentInPixels() = %d"), sl@0: aFont.HeightInPixels(), aFont.AscentInPixels(), aFont.DescentInPixels()); sl@0: INFO_PRINTF4(_L("FontCapitalAscent() = %d; FontStandardDescent() = %d; FontMaxAscent() = %d"), sl@0: aFont.FontCapitalAscent(), aFont.FontStandardDescent(), aFont.FontMaxAscent()); sl@0: INFO_PRINTF4(_L("FontMaxDescent() = %d; FontMaxHeight() = %d; FontLineGap() = %d"), sl@0: aFont.FontMaxDescent(), aFont.FontMaxHeight(), aFont.FontLineGap()); sl@0: // Old metrics sl@0: TEST(KRequiredHeight == aFont.HeightInPixels()); sl@0: TEST(19 == aFont.AscentInPixels()); sl@0: TEST(KRequiredHeight - aFont.AscentInPixels() == aFont.DescentInPixels()); sl@0: // New metrics sl@0: TEST(18 == aFont.FontCapitalAscent()); sl@0: TEST(5 == aFont.FontStandardDescent()); sl@0: if (GlyphSample::EScriptNone == aScript || sl@0: GlyphSample::EScriptLatin == aScript || sl@0: GlyphSample::EScriptGreek == aScript || sl@0: GlyphSample::EScriptCyrillic == aScript) sl@0: { sl@0: TEST(28 == aFont.FontMaxAscent()); sl@0: TEST(8 == aFont.FontMaxDescent()); sl@0: TEST(42 == aFont.FontLineGap()); sl@0: } sl@0: else TEST(1 == 0); sl@0: TEST(aFont.FontMaxAscent() + aFont.FontMaxDescent() == aFont.FontMaxHeight()); sl@0: INFO_PRINTF2(_L("MaxCharWidthInPixels() returns %d"), aFont.MaxCharWidthInPixels()); sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID GRAPHICS-FNTSTORE-0004 sl@0: sl@0: @SYMPREQ PREQ533 sl@0: sl@0: @SYMREQ REQ3800 sl@0: sl@0: @SYMTestCaseDesc Verifying font's metrics created by CFontStore::GetNearestFontToMaxHeightInPixels sl@0: with different TLanguage values. sl@0: sl@0: @SYMTestPriority Critical sl@0: sl@0: @SYMTestStatus Implemented sl@0: sl@0: @SYMTestActions (1) Call GetNearestFontToMaxHeightInPixels with ELangNone. sl@0: (2) Call CFont's HeightInPixels, AscentInPixels, DescentInPixels, FontCapitalAscent, sl@0: FontStandardDescent, FontMaxAscent, FontMaxDescent, FontMaxHeight, and FontLineGap sl@0: to verify the font metrics of the returned font object. sl@0: (3) Repeat (1) and (2) with a Latin-based language, a Greek-based language, and a sl@0: Cyrillic-based language for the TLanguage parameter. sl@0: sl@0: @SYMTestExpectedResults See returned values in Verify_GetNearestFontToMaxHeightInPixels. sl@0: */ sl@0: void CTFontMetrics::GetNearestFontToMaxHeightInPixels() sl@0: { sl@0: TOpenFontSpec openFontSpec = GetTOpenFontSpec(); sl@0: sl@0: INFO_PRINTF1(_L("GetNearestFontToMaxHeightInPixels().ELangNone")); sl@0: CFont* font = NULL; sl@0: openFontSpec.SetScriptTypeForMetrics(ELangNone); sl@0: iFontStore->GetNearestFontToMaxHeightInPixels(font, openFontSpec, KRequiredHeight); sl@0: Verify_GetNearestFontToMaxHeightInPixels(*font, openFontSpec.ScriptTypeForMetrics()); sl@0: iFontStore->ReleaseFont(font); sl@0: sl@0: INFO_PRINTF1(_L("GetNearestFontToMaxHeightInPixels().ELangFinnish")); sl@0: font = NULL; sl@0: openFontSpec.SetScriptTypeForMetrics(ELangFinnish); sl@0: iFontStore->GetNearestFontToMaxHeightInPixels(font, openFontSpec, KRequiredHeight); sl@0: Verify_GetNearestFontToMaxHeightInPixels(*font, openFontSpec.ScriptTypeForMetrics()); sl@0: iFontStore->ReleaseFont(font); sl@0: sl@0: INFO_PRINTF1(_L("GetNearestFontToMaxHeightInPixels().ELangGreek")); sl@0: font = NULL; sl@0: openFontSpec.SetScriptTypeForMetrics(ELangGreek); sl@0: iFontStore->GetNearestFontToMaxHeightInPixels(font, openFontSpec, KRequiredHeight); sl@0: Verify_GetNearestFontToMaxHeightInPixels(*font, openFontSpec.ScriptTypeForMetrics()); sl@0: iFontStore->ReleaseFont(font); sl@0: sl@0: INFO_PRINTF1(_L("GetNearestFontToMaxHeightInPixels().ELangRussian")); sl@0: font = NULL; sl@0: openFontSpec.SetScriptTypeForMetrics(ELangRussian); sl@0: iFontStore->GetNearestFontToMaxHeightInPixels(font, openFontSpec, KRequiredHeight); sl@0: Verify_GetNearestFontToMaxHeightInPixels(*font, openFontSpec.ScriptTypeForMetrics()); sl@0: iFontStore->ReleaseFont(font); sl@0: } sl@0: sl@0: void CTFontMetrics::Verify_GetNearestFontToMaxHeightInPixels(const CFont& aFont, TInt aScript) sl@0: { sl@0: VerifyTypefaceNameAndID(aFont); sl@0: INFO_PRINTF4(_L("HeightInPixels() = %d; AscentInPixels() = %d; DescentInPixels() = %d"), sl@0: aFont.HeightInPixels(), aFont.AscentInPixels(), aFont.DescentInPixels()); sl@0: INFO_PRINTF4(_L("FontCapitalAscent() = %d; FontStandardDescent() = %d; FontMaxAscent() = %d"), sl@0: aFont.FontCapitalAscent(), aFont.FontStandardDescent(), aFont.FontMaxAscent()); sl@0: INFO_PRINTF4(_L("FontMaxDescent() = %d; FontMaxHeight() = %d; FontLineGap() = %d"), sl@0: aFont.FontMaxDescent(), aFont.FontMaxHeight(), aFont.FontLineGap()); sl@0: if (GlyphSample::EScriptNone == aScript) sl@0: { sl@0: // Old metrics sl@0: TEST(16 == aFont.HeightInPixels()); sl@0: TEST(13 == aFont.AscentInPixels()); sl@0: TEST(16 - 13 == aFont.DescentInPixels()); sl@0: // New metrics sl@0: TEST(12 == aFont.FontCapitalAscent()); sl@0: TEST(3 == aFont.FontStandardDescent()); sl@0: TEST(19 == aFont.FontMaxAscent()); sl@0: TEST(6 == aFont.FontMaxDescent()); sl@0: TEST(KRequiredHeight + 1 == aFont.FontMaxHeight()); sl@0: TEST(31 == aFont.FontLineGap()); sl@0: } sl@0: else if (GlyphSample::EScriptLatin == aScript || sl@0: GlyphSample::EScriptGreek == aScript || sl@0: GlyphSample::EScriptCyrillic == aScript) sl@0: { sl@0: // Old metrics sl@0: TEST(24 == aFont.HeightInPixels()); sl@0: TEST(19 == aFont.AscentInPixels()); sl@0: TEST(24 - 19 == aFont.DescentInPixels()); sl@0: // New metrics sl@0: TEST(18 == aFont.FontCapitalAscent()); sl@0: TEST(5 == aFont.FontStandardDescent()); sl@0: TEST(28 == aFont.FontMaxAscent()); sl@0: TEST(8 == aFont.FontMaxDescent()); sl@0: TEST(KRequiredHeight + 12 == aFont.FontMaxHeight()); sl@0: TEST(42 == aFont.FontLineGap()); sl@0: } sl@0: else TEST(1 == 0); sl@0: INFO_PRINTF2(_L("MaxCharWidthInPixels() returns %d"), aFont.MaxCharWidthInPixels()); sl@0: } sl@0: sl@0: void CTFontMetrics::VerifyTypefaceNameAndID(const CFont& aFont) sl@0: { sl@0: const TUid uid = {268435523}; sl@0: TEST(uid == aFont.TypeUid()); sl@0: TEST(!aFont.FontSpecInTwips().iTypeface.iName.CompareC(KTypefaceName)); sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID sl@0: GRAPHICS-FNTSTORE-0029 sl@0: sl@0: @SYMTestCaseDesc sl@0: Tests if CTypefaceStore::iFontAccess generates false positives and sl@0: thus prevents GetNearestFontToDesignHeightInPixels from returning the correct fonts. sl@0: sl@0: @SYMTestActions sl@0: 1. Creates a TOpenFontSpec object. sl@0: 2. Sets name, height, italic and bold sl@0: 3. Setting design height to some arbitrary value. sl@0: 4. Gets the font which is the nearest to the given font specification. sl@0: 5. Checks for errors. sl@0: 6. Verifies that existing font object created with the GetNearestFontToDesignHeightInPixels sl@0: (having the wrong font metrics) should not prevent us from getting a new font object sl@0: with the GetNearestFontToMaxHeightInPixels. sl@0: 7. Calling the GetNearestFontToMaxHeightInPixels function with sl@0: different languages should still refer to the same font object, sl@0: unless the language has an impact on metrics. sl@0: sl@0: @SYMTestExpectedResults sl@0: Test should pass sl@0: */ sl@0: void CTFontMetrics::FontAccessInCTypefaceStore() sl@0: { sl@0: TOpenFontSpec openFontSpec = GetTOpenFontSpec(); sl@0: const TInt KMaxHeight = 24; sl@0: sl@0: TInt rc = KErrGeneral; sl@0: sl@0: CFont* font01 = NULL; sl@0: rc = iFontStore->GetNearestFontToDesignHeightInPixels(font01, openFontSpec); sl@0: TEST(KErrNone == rc); sl@0: TEST(NULL != font01); sl@0: sl@0: CFont* font02 = NULL; sl@0: rc = iFontStore->GetNearestFontToDesignHeightInPixels(font02, openFontSpec); sl@0: TEST(KErrNone == rc); sl@0: TEST(NULL != font02); sl@0: sl@0: CFont* font03 = NULL; sl@0: rc = iFontStore->GetNearestFontToMaxHeightInPixels(font03, openFontSpec, KMaxHeight); sl@0: TEST(KErrNone == rc); sl@0: TEST(NULL != font03); sl@0: sl@0: // Setting design height to some arbitrary value sl@0: CFont* font04 = NULL; sl@0: openFontSpec.SetHeight(0); sl@0: rc = iFontStore->GetNearestFontToMaxHeightInPixels(font04, openFontSpec, KMaxHeight); sl@0: TEST(KErrNone == rc); sl@0: TEST(NULL != font04); sl@0: sl@0: // Setting design height to some arbitrary value sl@0: CFont* font05 = NULL; sl@0: openFontSpec.SetHeight(font03->HeightInPixels()); sl@0: rc = iFontStore->GetNearestFontToMaxHeightInPixels(font05, openFontSpec, KMaxHeight); sl@0: TEST(KErrNone == rc); sl@0: TEST(NULL != font05); sl@0: sl@0: // Setting design height to that of an old-API generated font object sl@0: CFont* font06 = NULL; sl@0: openFontSpec.SetHeight(font01->HeightInPixels()); sl@0: rc = iFontStore->GetNearestFontToMaxHeightInPixels(font06, openFontSpec, KMaxHeight); sl@0: TEST(KErrNone == rc); sl@0: TEST(NULL != font06); sl@0: sl@0: CFont* font07 = NULL; sl@0: openFontSpec.SetScriptTypeForMetrics(ELangEnglish); sl@0: rc = iFontStore->GetNearestFontToMaxHeightInPixels(font07, openFontSpec, KMaxHeight); sl@0: TEST(KErrNone == rc); sl@0: TEST(NULL != font07); sl@0: sl@0: CFont* font08 = NULL; sl@0: openFontSpec.SetScriptTypeForMetrics(ELangSwedish); sl@0: rc = iFontStore->GetNearestFontToMaxHeightInPixels(font08, openFontSpec, KMaxHeight); sl@0: TEST(KErrNone == rc); sl@0: TEST(NULL != font08); sl@0: sl@0: // Using the same font specifications should return font objects from cache. sl@0: TEST(font01 == font02); sl@0: TEST(font03 == font04); sl@0: TEST(font03 == font05); sl@0: // Design height should be ignored when calling the GetNearestFontToMaxHeight... API. sl@0: TEST(font01 != font03); sl@0: // The existing font object created with the GetNearestFontToDesignHeight... API sl@0: // (thus having the wrong font metrics) should NOT prevent us from getting a new font sl@0: // object with the GetNearestFontToMaxHeight... API (with improved metrics.) sl@0: TEST(font01 != font06); sl@0: // Languages belonging to the same script should return the same font object. sl@0: TEST(font07 == font08); sl@0: // Calling the GetNearestFontToMaxHeight... API with sl@0: // languages belonging to different scripts may refer to different font objects. sl@0: // (Actually different with DejaVu fonts between no script specified and latin script.) sl@0: TEST(font06 != font07); sl@0: sl@0: iFontStore->ReleaseFont(font01); sl@0: iFontStore->ReleaseFont(font02); sl@0: iFontStore->ReleaseFont(font03); sl@0: iFontStore->ReleaseFont(font04); sl@0: iFontStore->ReleaseFont(font05); sl@0: iFontStore->ReleaseFont(font06); sl@0: iFontStore->ReleaseFont(font07); sl@0: iFontStore->ReleaseFont(font08); sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID sl@0: GRAPHICS-FNTSTORE-0030 sl@0: sl@0: @SYMTestCaseDesc sl@0: Tests if two loaded fonts are the same if their glyphs are the same. sl@0: Second request for the font with different flags should give reference to the sl@0: same font. sl@0: sl@0: @SYMTestActions sl@0: 1. Creates a TOpenFontSpec object and sets name, height, italic and bold. sl@0: 2. Gets the font which is the nearest to the given font specification. sl@0: 3. Checks for errors. sl@0: 4. Gets the font specification in twips. sl@0: 5. Gets the font which is the nearest to the given font specification. sl@0: 6. Checks for errors. sl@0: 7. Verifies the fonts are the same. sl@0: 8. Releases the fonts. sl@0: sl@0: @SYMTestExpectedResults sl@0: The fonts should be the same. sl@0: */ sl@0: void CTFontMetrics::TestINC086513() sl@0: { sl@0: TOpenFontSpec openFontSpec = GetTOpenFontSpec(); sl@0: CFont* theFont = NULL; sl@0: TInt rc = iFontStore->GetNearestFontToDesignHeightInPixels(theFont, openFontSpec); sl@0: TEST(KErrNone == rc); sl@0: TFontSpec fontSpec = theFont->FontSpecInTwips(); sl@0: TTypeface typeface; sl@0: typeface.iName=fontSpec.iTypeface.iName; sl@0: typeface.SetIsProportional(!fontSpec.iTypeface.IsProportional()); sl@0: CFont* theFont1 = NULL; sl@0: rc = iFontStore->GetNearestFontToDesignHeightInPixels(theFont1, openFontSpec); sl@0: TEST(rc==KErrNone); sl@0: sl@0: TEST(theFont1==theFont);//fonts should be the same sl@0: sl@0: iFontStore->ReleaseFont(theFont1); sl@0: iFontStore->ReleaseFont(theFont); sl@0: } sl@0: sl@0: /* sl@0: This test first marks a font as 'in use' and later tries to sl@0: delete all the fonts in the font store by sending the special sl@0: code KNullUid. Before this would crash the server because sl@0: there are still fonts in use, but now it would just return safely. sl@0: */ sl@0: void CTFontMetrics::TestPDEF099034() sl@0: { sl@0: INFO_PRINTF1(_L("Trying to remove all fonts in the font store\r\n")); sl@0: sl@0: TOpenFontSpec openFontSpec = GetTOpenFontSpec(); sl@0: CFont* font = NULL; sl@0: TInt ret = iFontStore->GetNearestFontToDesignHeightInPixels(font, openFontSpec); sl@0: TEST(ret == KErrNone); sl@0: sl@0: TUid uid; sl@0: uid.iUid=0; sl@0: iFontStore->RemoveFile(uid); sl@0: sl@0: iFontStore->ReleaseFont(font); sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID GRAPHICS-FNTSTORE-0020 sl@0: sl@0: @SYMDEF DEF101441 sl@0: sl@0: @SYMTestCaseDesc Tests GetNearestFontToMaxHeightInPixels with boundary max height and above. sl@0: Tests GetNearestFontToMaxHeightInPixels with boundary min height i,e 1. sl@0: sl@0: @SYMTestPriority High sl@0: sl@0: @SYMTestStatus Implemented sl@0: sl@0: @SYMTestActions 1. Call GetNearestFontToMaxHeightInPixels with max height as 1025 sl@0: 2 Call GetNearestFontToMaxHeightInPixels with max height as 1 sl@0: 3. Call GetNearestFontToMaxHeightInPixels with max height as 1024 sl@0: API Calls: sl@0: CFontStore::GetNearestFontToMaxHeightInPixels() sl@0: sl@0: @SYMTestExpectedResults 1. For first call it should return KErrTooBig sl@0: 2. For second call it should return KErrArgument sl@0: 3. For Third call it should create the font with out any problem sl@0: return KErrNone. sl@0: */ sl@0: void CTFontMetrics::TestGetNearestFontToMaxHeightInPixels() sl@0: { sl@0: TOpenFontSpec openFontSpec = GetTOpenFontSpec(); sl@0: CFont* theFont = NULL; sl@0: sl@0: TInt rc = iFontStore->GetNearestFontToMaxHeightInPixels(theFont, openFontSpec, 1025); sl@0: TEST(KErrTooBig == rc); sl@0: TEST(NULL == theFont); sl@0: sl@0: rc = iFontStore->GetNearestFontToMaxHeightInPixels(theFont, openFontSpec, 1); sl@0: TEST(KErrArgument == rc); sl@0: TEST(NULL == theFont); sl@0: sl@0: rc = iFontStore->GetNearestFontToMaxHeightInPixels(theFont, openFontSpec, 1024); sl@0: TEST(NULL != theFont); sl@0: sl@0: iFontStore->ReleaseFont(theFont); sl@0: } sl@0: sl@0: //-------------- sl@0: __CONSTRUCT_STEP__(FontMetrics)