sl@0: // Copyright (c) 2009-2010 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: @file sl@0: @internalComponent - Internal Symbian test code sl@0: */ sl@0: sl@0: #include sl@0: #include sl@0: sl@0: #include "tfbsglyphdataoutlineshadow.h" sl@0: sl@0: _LIT(KTypefaceName, "DejaVu Sans Condensed"); sl@0: sl@0: //Note: This test must be run with a rasterizer which supports EFourColourBlendGlyphBitmap (e.g. iType) sl@0: //otherwise the test will fail. sl@0: CTFbsGlyphDataOutlineAndShadow::CTFbsGlyphDataOutlineAndShadow(CTestStep* aStep) : sl@0: CTGraphicsBase(aStep) sl@0: { sl@0: } sl@0: sl@0: CTFbsGlyphDataOutlineAndShadow::~CTFbsGlyphDataOutlineAndShadow() sl@0: { sl@0: if (iTs) sl@0: { sl@0: iTs->ReleaseFont(iFont); sl@0: delete iTs; sl@0: } sl@0: } sl@0: sl@0: void CTFbsGlyphDataOutlineAndShadow::ConstructL() sl@0: { sl@0: iTs = (CFbsTypefaceStore*)CFbsTypefaceStore::NewL(NULL); sl@0: TFontSpec fontSpec; sl@0: fontSpec.iTypeface.iName = KTypefaceName; sl@0: fontSpec.iHeight = 15; sl@0: fontSpec.iFontStyle.SetBitmapType(EAntiAliasedGlyphBitmap); sl@0: fontSpec.iFontStyle.SetEffects(FontEffect::EDropShadow, EDropShadowOn); sl@0: fontSpec.iFontStyle.SetEffects(FontEffect::EOutline, EOutlineOn); sl@0: User::LeaveIfError(iTs->GetNearestFontToDesignHeightInPixels((CFont*&)iFont, fontSpec)); sl@0: //now check if the font is what we requested sl@0: if(iFont->FontSpecInTwips().iFontStyle.BitmapType()!=EFourColourBlendGlyphBitmap) sl@0: { sl@0: WARN_PRINTF1(_L("Monotype font is not installed, run iType\\binaries\\ityperast.cmd to install it")); sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID GRAPHICS-FBSERV-0646 sl@0: @SYMTestPriority High sl@0: @SYMTestType UT sl@0: @SYMTestStatus Implemented sl@0: @SYMPREQ PREQ2678 sl@0: sl@0: @SYMTestCaseDesc sl@0: To ensure that glyph iterator doesn't support outline-and-shadow font sl@0: @SYMTestActions sl@0: i. Call RFbsGlyphDataIterator::Open() with an outline-and-shadow font. sl@0: sl@0: @SYMTestExpectedResults sl@0: RFbsGlyphDataIterator::Open() returns KErrNotSupported. sl@0: */ sl@0: void CTFbsGlyphDataOutlineAndShadow::RunTestCaseL(TInt /*aCurTestCase*/) sl@0: { sl@0: INFO_PRINTF1(_L("Ensure that glyph iterator doesn't support outline-and-shadow font")); sl@0: ((CTFbsGlyphDataOutlineAndShadowStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0646")); sl@0: RFbsGlyphDataIterator iter; sl@0: const TUint glyphCode = 50; sl@0: TInt err = iter.Open(*iFont, &glyphCode, 1); sl@0: TESTE(err == KErrNotSupported, err); sl@0: iter.Close(); sl@0: sl@0: ((CTFbsGlyphDataOutlineAndShadowStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);//_L("GRAPHICS-FBSERV-0645")); sl@0: ((CTFbsGlyphDataOutlineAndShadowStep*)iStep)->CloseTMSGraphicsStep(); sl@0: TestComplete(); sl@0: ((CTFbsGlyphDataOutlineAndShadowStep*)iStep)->RecordTestResultL(); sl@0: } sl@0: sl@0: __CONSTRUCT_STEP__(FbsGlyphDataOutlineAndShadow)