Update contrib.
1 // Copyright (c) 2009-2010 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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
18 @internalComponent - Internal Symbian test code
21 #include <graphics/fbsglyphdataiterator.h>
22 #include <sgresource/sgimage.h>
24 #include "tfbsglyphdataoutlineshadow.h"
26 _LIT(KTypefaceName, "DejaVu Sans Condensed");
28 //Note: This test must be run with a rasterizer which supports EFourColourBlendGlyphBitmap (e.g. iType)
29 //otherwise the test will fail.
30 CTFbsGlyphDataOutlineAndShadow::CTFbsGlyphDataOutlineAndShadow(CTestStep* aStep) :
35 CTFbsGlyphDataOutlineAndShadow::~CTFbsGlyphDataOutlineAndShadow()
39 iTs->ReleaseFont(iFont);
44 void CTFbsGlyphDataOutlineAndShadow::ConstructL()
46 iTs = (CFbsTypefaceStore*)CFbsTypefaceStore::NewL(NULL);
48 fontSpec.iTypeface.iName = KTypefaceName;
49 fontSpec.iHeight = 15;
50 fontSpec.iFontStyle.SetBitmapType(EAntiAliasedGlyphBitmap);
51 fontSpec.iFontStyle.SetEffects(FontEffect::EDropShadow, EDropShadowOn);
52 fontSpec.iFontStyle.SetEffects(FontEffect::EOutline, EOutlineOn);
53 User::LeaveIfError(iTs->GetNearestFontToDesignHeightInPixels((CFont*&)iFont, fontSpec));
54 //now check if the font is what we requested
55 if(iFont->FontSpecInTwips().iFontStyle.BitmapType()!=EFourColourBlendGlyphBitmap)
57 WARN_PRINTF1(_L("Monotype font is not installed, run iType\\binaries\\ityperast.cmd to install it"));
58 User::Leave(KErrNotSupported);
63 @SYMTestCaseID GRAPHICS-FBSERV-0646
66 @SYMTestStatus Implemented
70 To ensure that glyph iterator doesn't support outline-and-shadow font
72 i. Call RFbsGlyphDataIterator::Open() with an outline-and-shadow font.
74 @SYMTestExpectedResults
75 RFbsGlyphDataIterator::Open() returns KErrNotSupported.
77 void CTFbsGlyphDataOutlineAndShadow::RunTestCaseL(TInt /*aCurTestCase*/)
79 INFO_PRINTF1(_L("Ensure that glyph iterator doesn't support outline-and-shadow font"));
80 ((CTFbsGlyphDataOutlineAndShadowStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0646"));
81 RFbsGlyphDataIterator iter;
82 const TUint glyphCode = 50;
83 TInt err = iter.Open(*iFont, &glyphCode, 1);
84 TESTE(err == KErrNotSupported, err);
87 ((CTFbsGlyphDataOutlineAndShadowStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);//_L("GRAPHICS-FBSERV-0645"));
88 ((CTFbsGlyphDataOutlineAndShadowStep*)iStep)->CloseTMSGraphicsStep();
90 ((CTFbsGlyphDataOutlineAndShadowStep*)iStep)->RecordTestResultL();
93 __CONSTRUCT_STEP__(FbsGlyphDataOutlineAndShadow)