Update contrib.
2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
15 * Tests FNTSTORE with respect to the Open Font system.
16 * Creates a dummy rasterizer and tests font file loading and unloading and
17 * font creation. This just exercises the way the Open Font system connects to the
18 * 'classic' bitmap-font-only font system.
26 @internalComponent Internal Symbian test code
31 #include <graphics/shaperparams.h>
32 #include <graphics/fbsdefs.h>
35 _LIT(KFBSERVFontDir,"\\resource\\fonts\\");
39 _LIT(KFontDummy,"z:\\PlatTest\\Graphics\\TestData\\dummy_fonts\\dummy");
40 _LIT(KFontDummy_b,"z:\\PlatTest\\Graphics\\TestData\\dummy_fonts\\dummy_b");
41 _LIT(KFontDummy_i,"z:\\PlatTest\\Graphics\\TestData\\dummy_fonts\\dummy_i");
42 _LIT(KFontDummy_bi,"z:\\PlatTest\\Graphics\\TestData\\dummy_fonts\\dummy_bi");
44 const TUint32 KDevanagariScriptCode = 0x64657661;
45 _LIT16(KTextToShape, "\x0915\x094D\x0937\x0924\x094D\x0930\x093F\x092F");
50 CDummyShaperFactory* CDummyShaperFactory::NewL()
52 CDummyShaperFactory* r = new(ELeave) CDummyShaperFactory;
56 CDummyShaperFactory::CDummyShaperFactory()
60 CDummyShaperFactory::~CDummyShaperFactory()
66 CShaper* CDummyShaperFactory::NewShaperL(CBitmapFont* aBitmapfont, TInt aScript, TInt aLanguage, RHeap* aHeap)
68 return CDummyShaper::NewL(aBitmapfont, aScript, aLanguage, aHeap);
71 void* CShaperFactory::ExtendedInterface(TUid /*aInterfaceId*/)
77 CShaper * CDummyShaper::NewL(CBitmapFont* aBitmapfont, TInt aScript, TInt aLanguage, RHeap* aHeap)
79 CDummyShaper* newShaper = new(ELeave)CDummyShaper();
80 CleanupStack::PushL(newShaper);
81 TInt error = newShaper->ConstructL(aBitmapfont, aScript, aLanguage, aHeap);
83 // if the layout engine fails to construct with this font return NULL
84 if (error == KErrNone )
86 CleanupStack::Pop(); // newShaper
91 CleanupStack::PopAndDestroy();
98 Construct an instance of CDummyShaper
99 @param aOpenFont The required font
100 @param aHeap The heap to be used for storage by the engine
101 @return KErrNone if successful or a system wide error code.
102 Note that KErrGeneral may be returned in certain out of memory situations.
105 TInt CDummyShaper::ConstructL(CBitmapFont* /*aBitmapfont*/, TInt /*aScript*/, TInt /*aLanguage*/, RHeap* /*aHeap*/ )
110 CDummyShaper::CDummyShaper()
115 Frees all resources owned by ...
117 CDummyShaper::~CDummyShaper()
121 /** This is implementation of CShaper::ShapeText for the Icu layout Engine
122 The data is taken from TInput and pass to the shaper.
123 A memory buffer is allocated on aHeapForOutput starting with TShapeHeader is allocated.
124 The results of the shaping are copied into this buffer and passed back via aOutput.
125 @param aOutput On success a new structure containing the results allocated on aHeapForOutput.
126 @param aInput The input text and other parameters.
127 @param aHeapForOutput On success, aOutput should be allocated from this and nothing else.
128 On failure, nothing should be allocated from it.
129 @return Error value from one of the system-wide error codes on failure, KErrNone on success.
130 @see CShaper::ShapeText
132 TInt CDummyShaper::ShapeText(TShapeHeader*& /*aOutput*/, const TInput& /*aInput*/, RHeap* /*aHeapForOutput*/)
134 // This shaper doesnt return any results
135 return KErrNotSupported;
138 class CDummyFontFile: public COpenFontFile
141 static CDummyFontFile* NewL(TInt aUid,const TDesC& aFileName);
142 TBool GetNearestFontHelperOld(const TOpenFontSpec& aDesiredFontSpec,TInt aPixelWidth,TInt aPixelHeight,
143 TInt& aFaceIndex,TOpenFontSpec& aActualFontSpec) const;
145 CDummyFontFile(TInt aUid,const TDesC& aFileName);
147 // From COpenFontFile
148 void GetNearestFontInPixelsL(RHeap* aHeap,COpenFontSessionCacheList* aSessionCacheList,
149 const TOpenFontSpec& aDesiredFontSpec,TInt aPixelWidth,TInt aPixelHeight,
150 COpenFont*& aFont,TOpenFontSpec& aActualFontSpec);
151 void GetNearestFontToDesignHeightInPixelsL(RHeap* aHeap,COpenFontSessionCacheList* aSessionCacheList,
152 const TOpenFontSpec& aDesiredFontSpec,TInt aPixelWidth,TInt aPixelHeight,
153 COpenFont*& aFont,TOpenFontSpec& aActualFontSpec);
154 void GetNearestFontToMaxHeightInPixelsL(RHeap* aHeap,COpenFontSessionCacheList* aSessionCacheList,
155 const TOpenFontSpec& aDesiredFontSpec,TInt aPixelWidth,TInt aPixelHeight,
156 COpenFont*& aFont,TOpenFontSpec& aActualFontSpec, TInt aMaxHeight);
157 virtual TBool HasUnicodeCharacterL(TInt aFaceIndex,TInt aCode) const;
160 class CDummyFont: public COpenFont
163 static CDummyFont* NewL(RHeap* aHeap,COpenFontSessionCacheList* aSessionCacheList,CDummyFontFile* aFontFile,TInt aSizeInPixels);
165 CDummyFont(RHeap* aHeap,COpenFontSessionCacheList* aSessionCacheList,CDummyFontFile* aFontFile,TInt aSizeInPixels);
167 virtual void RasterizeL(TInt aCode,TOpenFontGlyphData* aGlyphData);
170 CTFsOpen::CTFsOpen(CTestStep* aStep) :
171 CTGraphicsBase(aStep)
173 INFO_PRINTF1(_L("FontStore and the Open Font System"));
176 CTFsOpen::~CTFsOpen()
180 iHeap->__DbgMarkEnd(0);
183 User::Heap().Check();
186 void CTFsOpen::ConstructL()
189 iHeap = UserHeap::ChunkHeap(NULL,0x10000,0x10000);
191 User::Leave(KErrGeneral);
192 iHeap->__DbgMarkStart();
193 iFontStore = CFontStore::NewL(iHeap);
195 // Install the dummy rasterizer.
196 COpenFontRasterizer* r = CDummyRasterizer::NewL();
197 CleanupStack::PushL(r);
198 iFontStore->InstallRasterizerL(r);
201 // Install the dummy shaper
202 CShaperFactory* shaperFactory = CDummyShaperFactory::NewL();
203 CleanupStack::PushL(shaperFactory);
204 iFontStore->InstallShaperFactoryL(shaperFactory);
208 void CTFsOpen::RunTestCaseL(TInt aCurTestCase)
210 ((CTFsOpenStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
214 ((CTFsOpenStep*)iStep)->SetTestStepID(_L("GRAPHICS-FNTSTORE-0031"));
215 AddAndRemoveFilesL();
218 ((CTFsOpenStep*)iStep)->SetTestStepID(_L("GRAPHICS-FNTSTORE-0032"));
219 CreateAndReleaseFontsL();
222 ((CTFsOpenStep*)iStep)->SetTestStepID(_L("GRAPHICS-FNTSTORE-0033"));
224 TestGetNearestFontHelperL();
228 ((CTFsOpenStep*)iStep)->SetTestStepID(_L("GRAPHICS-SYSLIB-FNTSTORE-UT-1498"));
232 ((CTFsOpenStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
233 ((CTFsOpenStep*)iStep)->CloseTMSGraphicsStep();
237 ((CTFsOpenStep*)iStep)->RecordTestResultL();
242 GRAPHICS-FNTSTORE-0031
245 Tests adding and removing files from the font store.
248 1. Finds or creates a font file object to support a font file.
249 If an appropriate font file object exists then no new open font file is created.
250 In this case the reference count of the font file object is incremented.
251 2. Gets the number of typefaces held in the font store.
252 3. Checks all fonts are in the same typeface family.
253 4. Checks all fonts have different FontStore ids.
254 5. Tries to add a font (which has been added once already) and checks it gets
255 the same id as when it was added.
256 6. Releases four load fonts.
257 7. Checks font that was loaded twice should still be loaded.
258 8. Removes last reference a font and checks all fonts are unloaded correctly.
260 @SYMTestExpectedResults
263 void CTFsOpen::AddAndRemoveFilesL()
265 TEST(iFontStore->NumTypefaces() == 0);
267 INFO_PRINTF1(_L("loading dummy Open Fonts\n"));
269 TUid id1 = iFontStore->AddFileL(KFontDummy);
270 TUid id2 = iFontStore->AddFileL(KFontDummy_b);
271 TUid id3 = iFontStore->AddFileL(KFontDummy_i);
272 TUid id4 = iFontStore->AddFileL(KFontDummy_bi);
274 // all fonts are in the same typeface family
275 INFO_PRINTF1(_L("increasing reference count for for an Open Font file\n"));
276 TEST(iFontStore->NumTypefaces() == 1);
278 // ids should each be different
286 // ask for one of the font files again
287 TUid id5 = iFontStore->AddFileL(KFontDummy_bi);
289 // should get the same UID as the first time
292 INFO_PRINTF1(_L("unloading dummy Open Fonts\n"));
293 iFontStore->RemoveFile(id1);
294 iFontStore->RemoveFile(id2);
295 iFontStore->RemoveFile(id3);
296 iFontStore->RemoveFile(id4);
298 // font that was loaded twice should still be loaded
299 TEST(iFontStore->NumTypefaces() == 1);
301 // remove last reference
302 iFontStore->RemoveFile(id5);
304 // all fonts unloaded
305 TEST(iFontStore->NumTypefaces() == 0);
308 void CTFsOpen::TestFont(const TFontSpec& aSpec)
310 iHeap->__DbgMarkStart();
313 TInt error = iFontStore->GetNearestFontToDesignHeightInTwips(font,aSpec);
314 TEST(error == KErrNone);
316 INFO_PRINTF2(_L("desired font spec: %S: "),&aSpec.iTypeface.iName);
317 if (aSpec.iFontStyle.StrokeWeight() == EStrokeWeightBold)
318 INFO_PRINTF1(_L("bold "));
319 if (aSpec.iFontStyle.Posture() == EPostureItalic)
320 INFO_PRINTF1(_L("italic "));
321 INFO_PRINTF2(_L("%dpt"),(aSpec.iHeight + 10) / 20);
322 INFO_PRINTF1(_L("\n"));
323 TFontSpec actual_spec = font->FontSpecInTwips();
324 INFO_PRINTF2(_L("actual font spec: %S: "),&actual_spec.iTypeface.iName);
325 if (actual_spec.iFontStyle.StrokeWeight() == EStrokeWeightBold)
326 INFO_PRINTF1(_L("bold "));
327 if (actual_spec.iFontStyle.Posture() == EPostureItalic)
328 INFO_PRINTF1(_L("italic "));
329 INFO_PRINTF2(_L("%dpt"),(actual_spec.iHeight + 10) / 20);
330 INFO_PRINTF1(_L("\n"));
331 iFontStore->ReleaseFont(font);
333 TEST (iHeap->__DbgMarkEnd(0) == 0);
338 GRAPHICS-FNTSTORE-0032
341 Creates fonts and tests their properties
342 and then releases them.
345 1. Adds four files to the font store.
346 2. Retrieves number of typefaces.
347 3. For all of the typefaces available it gets
348 the typeface support and retrieves its font height
350 4. Tests the fonts properties.
351 5. Releases a hold on all font file objects allocated.
353 @SYMTestExpectedResults
356 void CTFsOpen::CreateAndReleaseFontsL()
358 TUid id1 = iFontStore->AddFileL(KFontDummy);
359 TUid id2 = iFontStore->AddFileL(KFontDummy_b);
360 TUid id3 = iFontStore->AddFileL(KFontDummy_i);
361 TUid id4 = iFontStore->AddFileL(KFontDummy_bi);
363 int typefaces = iFontStore->NumTypefaces();
364 for (int typeface = 0; typeface < typefaces; typeface++)
366 TTypefaceSupport support;
367 iFontStore->TypefaceSupport(support,typeface);
369 fs.iTypeface = support.iTypeface;
370 for (int height = 0; height < support.iNumHeights; height++)
372 fs.iHeight = iFontStore->FontHeightInTwips(typeface,height);
377 iFontStore->RemoveFile(id1);
378 iFontStore->RemoveFile(id2);
379 iFontStore->RemoveFile(id3);
380 iFontStore->RemoveFile(id4);
385 @SYMTestCaseID GRAPHICS-SYSLIB-FNTSTORE-UT-1498
386 @SYMTestCaseDesc Test the Shaper API
387 @SYMTestPriority High
388 @SYMTestActions This test checks the CBitmapFont::ShapeTextL() using a dummy font and a dummy shaper
389 @SYMTestExpectedResults The test must not fail.
392 void CTFsOpen::CreateShaperL()
395 INFO_PRINTF1(_L("Creating Shaper and Shaping Text\n"));
398 TUid id1 = iFontStore->AddFileL(KFontDummy);
399 TUid id2 = iFontStore->AddFileL(KFontDummy_b);
400 TUid id3 = iFontStore->AddFileL(KFontDummy_i);
401 TUid id4 = iFontStore->AddFileL(KFontDummy_bi);
405 int typefaces = iFontStore->NumTypefaces();
406 for (TInt typeface = 0; typeface < typefaces; typeface++)
408 TTypefaceSupport support;
409 iFontStore->TypefaceSupport(support,typeface);
411 fs.iTypeface = support.iTypeface;
412 for (TInt height = 0; height < support.iNumHeights; height++)
416 fs.iHeight = iFontStore->FontHeightInTwips(typeface,height);
417 // get a COpenFont object
418 iFontStore->GetNearestFontToDesignHeightInPixels(font, fs);
419 CleanupStack::PushL(font);
421 //do some dummy shaping
422 TShapeHeader* shape = 0;
424 TShapeMessageParameters params;
427 params.iScript = KDevanagariScriptCode;
428 params.iLanguage = 0;
431 TRAP(err, shape = ((CBitmapFont*)font)->ShapeTextL(KTextToShape, 0, params));
432 TEST(err == KErrNotSupported);
434 // Now do some dummy deletion of the TShapeHeader
436 TRAP(error, ((CBitmapFont*)font)->DeleteShape(dummyHandle,shape));
437 TEST(error == KErrNone);
438 CleanupStack::Pop(font);
439 iFontStore->ReleaseFont(font);
444 iFontStore->RemoveFile(id1);
445 iFontStore->RemoveFile(id2);
446 iFontStore->RemoveFile(id3);
447 iFontStore->RemoveFile(id4);
452 /** End of Shaper Tests*/
456 GRAPHICS-FNTSTORE-0033
459 Tests the GetNearestFontHelper function. This function may be used by
460 derived classes in their GetNearestFontInPixelsL()
461 implementations. It finds the nearest font in the typeface attribute array,
462 if any, to the provided font specification. If there is a possible match it
463 places the face index in aFaceIndex and the actual specification (including
464 algorithmic effects) in aActualFontSpec.
467 1. Connects to the file system.
468 2. Finds a specified file.
469 3. Retrieves a font file.
470 4. Sets different font attributes.
471 5. Calls the GetNearestFontHelper and GetNearestFontHelperOld functions.
472 6. Checks if the two functions give the same result.
474 @SYMTestExpectedResults
478 void CTFsOpen::TestGetNearestFontHelperL()
480 INFO_PRINTF1(_L("GetNearestFontHelper\n"));
481 User::LeaveIfError(iFilesys.Connect());
482 TFindFile file_finder(iFilesys);
483 CDir* file_list = NULL;
484 _LIT(KFBSERVFontFilePattern, "*.ttf");
485 TInt error = file_finder.FindWildByDir(KFBSERVFontFilePattern,KFBSERVFontDir,file_list);
488 CleanupStack::PushL(file_list);
489 for (int i = 0; i < file_list->Count(); i++)
492 if (parse.Set((*file_list)[i].iName,&file_finder.File(),NULL) == KErrNone)
494 TPtrC name = parse.Name();
495 INFO_PRINTF2(_L("Font file: %S\r\n"), &name);
496 CDummyFontFile* font_file = CDummyFontFile::NewL(0,parse.FullName());
498 TOpenFontSpec font_spec1;
499 TOpenFontSpec font_spec2_new;
500 TOpenFontSpec font_spec2_old;
504 font_spec1.SetName(KNullDesC);
505 font_spec1.SetHeight(10);
507 font_spec1.SetCoverage(0,0,0,0);
508 font_spec1.SetBold(EFalse);
509 font_spec1.SetItalic(EFalse);
510 font_spec1.SetSerif(EFalse);
511 font_spec1.SetMonoWidth(EFalse);
512 TBool res1 = font_file->GetNearestFontHelper(font_spec1,0,0,face_index,font_spec2_new);
513 TBool res2 = font_file->GetNearestFontHelperOld(font_spec1,0,0,face_index,font_spec2_old);
514 TEST(res2 ? res1 && (font_spec2_new == font_spec2_old) : ETrue);
516 font_spec1.SetBold(ETrue);
517 res1 = font_file->GetNearestFontHelper(font_spec1,0,0,face_index,font_spec2_new);
518 res2 = font_file->GetNearestFontHelperOld(font_spec1,0,0,face_index,font_spec2_old);
519 TEST(res2 ? res1 && (font_spec2_new == font_spec2_old) : ETrue);
521 font_spec1.SetItalic(ETrue);
522 res1 = font_file->GetNearestFontHelper(font_spec1,0,0,face_index,font_spec2_new);
523 res2 = font_file->GetNearestFontHelperOld(font_spec1,0,0,face_index,font_spec2_old);
524 TEST(res2 ? res1 && (font_spec2_new == font_spec2_old) : ETrue);
526 font_spec1.SetSerif(ETrue);
527 res1 = font_file->GetNearestFontHelper(font_spec1,0,0,face_index,font_spec2_new);
528 res2 = font_file->GetNearestFontHelperOld(font_spec1,0,0,face_index,font_spec2_old);
529 TEST(res2 ? res1 && (font_spec2_new == font_spec2_old) : ETrue);
531 font_spec1.SetMonoWidth(ETrue);
532 res1 = font_file->GetNearestFontHelper(font_spec1,0,0,face_index,font_spec2_new);
533 res2 = font_file->GetNearestFontHelperOld(font_spec1,0,0,face_index,font_spec2_old);
534 TEST(res2 ? res1 && (font_spec2_new == font_spec2_old) : ETrue);
536 font_spec1.SetCoverage(8);
537 font_spec1.SetBold(EFalse);
538 font_spec1.SetItalic(EFalse);
539 font_spec1.SetSerif(EFalse);
540 font_spec1.SetMonoWidth(EFalse);
541 res1 = font_file->GetNearestFontHelper(font_spec1,0,0,face_index,font_spec2_new);
542 res2 = font_file->GetNearestFontHelperOld(font_spec1,0,0,face_index,font_spec2_old);
543 TEST(res2 ? res1 && (font_spec2_new == font_spec2_old) : ETrue);
548 CleanupStack::PopAndDestroy(); // file_list
550 error = file_finder.FindWild(file_list);
555 CDummyRasterizer* CDummyRasterizer::NewL()
557 return new(ELeave) CDummyRasterizer;
560 COpenFontFile* CDummyRasterizer::NewFontFileL(TInt aUid,const TDesC& aFileName,RFs& /*aFileSession*/)
562 // Allow 'dummy', 'dummy_b', etc. Don't actually open a file; just create a dummy font.
563 if (aFileName.CompareF(KFontDummy) == 0 ||
564 aFileName.CompareF(KFontDummy_b) == 0 ||
565 aFileName.CompareF(KFontDummy_i) == 0 ||
566 aFileName.CompareF(KFontDummy_bi) == 0)
567 return CDummyFontFile::NewL(aUid,aFileName);
571 CDummyFontFile::CDummyFontFile(TInt aUid,const TDesC& aFileName):
572 COpenFontFile(aUid,aFileName)
576 CDummyFontFile* CDummyFontFile::NewL(TInt aUid,const TDesC& aFileName)
578 CDummyFontFile* f = new(ELeave)CDummyFontFile(aUid,aFileName);
579 CleanupStack::PushL(f);
585 TBool CDummyFontFile::GetNearestFontHelperOld(const TOpenFontSpec& aDesiredFontSpec,TInt aPixelWidth,TInt aPixelHeight,
586 TInt& aFaceIndex,TOpenFontSpec& aActualFontSpec) const
588 return COpenFontFile::GetNearestFontHelperOld(aDesiredFontSpec,aPixelWidth,aPixelHeight,aFaceIndex,aActualFontSpec);
591 void CDummyFontFile::ConstructL()
593 const TDesC& filename = FileName();
594 TOpenFontFaceAttrib attrib;
596 if (filename.CompareF(KFontDummy) == 0)
597 attrib.SetFullName(_L("Dummy"));
598 else if (filename.CompareF(KFontDummy_b) == 0)
600 attrib.SetFullName(_L("Dummy Bold"));
601 attrib.SetBold(TRUE);
603 else if (filename.CompareF(KFontDummy_i) == 0)
605 attrib.SetFullName(_L("Dummy Italic"));
606 attrib.SetItalic(TRUE);
608 else if (filename.CompareF(KFontDummy_bi) == 0)
610 attrib.SetFullName(_L("Dummy Bold Italic"));
611 attrib.SetBold(TRUE);
612 attrib.SetItalic(TRUE);
614 attrib.SetFamilyName(_L("Dummy"));
615 attrib.SetLocalFullName(attrib.FullName());
616 attrib.SetCoverage(TOpenFontFaceAttrib::ELatinSet);
617 attrib.SetMinSizeInPixels(8);
621 void CDummyFontFile::GetNearestFontInPixelsL(RHeap* aHeap,COpenFontSessionCacheList* aSessionCacheList,
622 const TOpenFontSpec& aDesiredFontSpec,TInt aPixelWidth,TInt aPixelHeight,
623 COpenFont*& aFont,TOpenFontSpec& aActualFontSpec)
628 if (GetNearestFontHelper(aDesiredFontSpec,aPixelWidth,aPixelHeight,face_index,aActualFontSpec))
629 aFont = CDummyFont::NewL(aHeap,aSessionCacheList,this,aActualFontSpec.Height());
632 void CDummyFontFile::GetNearestFontToDesignHeightInPixelsL(RHeap* aHeap,COpenFontSessionCacheList* aSessionCacheList,
633 const TOpenFontSpec& aDesiredFontSpec,TInt aPixelWidth,TInt aPixelHeight,
634 COpenFont*& aFont,TOpenFontSpec& aActualFontSpec)
639 if (GetNearestFontHelper(aDesiredFontSpec,aPixelWidth,aPixelHeight,face_index,aActualFontSpec))
640 aFont = CDummyFont::NewL(aHeap,aSessionCacheList,this,aActualFontSpec.Height());
643 void CDummyFontFile::GetNearestFontToMaxHeightInPixelsL(RHeap* aHeap,COpenFontSessionCacheList* aSessionCacheList,
644 const TOpenFontSpec& aDesiredFontSpec,TInt aPixelWidth,TInt aPixelHeight,
645 COpenFont*& aFont,TOpenFontSpec& aActualFontSpec,TInt /*aMaxHeight*/)
650 if (GetNearestFontHelper(aDesiredFontSpec,aPixelWidth,aPixelHeight,face_index,aActualFontSpec))
651 aFont = CDummyFont::NewL(aHeap,aSessionCacheList,this,aActualFontSpec.Height());
654 TBool CDummyFontFile::HasUnicodeCharacterL(TInt /*aFaceIndex*/,TInt /*aCode*/) const
656 return EFalse; // this dummy font has no characters
659 CDummyFont* CDummyFont::NewL(RHeap* aHeap,COpenFontSessionCacheList* aSessionCacheList,
660 CDummyFontFile* aFontFile,TInt aSizeInPixels)
662 CDummyFont* f = (CDummyFont*)aHeap->AllocL(sizeof(CDummyFont));
663 new(f) CDummyFont(aHeap,aSessionCacheList,aFontFile,aSizeInPixels);
667 CDummyFont::CDummyFont(RHeap* aHeap,COpenFontSessionCacheList* aSessionCacheList,CDummyFontFile* aFontFile,
669 COpenFont(aHeap,aSessionCacheList,aFontFile)
671 iMetrics.SetSize(aSizeInPixels);
672 iMetrics.SetAscent(aSizeInPixels * 3 / 4);
673 iMetrics.SetDescent(aSizeInPixels - iMetrics.Ascent());
674 iMetrics.SetMaxHeight(iMetrics.Ascent());
675 iMetrics.SetMaxDepth(iMetrics.Descent());
676 iMetrics.SetMaxWidth(aSizeInPixels * 2);
679 void CDummyFont::RasterizeL(TInt /*aCode*/,TOpenFontGlyphData* /*aGlyphData*/)
681 User::Leave(KErrNotSupported); // this dummy font has no glyphs
684 static void ExpandCleanupStackL()
687 for (; count < 10; count++)
688 CleanupStack::PushL((TUint32*)0x1);
689 CleanupStack::Pop(count);
693 __CONSTRUCT_STEP__(FsOpen)
696 void CTFsOpenStep::TestSetupL()
698 ExpandCleanupStackL();