Update contrib.
2 * Copyright (c) 2008-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.
25 #include "T_LinkedFonts2.h"
26 #include "linkedfontsprivate.h"
27 #include <graphics/openfontlinkedtypefacespecification.h>
28 #include <openfontlinkedtypefaceelementspec.h>
30 CTLinkedFonts2::CTLinkedFonts2(CTestStep* aStep)
31 : CTGraphicsBase(aStep)
36 CTLinkedFonts2::~CTLinkedFonts2()
44 void CTLinkedFonts2::TestPanic(TInt aPanic)
46 _LIT(KFntTestStorePanicCategory,"TestFntStore");
47 User::Panic(KFntTestStorePanicCategory,aPanic);
50 void CTLinkedFonts2::RunTestCaseL(TInt aCurTestCase)
52 ((CTLinkedFonts2Step*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
56 ((CTLinkedFonts2Step*)iStep)->SetTestStepID(_L("GRAPHICS-FNTSTORE-LINKEDFONTS-0046"));
57 InitializeTestHarnessL();
60 ((CTLinkedFonts2Step*)iStep)->SetTestStepID(_L("GRAPHICS-FNTSTORE-LINKEDFONTS-0001"));
61 TestLinkedClientGettersAndSettersL();
64 ((CTLinkedFonts2Step*)iStep)->SetTestStepID(_L("GRAPHICS-FNTSTORE-LINKEDFONTS-0002"));
65 TestLinkedClientAddAndRemoveL();
68 ((CTLinkedFonts2Step*)iStep)->SetTestStepID(_L("GRAPHICS-FNTSTORE-LINKEDFONTS-0003"));
69 TestOpenClientAddAndRemoveL();
73 @SYMTestCaseID GRAPHICS-FNTSTORE-LINKEDFONTS-0004
75 ((CTLinkedFonts2Step*)iStep)->SetTestStepID(_L("GRAPHICS-FNTSTORE-LINKEDFONTS-0004"));
76 TestLinkedRegistrationAndFetchL();
79 ((CTLinkedFonts2Step*)iStep)->SetTestStepID(_L("GRAPHICS-FNTSTORE-LINKEDFONTS-0100"));
80 TestComplexLinkedFontsBasicL();
83 ((CTLinkedFonts2Step*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
84 //((CTLinkedFonts2Step*)iStep)->SetTestStepID(_L("GRAPHICS-FNTSTORE-LINKEDFONTS-0101"));
90 ((CTLinkedFonts2Step*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
91 ((CTLinkedFonts2Step*)iStep)->CloseTMSGraphicsStep();
94 ((CTLinkedFonts2Step*)iStep)->RecordTestResultL();
99 GRAPHICS-FNTSTORE-LINKEDFONTS-0046
102 Starts a server session with the font and bitmap server.
105 1. Creates a session with the Font and Bitmap server.
106 2. Gets the current Font and Bitmap server session.
107 3. Creates a CFbsScreenDevice object.
108 4. Sets screen device to null.
109 5. Sets auto update to true.
110 6. Creates a font and bitmap server graphics context for the
111 device and activates it.
113 @SYMTestExpectedResults
114 All steps 1-6 above succeed.
116 void CTLinkedFonts2::StartServer()
118 TInt ret = RFbsSession::Connect();
119 TEST2(ret, KErrNone);
120 iFbs = RFbsSession::GetSession();
131 TDisplayMode mode[4] = {EColor16MA,EColor16MU,EColor64K,EColor16MAP};
134 for (count=0; count < (sizeof(mode)/sizeof(mode[0])) ;count++)
136 TRAP(err, iDev = CFbsScreenDevice::NewL(KNullDesC, mode[count]));
137 if (err!=KErrNotSupported)
145 INFO_PRINTF2(_L("%d screen mode created"),mode[count]);
146 iDev->ChangeScreenDevice(NULL);
147 iDev->SetAutoUpdate(ETrue);
148 iDev->CreateContext(iGc);
150 //use and create a font
151 //otherwise for memory tests there is a leak reported since the first AllocL
152 //creates the space for the array (e.g. CTypefaceStore::AddFontL()) and
153 //although the array is emptied the array element storage is not deleted
154 //until everything is closed
155 _LIT(KSansSerif, "DejaVu Sans Condensed");
157 typeface.iName = KSansSerif;
159 fs.iTypeface = typeface;
161 CFbsFont* font = NULL;
162 TInt err1 = iDev->GetNearestFontToDesignHeightInPixels(font, fs);
163 TEST(err1==KErrNone);
164 if (err1 == KErrNone)
166 TSize scrSize = iDev->SizeInPixels();
168 _LIT(KTestText,"TEST");
169 iGc->DrawText(KTestText, TPoint((scrSize.iWidth / 2) + 50, 50));
171 iDev->ReleaseFont(font);
176 INFO_PRINTF2(_L("Could not create screen mode error %d"),err);
181 void CTLinkedFonts2::InitializeTestHarnessL()
183 INFO_PRINTF1(_L("Initialising the test harness T_LinkedFonts2 (PREQ2146)"));
187 void CTLinkedFonts2::CloseTestHarnessL()
192 GRAPHICS-FNTSTORE-LINKEDFONTS-0001
201 Create a linked typeface element & group. Set the parameters they provide.
210 Tests that the values set are stored correctly by the linked typeface element & group.
212 @SYMTestExpectedResults
213 Values are set correctly
215 void CTLinkedFonts2::TestLinkedClientGettersAndSettersL()
217 INFO_PRINTF1(_L("CTLinkedFonts2::TestLinkedClientGettersAndSettersL"));
218 CLinkedTypefaceElementSpec *elementSpec;
219 _LIT(KLinkedTypefaceName, "TypefaceNumberOne");
220 elementSpec = CLinkedTypefaceElementSpec::NewLC(KLinkedTypefaceName, 10);
222 elementSpec->SetCanonical(ETrue);
223 TEST(elementSpec->Canonical());
225 //Test Remaining Getters & Setters
226 elementSpec->SetCanonical(EFalse);
228 CleanupStack::PopAndDestroy(elementSpec);
230 CLinkedTypefaceGroup* grp = CLinkedTypefaceGroup::NewLC(10);
231 const TInt KPercentageValue = 50;
234 grp->SetBoldnessPercentage(KPercentageValue);
235 ret = grp->BoldnessPercentage();
236 TEST2(ret, KPercentageValue);
238 grp->SetItalicAngle(KPercentageValue);
239 ret = grp->ItalicAngle();
240 TEST2(ret, KPercentageValue);
242 grp->SetBaselineShift(CLinkedTypefaceGroup::ENoBaselineShift);
243 CLinkedTypefaceGroup::TBaselineShift ret2 = grp->BaselineShift();
244 TEST2(ret2, CLinkedTypefaceGroup::ENoBaselineShift);
246 CleanupStack::PopAndDestroy(grp);
251 GRAPHICS-FNTSTORE-LINKEDFONTS-0002
260 Tests construction of a Linked Typeface specification with both valid & invalid data.
269 Tests a number of different combinations (listed) of adding, removing and updating groups and
270 elements from a linked typeface specification.
272 Tests applicable to CLinkedTypefaceGroup / CLinkedTypefaceSpecification
274 1. Adding a valid group
275 2. Adding a duplicate group
276 3. Adding a group with the same Id as an existing one
278 12. Remove invalid GroupId
279 13. Adding more than KMaxLinkedTypefaceGroups groups
280 14. Retrieve Group with index out of bounds
283 Tests applicable to CLinkedTypefaceElementSpec / CLinkedTypefaceSpecification
285 5. Adding a valid element
286 6. Adding a duplicate element
287 7. Ensuring ordering of elements is as specified
288 8. Ensure canonical index is correct when element moved/removed
289 9. Ensuring correct error if extra canonical added
290 10. Ensuring correct error if canonical activated "in-place"
291 11. Removal of element
292 15. Create Specification & Element with too short (0)/long (KMaxTypefaceNameLength) names.
293 16. Adding more than KMaxLinkedTypefaces Elements
294 17. Retrieve Typeface with index out of bounds
296 @SYMTestExpectedResults
297 The canonical index is expected to be set to the values provided through the test after the
298 various operations performed. Addition & removal should provide success or fail error codes
299 as indicated throughout the test. Actions are referenced within the code with expected results.
301 void CTLinkedFonts2::TestLinkedClientAddAndRemoveL()
303 INFO_PRINTF1(_L("TestLinkedClientAddAndRemoveL"));
305 CFbsTypefaceStore* store = CFbsTypefaceStore::NewL(NULL);
306 CleanupStack::PushL(store);
308 _LIT(KTestLinkedFont, "TestLinkedFont");
309 CLinkedTypefaceSpecification* typefaceSpec =
310 CLinkedTypefaceSpecification::NewLC(KTestLinkedFont);
312 TInt canIndex = typefaceSpec->CanonicalIndex();
313 TEST(canIndex == KErrNotFound);
314 TRAPD(ret, typefaceSpec->RegisterLinkedTypefaceL(*store));
315 TEST(ret == KErrNotFound);
318 const TInt KGroup1Id = 1;
319 CLinkedTypefaceGroup* group1 = CLinkedTypefaceGroup::NewLC(KGroup1Id);
320 //Action 1 : Valid group
321 TRAP(ret, typefaceSpec->AddLinkedTypefaceGroupL(*group1));
322 TEST(ret == KErrNone);
323 CleanupStack::Pop(group1);
325 //Action 2 : Same group again
326 TRAP(ret, typefaceSpec->AddLinkedTypefaceGroupL(*group1));
327 TEST(ret == KErrAlreadyExists);
329 //Action 3 : Group with existing Id
330 CLinkedTypefaceGroup* duplicateGroup = CLinkedTypefaceGroup::NewLC(KGroup1Id);
331 TRAP(ret, typefaceSpec->AddLinkedTypefaceGroupL(*duplicateGroup));
332 TEST(ret == KErrAlreadyExists);
333 CleanupStack::PopAndDestroy(duplicateGroup);
335 //Action 1 : Valid group
336 const TInt KGroup2Id = 2;
337 CLinkedTypefaceGroup* group2 = CLinkedTypefaceGroup::NewLC(KGroup2Id);
338 group2->SetBaselineShift(CLinkedTypefaceGroup::EBaselineShift);
339 group2->SetScalingOption(CLinkedTypefaceGroup::EScalingUpOrDown);
340 TRAP(ret, typefaceSpec->AddLinkedTypefaceGroupL(*group2));
341 TEST(ret == KErrNone);
342 CleanupStack::Pop(group2);
344 const TInt KGroup3Id = 4;
345 CLinkedTypefaceGroup* group3 = CLinkedTypefaceGroup::NewLC(KGroup3Id);
346 TRAP(ret, typefaceSpec->AddLinkedTypefaceGroupL(*group3));
347 TEST(ret == KErrNone);
348 CleanupStack::Pop(group3);
350 //Action 5 : Japanese typefaces
351 _LIT(KJapaneseElement, "Japanese");
352 CLinkedTypefaceElementSpec* element1 = CLinkedTypefaceElementSpec::NewLC(KJapaneseElement, KGroup2Id);
353 TRAP(ret, typefaceSpec->AddTypefaceAtBackL(*element1));
354 CleanupStack::Pop(element1);
356 //Action 5: Add the canonical element (Latin)
357 _LIT(KLatinElement, "DejaVu Sans Mono Bold");
358 CLinkedTypefaceElementSpec* element2 = CLinkedTypefaceElementSpec::NewLC(KLatinElement, KGroup1Id);
359 element2->SetCanonical(ETrue);
361 TRAP(ret, typefaceSpec->AddTypefaceAtIndexL(*element2,0));
362 TEST(ret == KErrNone);
363 CleanupStack::Pop(element2);
365 //Action 8 : Check Canonical Index is correct
366 canIndex = typefaceSpec->CanonicalIndex();
369 //Action 5 : Hindi typefaces
370 _LIT(KHindiElement, "Chandas");
371 CLinkedTypefaceElementSpec* element3 = CLinkedTypefaceElementSpec::NewLC(KHindiElement, KGroup3Id);
372 TRAP(ret, typefaceSpec->AddTypefaceAtBackL(*element3));
373 TEST(ret == KErrNone);
374 CleanupStack::Pop(element3);
376 //Action 6 : Same element again
377 TRAP(ret, typefaceSpec->AddTypefaceAtBackL(*element3));
378 TEST(ret == KErrAlreadyExists);
380 //Action 7 : Check ordering is correct
381 TEST2(element1, typefaceSpec->Typeface(1));
382 TEST2(element2, typefaceSpec->Typeface(0));
383 TEST2(element3, typefaceSpec->Typeface(2));
385 _LIT(KDummyTypeface, "DummyTypeface");
386 CLinkedTypefaceElementSpec* dummyElement1 = CLinkedTypefaceElementSpec::NewLC(KDummyTypeface, KGroup2Id);
388 //Action 9 : Add second canonical
389 dummyElement1->SetCanonical(ETrue);
390 TRAP(ret, typefaceSpec->AddTypefaceAtBackL(*dummyElement1));
391 TEST(ret == KErrArgument);
393 //Add at front of typeface to check canonical index is updated.
394 dummyElement1->SetCanonical(EFalse);
395 TRAP(ret, typefaceSpec->AddTypefaceAtIndexL(*dummyElement1, 0));
396 TEST(ret == KErrNone);
397 CleanupStack::Pop(dummyElement1);
399 canIndex = typefaceSpec->CanonicalIndex();
402 dummyElement1 = CLinkedTypefaceElementSpec::NewLC(KDummyTypeface, 180);
403 TRAP(ret, typefaceSpec->AddTypefaceAtIndexL(*dummyElement1, 0));
404 TEST(ret == KErrArgument);
405 CleanupStack::PopAndDestroy(dummyElement1);
407 //Action 11 : Remove Element
408 typefaceSpec->RemoveTypeface(0);
409 TEST2(element2, typefaceSpec->Typeface(0));
411 //Action 8 : Check canonical index is correct
412 canIndex = typefaceSpec->CanonicalIndex();
415 //Action 10 : Check error if extra canonical activated "in place"
416 typefaceSpec->Typeface(1)->SetCanonical(ETrue);
417 canIndex = typefaceSpec->CanonicalIndex();
418 TEST(canIndex == KErrOverflow);
419 TRAP(ret, typefaceSpec->RegisterLinkedTypefaceL(*store));
420 TEST(ret == KErrOverflow);
421 //Reset back to be non-canonical
422 typefaceSpec->Typeface(1)->SetCanonical(EFalse);
424 //Action 8 : Check canonical index is correct
425 typefaceSpec->RemoveTypeface(0);
426 TEST2(element1, typefaceSpec->Typeface(0));
428 //Action 8 : Check canonical index is correct
429 canIndex = typefaceSpec->CanonicalIndex();
430 TEST(canIndex == -1);
432 //Action 4 : Remove the group
433 TRAP(ret, typefaceSpec->RemoveLinkedTypefaceGroup(KGroup3Id));
434 TEST(ret == KErrNone);
435 CLinkedTypefaceGroup* groupRet = typefaceSpec->GroupById(KGroup3Id);
436 TEST(groupRet == NULL);
438 TEST2(element1, typefaceSpec->Typeface(0));
440 //Action 12 : Remove invalid group
441 ret = typefaceSpec->RemoveLinkedTypefaceGroup(180);
442 TEST(ret == KErrNotFound);
443 //Action 4 : Remove group
444 ret = typefaceSpec->RemoveLinkedTypefaceGroup(KGroup1Id);
445 TEST(ret == KErrNone);
446 groupRet = typefaceSpec->GroupById(KGroup1Id);
447 TEST(groupRet == NULL);
449 CleanupStack::PopAndDestroy(typefaceSpec);
451 //Negative Name length tests
452 _LIT(KEmptyTypefaceName, "");
453 //Action 15 : Create Specification & Element with 0 length names
454 TRAP(ret, typefaceSpec = CLinkedTypefaceSpecification::NewLC(KEmptyTypefaceName));
455 TEST(ret == KErrArgument);
456 TRAP(ret, dummyElement1 = CLinkedTypefaceElementSpec::NewLC(KEmptyTypefaceName,1));
457 TEST(ret < KErrNone);
458 //Action 15: Create Specification & Element with name longer than KMaxTypefaceNameLength
459 _LIT(KLongTypefaceName, "KErrArgumentKErrArgumentKErrArgument");
460 TRAP(ret, typefaceSpec = CLinkedTypefaceSpecification::NewLC(KLongTypefaceName));
461 TEST(ret == KErrArgument);
462 TRAP(ret, dummyElement1 = CLinkedTypefaceElementSpec::NewLC(KLongTypefaceName,1));
463 TEST(ret < KErrNone);
465 typefaceSpec = CLinkedTypefaceSpecification::NewLC(KTestLinkedFont);
467 for (i = 0 ; i <= KMaxLinkedTypefaceGroups+1 ; i++)
469 CLinkedTypefaceGroup* group = CLinkedTypefaceGroup::NewLC(i);
471 if (i < KMaxLinkedTypefaceGroups)
473 //Add Groups 1-KMaxLinkedTypefaceGroups
474 TRAP(ret, typefaceSpec->AddLinkedTypefaceGroupL(*group));
475 CleanupStack::Pop(group);
479 //Action 13 : Add group at KMaxLinkedTypefaceGroups+1
480 TRAP(ret, typefaceSpec->AddLinkedTypefaceGroupL(*group));
481 TEST(ret == KErrOverflow);
482 CleanupStack::PopAndDestroy(group);
486 _LIT(KFormatElementName, "Element%d");
487 for (i = 0 ; i <= KMaxLinkedTypefaces ; i++)
489 TBuf<18> elementName;
490 elementName.Format(KFormatElementName,i);
491 CLinkedTypefaceElementSpec* element = CLinkedTypefaceElementSpec::NewLC(elementName,i);
492 if (i < KMaxLinkedTypefaces)
494 //Add Elements 1-KMaxLinkedTypefaces
495 TRAP(ret,typefaceSpec->AddTypefaceAtBackL(*element));
496 CleanupStack::Pop(element);
500 //Action 16 : Add element KMaxLinkedTypefaces+1
501 TRAP(ret,typefaceSpec->AddTypefaceAtBackL(*element));
502 TEST(ret == KErrOverflow);
503 CleanupStack::PopAndDestroy(element);
507 //Action 14 : Retrieve out of bounds groups
508 TEST2(typefaceSpec->Group(-1), NULL);
509 TEST2(typefaceSpec->Group(typefaceSpec->GroupCount()+1), NULL);
510 //Action 17 : Retrieve typeface with index out of bounds
511 TEST2(typefaceSpec->Typeface(-1), NULL);
512 TEST2(typefaceSpec->Typeface(typefaceSpec->TypefaceCount()+1), NULL);
513 //Action 11 : Remove typeface with index out of bounds
514 TEST2(typefaceSpec->RemoveTypeface(-1), KErrNotFound);
515 TEST2(typefaceSpec->RemoveTypeface(typefaceSpec->TypefaceCount()+1), KErrNotFound);
517 CleanupStack::PopAndDestroy(2, store);
522 GRAPHICS-FNTSTORE-LINKEDFONTS-0003
531 Tests the Add & RemoveTypeface functions provided by COpenFontLinkedTypefaceSpecification
540 Tests applicable to CLinkedTypefaceGroup / COpenFontLinkedTypefaceSpecification
542 1. Adding a valid group
543 2. Adding a duplicate group (same object)
544 3. Adding a group with the same Id as an existing one
546 12. Remove invalid GroupId
547 13. Adding more than KMaxLinkedTypefaceGroups groups
548 14. Retrieve Group with index out of bounds
550 Tests applicable to COpenFontLinkedTypefaceElementSpec / COpenFontLinkedTypefaceSpecification
552 5. Adding a valid element
553 6. Adding a duplicate element (same object)
554 7. Ensuring ordering of elements is as specified
555 8. Ensure canonical index is correct when element moved/removed
556 9. Ensuring correct error if extra canonical added
557 10. Ensuring correct error if canonical activated "in-place"
558 11. Removal of element
559 15. Create Specification & Element with too short (0)/long (KMaxTypefaceNameLength) names.
560 16. Adding more than KMaxLinkedTypefaces Elements
561 17. Retrieve Typeface with index out of bounds
563 @SYMTestExpectedResults
564 The canonical index is expected to be set to the values provided through the test after the
565 various operations performed. Addition & removal should provide success or fail error codes
566 as indicated throughout the test. Actions are referenced within the code with expected results.
568 void CTLinkedFonts2::TestOpenClientAddAndRemoveL()
570 INFO_PRINTF1(_L("TestOpenClientAddAndRemoveL"));
572 _LIT(KTestLinkedFont, "TestLinkedFont");
573 COpenFontLinkedTypefaceSpecification* typefaceSpec =
574 COpenFontLinkedTypefaceSpecification::NewLC(KTestLinkedFont);
576 TInt canIndex = typefaceSpec->CanonicalIndex();
577 TEST(canIndex == -1);
581 //Action 1 : Add a valid group
582 const TInt KGroup1Id = 1;
583 CLinkedTypefaceGroup* group1 = CLinkedTypefaceGroup::NewLC(KGroup1Id);
584 TRAP(ret, typefaceSpec->AddLinkedTypefaceGroupL(*group1));
585 TEST(ret == KErrNone);
586 CleanupStack::Pop(group1);
588 //Action 2 : Add a duplicate group
589 TRAP(ret, typefaceSpec->AddLinkedTypefaceGroupL(*group1));
590 TEST(ret == KErrAlreadyExists);
592 //Action 3 : Add a group with the same id
593 CLinkedTypefaceGroup* duplicateGroup = CLinkedTypefaceGroup::NewLC(KGroup1Id);
594 TRAP(ret, typefaceSpec->AddLinkedTypefaceGroupL(*duplicateGroup));
595 TEST(ret == KErrAlreadyExists);
596 CleanupStack::PopAndDestroy(duplicateGroup);
598 //Action 5 : Add a valid element
599 const TInt KGroup2Id = 2;
600 CLinkedTypefaceGroup* group2 = CLinkedTypefaceGroup::NewLC(KGroup2Id);
601 group2->SetBaselineShift(CLinkedTypefaceGroup::EBaselineShift);
602 group2->SetScalingOption(CLinkedTypefaceGroup::EScalingUpOrDown);
603 TRAP(ret, typefaceSpec->AddLinkedTypefaceGroupL(*group2));
604 TEST(ret == KErrNone);
605 CleanupStack::Pop(group2);
607 const TInt KGroup3Id = 4;
608 CLinkedTypefaceGroup* group3 = CLinkedTypefaceGroup::NewLC(KGroup3Id);
609 TRAP(ret, typefaceSpec->AddLinkedTypefaceGroupL(*group3));
610 TEST(ret == KErrNone);
611 CleanupStack::Pop(group3);
613 //Action 5 : Add a valid element
614 _LIT(KJapaneseElement, "Japanese");
615 COpenFontLinkedTypefaceElementSpec* element1 = COpenFontLinkedTypefaceElementSpec::NewLC(KJapaneseElement, KGroup2Id);
616 TRAP(ret, typefaceSpec->AddTypefaceAtBackL(*element1));
617 CleanupStack::Pop(element1);
619 //Action 5 : Add a valid element
620 _LIT(KLatinElement, "DejaVu Sans Mono Bold");
621 COpenFontLinkedTypefaceElementSpec* element2 = COpenFontLinkedTypefaceElementSpec::NewLC(KLatinElement, KGroup1Id);
622 element2->SetCanonical(ETrue);
624 TRAP(ret, typefaceSpec->AddTypefaceAtIndexL(*element2,0));
625 TEST(ret == KErrNone);
626 CleanupStack::Pop(element2);
628 //Action 8 : Ensure canonical index correct
629 canIndex = typefaceSpec->CanonicalIndex();
632 _LIT(KHindiElement, "Chandas");
633 COpenFontLinkedTypefaceElementSpec* element3 = COpenFontLinkedTypefaceElementSpec::NewLC(KHindiElement, KGroup3Id);
634 TRAP(ret, typefaceSpec->AddTypefaceAtBackL(*element3));
635 TEST(ret == KErrNone);
636 CleanupStack::Pop(element3);
638 //Action 6 : Duplicate element
639 TRAP(ret, typefaceSpec->AddTypefaceAtBackL(*element3));
640 TEST(ret == KErrAlreadyExists);
642 //Action 7 : Ensure ordering correct
643 TEST2(element1, typefaceSpec->Typeface(1));
644 TEST2(element2, typefaceSpec->Typeface(0));
645 TEST2(element3, typefaceSpec->Typeface(2));
647 _LIT(KDummyTypeface, "DummyTypeface");
648 COpenFontLinkedTypefaceElementSpec* dummyElement1 = COpenFontLinkedTypefaceElementSpec::NewLC(KDummyTypeface, KGroup2Id);
650 //Action 9 : Add 2nd canonical
651 dummyElement1->SetCanonical(ETrue);
652 TRAP(ret, typefaceSpec->AddTypefaceAtBackL(*dummyElement1));
653 TEST(ret == KErrArgument);
655 //Add at front of typeface to check canonical index is updated.
656 dummyElement1->SetCanonical(EFalse);
657 TRAP(ret, typefaceSpec->AddTypefaceAtIndexL(*dummyElement1, 0));
658 TEST(ret == KErrNone);
659 CleanupStack::Pop(dummyElement1);
661 //Action 8 : Check canonical updated
662 canIndex = typefaceSpec->CanonicalIndex();
665 //Action 11 : Remove element
666 typefaceSpec->RemoveTypeface(0);
667 TEST2(element2, typefaceSpec->Typeface(0));
669 //Action 8 : Check canonical updated
670 canIndex = typefaceSpec->CanonicalIndex();
673 //Action 10 : Additional canonical set in-place
674 typefaceSpec->Typeface(1)->SetCanonical(ETrue);
675 canIndex = typefaceSpec->CanonicalIndex();
676 TEST(canIndex == KErrOverflow);
677 typefaceSpec->Typeface(1)->SetCanonical(EFalse);
679 //Action 11 : Remove element
680 typefaceSpec->RemoveTypeface(0);
681 TEST2(element1, typefaceSpec->Typeface(0));
683 //Action 8 : Canonical updated
684 canIndex = typefaceSpec->CanonicalIndex();
685 TEST(canIndex == -1);
687 //Action 4 : Remove group
688 TRAP(ret, typefaceSpec->RemoveLinkedTypefaceGroup(KGroup3Id));
689 TEST(ret == KErrNone);
690 CLinkedTypefaceGroup* groupRet = typefaceSpec->GroupById(KGroup3Id);
691 TEST(groupRet == NULL);
693 TEST2(element1, typefaceSpec->Typeface(0));
695 //Action 12 : Remove invalid group Id
696 ret = typefaceSpec->RemoveLinkedTypefaceGroup(180);
697 TEST(ret == KErrNotFound);
698 ret = typefaceSpec->RemoveLinkedTypefaceGroup(KGroup1Id);
699 TEST(ret == KErrNone);
701 CleanupStack::PopAndDestroy(typefaceSpec);
703 //Negative Name length tests
704 _LIT(KEmptyTypefaceName, "");
705 //Action 15 : Create Specifications
706 TRAP(ret, typefaceSpec = COpenFontLinkedTypefaceSpecification::NewLC(KEmptyTypefaceName));
707 TEST(ret == KErrArgument);
708 TRAP(ret, dummyElement1 = COpenFontLinkedTypefaceElementSpec::NewLC(KEmptyTypefaceName,1));
709 TEST(ret < KErrNone);
710 _LIT(KLongTypefaceName, "KErrArgumentKErrArgumentKErrArgument");
711 TRAP(ret, typefaceSpec = COpenFontLinkedTypefaceSpecification::NewLC(KLongTypefaceName));
712 TEST(ret == KErrArgument);
713 TRAP(ret, dummyElement1 = COpenFontLinkedTypefaceElementSpec::NewLC(KLongTypefaceName,1));
714 TEST(ret < KErrNone);
716 typefaceSpec = COpenFontLinkedTypefaceSpecification::NewLC(KTestLinkedFont);
718 for (i = 0 ; i <= KMaxLinkedTypefaceGroups+1 ; i++)
720 CLinkedTypefaceGroup* group = CLinkedTypefaceGroup::NewLC(i);
722 if (i < KMaxLinkedTypefaceGroups)
724 TRAP(ret, typefaceSpec->AddLinkedTypefaceGroupL(*group));
725 CleanupStack::Pop(group);
729 TRAP(ret, typefaceSpec->AddLinkedTypefaceGroupL(*group));
730 TEST(ret == KErrOverflow);
731 CleanupStack::PopAndDestroy(group);
735 _LIT(KFormatElementName, "Element%d");
736 for (i = 0 ; i <= KMaxLinkedTypefaces ; i++)
738 TBuf<18> elementName;
739 elementName.Format(KFormatElementName,i);
740 COpenFontLinkedTypefaceElementSpec* element = COpenFontLinkedTypefaceElementSpec::NewLC(elementName,i);
741 if (i < KMaxLinkedTypefaces)
743 TRAP(ret,typefaceSpec->AddTypefaceAtBackL(*element));
744 CleanupStack::Pop(element);
748 TRAP(ret,typefaceSpec->AddTypefaceAtBackL(*element));
749 TEST(ret == KErrOverflow);
750 CleanupStack::PopAndDestroy(element);
754 TEST2(typefaceSpec->Group(-1), NULL);
755 TEST2(typefaceSpec->Group(typefaceSpec->GroupCount()+1), NULL);
756 TEST2(typefaceSpec->Typeface(-1), NULL);
757 TEST2(typefaceSpec->Typeface(typefaceSpec->TypefaceCount()+1), NULL);
758 TEST2(typefaceSpec->RemoveTypeface(-1), KErrNotFound);
759 TEST2(typefaceSpec->RemoveTypeface(typefaceSpec->TypefaceCount()+1), KErrNotFound);
760 CleanupStack::PopAndDestroy(typefaceSpec);
763 /* Function is used to determine if complex fonts are available. It looks for a
766 TBool CTLinkedFonts2::ComplexFontAvailable()
768 _LIT(KTypefaceOT, "Chandas");
770 // Create the linked font
772 typeface.iName = KTypefaceOT;
774 fs1.iTypeface = typeface;
776 CFbsFont* font = NULL;
777 TInt err = iDev->GetNearestFontToDesignHeightInPixels(font, fs1);
780 TFontSpec fs2 = font->FontSpecInTwips();
781 iDev->ReleaseFont(font);
782 if (fs2.iTypeface.iName.Compare(KTypefaceOT) == 0)
787 INFO_PRINTF1(_L("(N.B. Complex font not available so complex parts of test skipped)"));
792 @SYMTestCaseID GRAPHICS-FNTSTORE-LINKEDFONTS-0100
796 @SYMREQ REQ10924, REQ10925, REQ10926
798 @SYMTestCaseDesc To ensure that a linked typeface including a complex font can be created
799 and used. Test access to characters in a complex linked font.
801 @SYMTestPriority Critical
803 @SYMTestStatus Implemented
805 @SYMTestActions (1) Create a linked font with a complex typeface. Draw text,
806 and compare against text drawn using a non-linked font.
808 @SYMTestExpectedResults (1) - test allows a linked font with a complex typeface to be created
810 void CTLinkedFonts2::TestComplexLinkedFontsBasicL()
812 INFO_PRINTF1(_L("LinkedFonts2::TestComplexLinkedFontsBasicL"));
814 CFbsTypefaceStore* store = CFbsTypefaceStore::NewL(iDev);
815 CleanupStack::PushL(store);
817 TBool testComplex = ComplexFontAvailable();
820 // Create typeface to be linked
821 _LIT(KLinkedTypefaceTT, "DejaVu Sans Condensed");
822 _LIT(KLinkedTypefaceOT, "Chandas");
824 CLinkedTypefaceSpecification *typefaceSpec;
825 _LIT(KLinkedTypefaceTTOT, "LinkedTypefaceComp");
827 typefaceSpec = CLinkedTypefaceSpecification::NewLC(KLinkedTypefaceTTOT);
829 CLinkedTypefaceGroup* group1 = CLinkedTypefaceGroup::NewLC(1);
830 typefaceSpec->AddLinkedTypefaceGroupL(*group1);
833 CLinkedTypefaceGroup* group2 = CLinkedTypefaceGroup::NewLC(2);
834 typefaceSpec->AddLinkedTypefaceGroupL(*group2);
837 // Add first typeface
838 CLinkedTypefaceElementSpec *elementSpec1;
839 elementSpec1 = CLinkedTypefaceElementSpec::NewLC(KLinkedTypefaceTT, 1);
841 CLinkedTypefaceElementSpec *elementSpec2;
842 elementSpec2 = CLinkedTypefaceElementSpec::NewLC(KLinkedTypefaceOT, 2);
843 elementSpec2->SetCanonical(ETrue);
845 typefaceSpec->AddTypefaceAtBackL(*elementSpec1);
846 typefaceSpec->AddTypefaceAtBackL(*elementSpec2);
847 CleanupStack::Pop(2, elementSpec1);
849 TEST(typefaceSpec->TypefaceCount() == 2);
850 TEST(typefaceSpec->Name() == KLinkedTypefaceTTOT);
852 // Now try registering the linked typeface
853 TRAPD(ret, typefaceSpec->RegisterLinkedTypefaceL(*store));
855 if (ret == KErrNotSupported)
857 INFO_PRINTF1(_L("No Rasterizer is present that supports the extended Font Linking interface. This test case has been skipped."));
858 CleanupStack::PopAndDestroy(2,store);
862 TEST(ret == KErrNone);
864 // Create the linked font
866 typeface.iName = KLinkedTypefaceTTOT;
868 fs.iTypeface = typeface;
870 CFbsFont* font = NULL;
871 TInt err = iDev->GetNearestFontToDesignHeightInPixels(font, fs);
873 //check the font is the one requested
874 TFontSpec fontSpec = font->FontSpecInTwips();
875 TEST(fontSpec.iTypeface.iName == KLinkedTypefaceTTOT);
877 _LIT16(KEnglish1,"ABCD12345 ");
878 _LIT16(KHindi1,"\x0915\x094D\x0937\x0924\x094D\x0930\x093F\x092F\x0020");
880 const TPoint englishLinked(10,75);
881 const TPoint hindiLinked(10,150);
887 iGc->DrawText(KEnglish1, englishLinked);
888 iGc->DrawText(KHindi1, hindiLinked);
891 User::After(1000*1000*5);
894 // All the CFont functions can use a linked font and a non-linked
895 // font - with the same base font, results should be the same.
896 // Compare with the test function.
898 //output the Hindi text
900 typeface2.iName = KLinkedTypefaceOT;
902 fs2.iTypeface = typeface2;
904 CFbsFont* font2 = NULL;
905 err = iDev->GetNearestFontToDesignHeightInPixels(font2, fs2);
908 //check the font is the one requested
909 fontSpec = font2->FontSpecInTwips();
910 TEST(fontSpec.iTypeface.iName == KLinkedTypefaceOT);
912 const TPoint englishHindiFont(240, 75);
913 const TPoint hindiHindiFont(240, 150);
918 iGc->DrawText(KEnglish1, englishHindiFont);
919 iGc->DrawText(KHindi1, hindiHindiFont);
922 User::After(1000*1000);
923 iDev->ReleaseFont(font2);
926 //output the English text
928 typeface3.iName = KLinkedTypefaceTT;
930 fs3.iTypeface = typeface3;
932 CFbsFont* font3 = NULL;
933 err = iDev->GetNearestFontToDesignHeightInPixels(font3, fs3);
936 //check the font is the one requested
937 fontSpec = font3->FontSpecInTwips();
938 TEST(fontSpec.iTypeface.iName == KLinkedTypefaceTT);
940 const TPoint englishSansSerifFont(440, 75);
941 const TPoint hindiSansSerifFont(440, 150);
946 iGc->DrawText(KEnglish1, englishSansSerifFont);
947 iGc->DrawText(KHindi1, hindiSansSerifFont);
950 User::After(1000*1000);
951 iDev->ReleaseFont(font3);
957 CFont::TMeasureTextOutput compareEnglish;
958 CFont::TMeasureTextOutput compareHindi;
959 //get the size of a text box to do the comparison
960 font->MeasureText(KEnglish1, NULL, &compareEnglish);
961 font->MeasureText(KHindi1, NULL, &compareHindi);
964 TRect englishLinkedRect (englishLinked.iX,englishLinked.iY,
965 englishLinked.iX+compareEnglish.iBounds.Width(),
966 englishLinked.iY+compareEnglish.iBounds.Height());
967 TRect englishSansSerifRect (englishSansSerifFont.iX,englishSansSerifFont.iY,
968 englishSansSerifFont.iX+compareEnglish.iBounds.Width(),
969 englishSansSerifFont.iY+compareEnglish.iBounds.Height());
971 TBool val = iDev->RectCompare(englishLinkedRect, *iDev,englishSansSerifRect);
972 //this value is not compared since the rasterizer may resize/reposition fonts
975 TRect hindiLinkedRect (hindiLinked.iX,hindiLinked.iY,
976 hindiLinked.iX+compareHindi.iBounds.Width(),
977 hindiLinked.iY+compareHindi.iBounds.Height());
978 TRect hindiHindiRect (hindiHindiFont.iX,hindiHindiFont.iY,
979 hindiHindiFont.iX+compareHindi.iBounds.Width(),
980 hindiHindiFont.iY+compareHindi.iBounds.Height());
981 val=iDev->RectCompare(hindiLinkedRect, *iDev,hindiHindiRect);
982 //do not call TEST(val) since size/position may be slightly different
983 iDev->ReleaseFont(font);
985 CleanupStack::PopAndDestroy(2, store);
991 @SYMTestCaseID GRAPHICS-FNTSTORE-LINKEDFONTS-0101
995 @SYMREQ REQ10924, REQ10925, REQ10926
997 @SYMTestCaseDesc To test PREQ2146 linked fonts with bitmap fonts. Bitmap fonts are not
998 supported so an error needs to be returned on registration.
1000 @SYMTestPriority Critical
1002 @SYMTestStatus Implemented
1004 @SYMTestActions (1) Create a linked typeface elements, with one of them from a bitmap font
1005 try registering, and KErrNotSupported error should be returned
1007 @SYMTestExpectedResults (1) - registering a bitmap font returns KErrNotSupported.
1009 void CTLinkedFonts2::TestBitmapFontsL()
1011 INFO_PRINTF1(_L("LinkedFonts2::TestBitmapFontsL"));
1013 CFbsTypefaceStore* store = CFbsTypefaceStore::NewL(iDev);
1014 CleanupStack::PushL(store);
1016 // Create typeface to be linked
1017 _LIT(KLinkedTypefaceTT, "DejaVu Sans Condensed");
1018 _LIT(KLinkedTypeFace1, "LinkedFont1"); //this is a bitmap font
1020 CLinkedTypefaceSpecification *typefaceSpec;
1021 _LIT(KLinkedTypefaceBitmap, "LinkedTypefaceBitmap");
1023 typefaceSpec = CLinkedTypefaceSpecification::NewLC(KLinkedTypefaceBitmap);
1025 CLinkedTypefaceGroup* group1 = CLinkedTypefaceGroup::NewLC(1);
1026 typefaceSpec->AddLinkedTypefaceGroupL(*group1);
1027 CleanupStack::Pop();
1029 CLinkedTypefaceGroup* group2 = CLinkedTypefaceGroup::NewLC(2);
1030 typefaceSpec->AddLinkedTypefaceGroupL(*group2);
1031 CleanupStack::Pop();
1033 // Add first typeface
1034 CLinkedTypefaceElementSpec *elementSpec1;
1035 elementSpec1 = CLinkedTypefaceElementSpec::NewLC(KLinkedTypefaceTT, 2);
1037 CLinkedTypefaceElementSpec *elementSpec2;
1038 elementSpec2 = CLinkedTypefaceElementSpec::NewLC(KLinkedTypeFace1, 1);
1039 elementSpec2->SetCanonical(ETrue);
1041 typefaceSpec->AddTypefaceAtBackL(*elementSpec1);
1042 typefaceSpec->AddTypefaceAtBackL(*elementSpec2);
1043 CleanupStack::Pop(2, elementSpec1);
1045 TEST(typefaceSpec->TypefaceCount() == 2);
1046 TEST(typefaceSpec->Name() == KLinkedTypefaceBitmap);
1048 // Now try regstering the linked typeface
1049 TRAPD(ret, typefaceSpec->RegisterLinkedTypefaceL(*store));
1050 TEST(ret == KErrNotSupported);
1051 CleanupStack::PopAndDestroy(2, store);
1055 @SYMTestCaseID GRAPHICS-FNTSTORE-LINKEDFONTS-0109
1059 @SYMREQ REQ10924, REQ10925, REQ10926
1061 @SYMTestCaseDesc To test PREQ2146 linked fonts updates to the TOpenFontCharMetrics class.
1063 @SYMTestPriority Critical
1065 @SYMTestStatus Implemented
1067 @SYMTestActions (1) Create a TOpenFontCharMetrics object.
1068 (2) Check that nothing is set
1069 (3) Set a small positive baseline
1070 (4) Check that the baseline is as set and the glyph type is still not set
1071 (5) Set a large positive baseline
1072 (6) Check that the baseline is as set and the glyph type is still not set
1073 (7) Set a large negative baseline
1074 (8) Check that the baseline is as set and the glyph type is still not set
1075 (9) Set the glyph type.
1076 (10) Check that the baseline is as set and the glyph type is as set
1077 (11) Set the baseline to a again to various values
1078 (12) Check that the baseline is as set and the glyph type has not changed
1080 @SYMTestExpectedResults (2) the default values are 0 for baseline and EGlyphBitmapTypeNotDefined for glyph type
1081 (4)(6)(8)(10)(12) The values are are set, and setting the baseline does
1082 not alter the glyph type and vice-versa.
1084 void CTLinkedFonts2::TestTOpenFontMetrics()
1086 TOpenFontMetrics metrics;
1088 TInt len = metrics.BaselineCorrection();
1091 metrics.SetBaselineCorrection(22);
1092 len = metrics.BaselineCorrection();
1095 metrics.SetBaselineCorrection(444);
1096 len = metrics.BaselineCorrection();
1099 metrics.SetBaselineCorrection(-333);
1100 len = metrics.BaselineCorrection();
1103 metrics.SetBaselineCorrection(444);
1104 len = metrics.BaselineCorrection();
1107 metrics.SetBaselineCorrection(-1);
1108 len = metrics.BaselineCorrection();
1113 void CTLinkedFonts2::TestLinkedRegistrationAndFetchL()
1115 INFO_PRINTF1(_L("CTLinkedFonts2::TestLinkedRegistrationAndFetchL"));
1116 CFbsTypefaceStore* store = CFbsTypefaceStore::NewL(iDev);
1117 CleanupStack::PushL(store);
1119 //Create and register a dummy linked typeface to register.
1120 _LIT(KFetchTypefaceName, "FetchFont");
1121 CLinkedTypefaceSpecification* typefaceSpec = CLinkedTypefaceSpecification::NewLC(KFetchTypefaceName);
1123 CLinkedTypefaceGroup* group1 = CLinkedTypefaceGroup::NewLC(1);
1124 group1->SetBoldnessPercentage(20);
1125 group1->SetItalicAngle(10);
1126 group1->SetBaselineShift(CLinkedTypefaceGroup::EBaselineShift);
1127 group1->SetScalingOption(CLinkedTypefaceGroup::EScalingDown);
1129 typefaceSpec->AddLinkedTypefaceGroupL(*group1);
1130 CleanupStack::Pop(group1);
1132 CLinkedTypefaceGroup* group2 = CLinkedTypefaceGroup::NewLC(2);
1133 group2->SetBoldnessPercentage(21);
1134 group2->SetItalicAngle(11);
1135 group2->SetBaselineShift(CLinkedTypefaceGroup::ENoBaselineShift);
1136 group2->SetScalingOption(CLinkedTypefaceGroup::EScalingUp);
1138 typefaceSpec->AddLinkedTypefaceGroupL(*group2);
1139 CleanupStack::Pop(group2);
1141 _LIT(KElement1Name, "DejaVu Sans Condensed");
1142 CLinkedTypefaceElementSpec* element1 = CLinkedTypefaceElementSpec::NewLC(KElement1Name, 1);
1143 element1->SetCanonical(ETrue);
1144 typefaceSpec->AddTypefaceAtBackL(*element1);
1145 CleanupStack::Pop(element1);
1147 _LIT(KElement2Name, "Chandas");
1148 CLinkedTypefaceElementSpec* element2 = CLinkedTypefaceElementSpec::NewLC(KElement2Name, 2);
1149 typefaceSpec->AddTypefaceAtBackL(*element2);
1150 CleanupStack::Pop(element2);
1152 TRAPD(ret, typefaceSpec->RegisterLinkedTypefaceL(*store));
1153 if (ret == KErrNotSupported)
1155 INFO_PRINTF1(_L("No Rasterizer is present that supports the extended Font Linking interface. This test case has been skipped."));
1156 CleanupStack::PopAndDestroy(2,store);
1160 TEST(ret == KErrNone);
1162 CLinkedTypefaceSpecification* fetchSpec = CLinkedTypefaceSpecification::NewLC(KFetchTypefaceName);
1163 TRAP(ret, fetchSpec->FetchLinkedTypefaceSpecificationL(*store));
1164 TEST(ret == KErrNone);
1166 //Compare Groups. Ordering isn't important so can get group by id rather than index.
1167 TEST(typefaceSpec->GroupCount() == fetchSpec->GroupCount());
1168 CLinkedTypefaceGroup* groupf = fetchSpec->GroupById(1);
1169 TEST(CompareGroups(group1,groupf));
1171 groupf = fetchSpec->GroupById(2);
1172 TEST(CompareGroups(group2,groupf));
1174 //Check elements match
1175 TEST(typefaceSpec->TypefaceCount() == fetchSpec->TypefaceCount());
1177 CLinkedTypefaceElementSpec* elementf = fetchSpec->Typeface(0);
1178 TEST(CompareElementSpecs(elementf, element1));
1179 elementf = fetchSpec->Typeface(1);
1180 TEST(CompareElementSpecs(elementf, element2));
1182 CleanupStack::PopAndDestroy(3,store);
1187 @SYMTestCaseID GRAPHICS-FNTSTORE-LINKEDFONTS-0110
1191 @SYMTestCaseDesc Ensure that font full names are used to build a linked font
1193 @SYMTestPriority Critical
1195 @SYMTestStatus Implemented
1197 @SYMTestActions Attempt to register a linked font using a font full name rather than a family
1198 name. DejaVu Sans Condensed is both a family name and a full name. DejaVu Sans Mono Bold is full name only.
1200 @SYMTestExpectedResults Registration of the linked font will be sucessful.
1201 Failing with KErrNotFound means either the test font is not available or there is a regression.
1203 void CTLinkedFonts2::TestFontNameUsage()
1205 CFbsTypefaceStore* store = CFbsTypefaceStore::NewL(NULL);
1206 CleanupStack::PushL(store);
1208 CLinkedTypefaceSpecification* nameSpec = CLinkedTypefaceSpecification::NewLC(_L("FullNameTest"));
1210 CLinkedTypefaceGroup* group = CLinkedTypefaceGroup::NewLC(1);
1211 nameSpec->AddLinkedTypefaceGroupL(*group);
1212 CleanupStack::Pop(group);
1214 //Use a font whose name doesn't match a family name
1215 CLinkedTypefaceElementSpec* element1 = CLinkedTypefaceElementSpec::NewLC(_L("DejaVu Sans Mono Bold"), 1);
1216 element1->SetCanonical(ETrue);
1217 nameSpec->AddTypefaceAtBackL(*element1);
1218 CleanupStack::Pop(element1);
1220 CLinkedTypefaceElementSpec* element2 = CLinkedTypefaceElementSpec::NewLC(_L("Chandas"), 1);
1221 nameSpec->AddTypefaceAtBackL(*element2);
1222 CleanupStack::Pop(element2);
1224 TRAPD(ret, store->RegisterLinkedTypeface(*nameSpec));
1226 TEST(ret == KErrNone);
1228 CleanupStack::PopAndDestroy(2, store);
1231 TBool CTLinkedFonts2::CompareElementSpecs(CLinkedTypefaceElementSpec* aSpec1, CLinkedTypefaceElementSpec* aSpec2)
1233 if ( (aSpec1 == NULL ) && (aSpec2 == NULL) )
1235 if ( (aSpec1 == NULL) || (aSpec2 == NULL) )
1237 if (aSpec1->ElementName().Compare(aSpec2->ElementName()) != 0)
1239 if (aSpec1->Canonical() != aSpec2->Canonical())
1241 if (aSpec1->GroupId() != aSpec2->GroupId())
1247 TBool CTLinkedFonts2::CompareElementSpecs(COpenFontLinkedTypefaceElementSpec* aSpec1, COpenFontLinkedTypefaceElementSpec* aSpec2)
1249 if ( (aSpec1 == NULL ) && (aSpec2 == NULL) )
1251 if ( (aSpec1 == NULL) || (aSpec2 == NULL) )
1253 if (aSpec1->ElementName().Compare(aSpec2->ElementName()) != 0)
1255 if (aSpec1->Canonical() != aSpec2->Canonical())
1257 if (aSpec1->GroupId() != aSpec2->GroupId())
1263 Compare two linked typeface groups; the first varable should be a locally created group and the second one fetched from the
1264 rasterizer. If the local group has thresholds / metrics set to -1 ("best guess by rasterizer") then the differences between the
1267 TBool CTLinkedFonts2::CompareGroups(CLinkedTypefaceGroup* aLocalGroup, CLinkedTypefaceGroup* aFetchedGroup)
1269 if ( (aLocalGroup == NULL) && (aFetchedGroup == NULL) )
1271 if ( (aLocalGroup == NULL) || (aFetchedGroup == NULL) )
1273 INFO_PRINTF1(_L("One of the specified groups is NULL"));
1277 if (aLocalGroup->BaselineShift() != aFetchedGroup->BaselineShift())
1280 /*if (aLocalGroup->BoldnessPercentage() != -1)
1282 if (aLocalGroup->BoldnessPercentage() != aFetchedGroup->BoldnessPercentage())
1284 INFO_PRINTF1(_L("Fail below caused by non-matching boldness percentages"));
1289 if (aLocalGroup->ItalicAngle() != -1)
1291 if (aLocalGroup->ItalicAngle() != aFetchedGroup->ItalicAngle())
1293 INFO_PRINTF1(_L("Fail below caused by non-matching italic angles"));
1298 if (aLocalGroup->ScalingOption() != aFetchedGroup->ScalingOption())
1300 if (aLocalGroup->GroupId() != aFetchedGroup->GroupId())
1306 __CONSTRUCT_STEP__(LinkedFonts2)