fontsupport/fontprovider/Src/FontProvider.cpp
changeset 2 abcbdabaa4c5
parent 1 ba33815114d6
child 32 d9c996538b26
child 42 2398a337fa76
equal deleted inserted replaced
1:ba33815114d6 2:abcbdabaa4c5
    98 _LIT(KS60TCHKHRSANSRLF, "S60TCHKHRSANSRLF");
    98 _LIT(KS60TCHKHRSANSRLF, "S60TCHKHRSANSRLF");
    99 _LIT(KS60TCHKHRSANSSBLF, "S60TCHKHRSANSSBLF");
    99 _LIT(KS60TCHKHRSANSSBLF, "S60TCHKHRSANSSBLF");
   100 _LIT(KS60TCHKHRSANSTTLSMBLDLF, "S60TCHKHRSANSTTLSMBLDLF");
   100 _LIT(KS60TCHKHRSANSTTLSMBLDLF, "S60TCHKHRSANSTTLSMBLDLF");
   101 //end
   101 //end
   102 
   102 
   103 //browser link fonts start
       
   104 //Western Content Linked fonts
       
   105 _LIT(KS60LATAMTREG, "S60LATAMTREG");
       
   106 _LIT(KS60LATAMTBLD, "S60LATAMTBLD");
       
   107 _LIT(KS60LATTHOREG, "S60LATTHOREG");
       
   108 _LIT(KS60LATTHOBLD, "S60LATTHOBLD");
       
   109 _LIT(KS60LATCUMREG, "S60LATCUMREG");
       
   110 _LIT(KS60LATCUMBLD, "S60LATCUMBLD");
       
   111 //browser link fonts stop
       
   112 
   103 
   113 // Texts for measuring maximum ascents and descents:
   104 // Texts for measuring maximum ascents and descents:
   114 _LIT(KWesternFontMaxExtentText, "\x00C1\x00C7" );
   105 _LIT(KWesternFontMaxExtentText, "\x00C1\x00C7" );
   115 
   106 
   116 // Language support map
   107 // Language support map
   133 #define ELanguageSupportKorean                      0x00100000
   124 #define ELanguageSupportKorean                      0x00100000
   134 #define ELanguageSupportHangul                      0x00200000
   125 #define ELanguageSupportHangul                      0x00200000
   135 //chinese adaptation
   126 //chinese adaptation
   136 #define ELanguageSupportChineseFontLinking          0x00400000
   127 #define ELanguageSupportChineseFontLinking          0x00400000
   137 //end
   128 //end
   138 //additional browser fonts
       
   139 #define ELanguageAdditionalContentFonts             0x00800000
       
   140 //end
       
   141 #define ELanguageSupportDevanagari                  0x01000000
   129 #define ELanguageSupportDevanagari                  0x01000000
   142 #define ELanguageSupportS60PrivateUseArea1          0x10000000
   130 #define ELanguageSupportS60PrivateUseArea1          0x10000000
   143 
   131 
   144 // Test characters for language support
   132 // Test characters for language support
   145 // Latin uppercase A
   133 // Latin uppercase A
   226 #define EChineseLangsTaiwanHKHiResLF     ( EChineseLangs \
   214 #define EChineseLangsTaiwanHKHiResLF     ( EChineseLangs \
   227                                         | ELanguageSupportChineseTaiwanHK \
   215                                         | ELanguageSupportChineseTaiwanHK \
   228                                         | ELanguageSupportChineseHiRes \
   216                                         | ELanguageSupportChineseHiRes \
   229                                         | ELanguageSupportChineseFontLinking )
   217                                         | ELanguageSupportChineseFontLinking )
   230 //end                                    
   218 //end                                    
   231 //browser
   219 
   232 #define EElafLangsBrowserFonts ( EElafLangs \
       
   233                                    |ELanguageAdditionalContentFonts)
       
   234 //end
       
   235 
   220 
   236 // Wildcard value for langs (font is to be used for all languages)
   221 // Wildcard value for langs (font is to be used for all languages)
   237 #define EAnyLangs           0xffffffff
   222 #define EAnyLangs           0xffffffff
   238 const TInt KAknFontStylesSupported(3);
   223 const TInt KAknFontStylesSupported(3);
   239 const TInt KAknAdditionalBrowserFonts(6);
       
   240 
       
   241 enum TAknLinkedFontTypes
   224 enum TAknLinkedFontTypes
   242     {
   225     {
   243     EAknSystemLinkedFonts,
   226     EAknSystemLinkedFonts,
   244     EAknContentLinkedFonts,
   227     EAknContentLinkedFonts,
   245     EAknAllLinkedFonts
   228     EAknAllLinkedFonts
   494 _LIT(KTimes, "times");
   477 _LIT(KTimes, "times");
   495 _LIT(KTimesNewRoman, "times new roman");
   478 _LIT(KTimesNewRoman, "times new roman");
   496 _LIT(KSerif, "serif");
   479 _LIT(KSerif, "serif");
   497 _LIT(KMonospace, "monospaced");
   480 _LIT(KMonospace, "monospaced");
   498 _LIT(KCourier, "courier");
   481 _LIT(KCourier, "courier");
   499 _LIT(KCourierNew, "courier new");
       
   500 _LIT(KBaskerville, "Baskerville");
       
   501 _LIT(KTrebuchet, "Trebuchet");
       
   502 
   482 
   503 // Group names
   483 // Group names
   504 _LIT(KS60Group, "S60Group");
   484 _LIT(KS60Group, "S60Group");
   505 //new browser fonts start
   485 
   506 _LIT(KArialGroup, "ArialGroup");
       
   507 _LIT(KTnrGroup, "TnrGroup");
       
   508 _LIT(KCourGroup, "CourGroup");
       
   509 //new browser fonts end
       
   510 // Default
   486 // Default
   511 _LIT(KDefaultGroupName, "S60Group");
   487 _LIT(KDefaultGroupName, "S60Group");
   512 
   488 
   513 /*
   489 /*
   514 * Language and typefaces combinations to use without regard to size and style
   490 * Language and typefaces combinations to use without regard to size and style
   550     { LIT_AS_DESC_PTR(KSystemOne) ,LIT_AS_DESC_PTR(KS60Group), &languagesAndTypefaceTable, ETrue  },
   526     { LIT_AS_DESC_PTR(KSystemOne) ,LIT_AS_DESC_PTR(KS60Group), &languagesAndTypefaceTable, ETrue  },
   551     { LIT_AS_DESC_PTR(KSansSerifHyphen) ,LIT_AS_DESC_PTR(KS60Group), &languagesAndTypefaceTable, ETrue  },
   527     { LIT_AS_DESC_PTR(KSansSerifHyphen) ,LIT_AS_DESC_PTR(KS60Group), &languagesAndTypefaceTable, ETrue  },
   552     { LIT_AS_DESC_PTR(KSansSerif) ,LIT_AS_DESC_PTR(KS60Group), &languagesAndTypefaceTable, ETrue  },
   528     { LIT_AS_DESC_PTR(KSansSerif) ,LIT_AS_DESC_PTR(KS60Group), &languagesAndTypefaceTable, ETrue  },
   553     { LIT_AS_DESC_PTR(KSerif) ,LIT_AS_DESC_PTR(KS60Group), &languagesAndTypefaceTable, ETrue  },
   529     { LIT_AS_DESC_PTR(KSerif) ,LIT_AS_DESC_PTR(KS60Group), &languagesAndTypefaceTable, ETrue  },
   554     { LIT_AS_DESC_PTR(KMonospace) ,LIT_AS_DESC_PTR(KS60Group), &languagesAndTypefaceTable, ETrue  },
   530     { LIT_AS_DESC_PTR(KMonospace) ,LIT_AS_DESC_PTR(KS60Group), &languagesAndTypefaceTable, ETrue  },
   555     { LIT_AS_DESC_PTR(KTrebuchet) ,LIT_AS_DESC_PTR(KArialGroup), &languagesAndTypefaceTable, EFalse  },
   531     { LIT_AS_DESC_PTR(KArial) ,LIT_AS_DESC_PTR(KS60Group), &languagesAndTypefaceTable, EFalse  },
   556     { LIT_AS_DESC_PTR(KArial) ,LIT_AS_DESC_PTR(KArialGroup), &languagesAndTypefaceTable, EFalse  },
       
   557     { LIT_AS_DESC_PTR(KVerdana),LIT_AS_DESC_PTR(KS60Group), &languagesAndTypefaceTable, EFalse  },
   532     { LIT_AS_DESC_PTR(KVerdana),LIT_AS_DESC_PTR(KS60Group), &languagesAndTypefaceTable, EFalse  },
   558     { LIT_AS_DESC_PTR(KHelvetica),LIT_AS_DESC_PTR(KS60Group), &languagesAndTypefaceTable, EFalse  },
   533     { LIT_AS_DESC_PTR(KHelvetica),LIT_AS_DESC_PTR(KS60Group), &languagesAndTypefaceTable, EFalse  },
   559     { LIT_AS_DESC_PTR(KBaskerville),LIT_AS_DESC_PTR(KTnrGroup), &languagesAndTypefaceTable, EFalse  },
   534     { LIT_AS_DESC_PTR(KGeorgia),LIT_AS_DESC_PTR(KS60Group), &languagesAndTypefaceTable, EFalse  },
   560     { LIT_AS_DESC_PTR(KGeorgia),LIT_AS_DESC_PTR(KTnrGroup), &languagesAndTypefaceTable, EFalse  },
   535     { LIT_AS_DESC_PTR(KTimes),LIT_AS_DESC_PTR(KS60Group), &languagesAndTypefaceTable, EFalse  },
   561     { LIT_AS_DESC_PTR(KTimes),LIT_AS_DESC_PTR(KTnrGroup), &languagesAndTypefaceTable, EFalse  },
   536     { LIT_AS_DESC_PTR(KTimesNewRoman) ,LIT_AS_DESC_PTR(KS60Group), &languagesAndTypefaceTable, EFalse  },
   562     { LIT_AS_DESC_PTR(KTimesNewRoman) ,LIT_AS_DESC_PTR(KTnrGroup), &languagesAndTypefaceTable, EFalse  },
   537     { LIT_AS_DESC_PTR(KCourier) ,LIT_AS_DESC_PTR(KS60Group), &languagesAndTypefaceTable, EFalse  },
   563     { LIT_AS_DESC_PTR(KCourier) ,LIT_AS_DESC_PTR(KCourGroup), &languagesAndTypefaceTable, EFalse  },
       
   564     { LIT_AS_DESC_PTR(KCourierNew) ,LIT_AS_DESC_PTR(KCourGroup), &languagesAndTypefaceTable, EFalse  },
       
   565     { LIT_AS_DESC_PTR(KNullDesC) ,LIT_AS_DESC_PTR(KS60Group), &languagesAndTypefaceTable, EFalse }
   538     { LIT_AS_DESC_PTR(KNullDesC) ,LIT_AS_DESC_PTR(KS60Group), &languagesAndTypefaceTable, EFalse }
   566 };
   539 };
   567 
   540 
   568 // Product font table.
   541 // Product font table.
   569 
   542 
   680 
   653 
   681     { EAknFontCategorySecondary,    0, EAny, EAny, EAny, EAny, ENotBold, EAntialiase, EChineseLangsTaiwanHKHiResLF, LIT_AS_DESC_PTR(KS60TCHKHRSANSRLF), LIT_AS_DESC_PTR(KS60Group), &apacVectorFontBaselineArray, NULL, NULL },
   654     { EAknFontCategorySecondary,    0, EAny, EAny, EAny, EAny, ENotBold, EAntialiase, EChineseLangsTaiwanHKHiResLF, LIT_AS_DESC_PTR(KS60TCHKHRSANSRLF), LIT_AS_DESC_PTR(KS60Group), &apacVectorFontBaselineArray, NULL, NULL },
   682     { EAknFontCategoryPrimarySmall, 0, EAny, EAny, EAny, EAny, ENotBold, EAntialiase, EChineseLangsTaiwanHKHiResLF, LIT_AS_DESC_PTR(KS60TCHKHRSANSSBLF), LIT_AS_DESC_PTR(KS60Group), &apacVectorFontBaselineArray, NULL, NULL },
   655     { EAknFontCategoryPrimarySmall, 0, EAny, EAny, EAny, EAny, ENotBold, EAntialiase, EChineseLangsTaiwanHKHiResLF, LIT_AS_DESC_PTR(KS60TCHKHRSANSSBLF), LIT_AS_DESC_PTR(KS60Group), &apacVectorFontBaselineArray, NULL, NULL },
   683     { EAknFontCategoryPrimary,      0, EAny, EAny, EAny, EAny, ENotBold, EAntialiase, EChineseLangsTaiwanHKHiResLF, LIT_AS_DESC_PTR(KS60TCHKHRSANSSBLF), LIT_AS_DESC_PTR(KS60Group), &apacVectorFontBaselineArray, NULL, NULL },
   656     { EAknFontCategoryPrimary,      0, EAny, EAny, EAny, EAny, ENotBold, EAntialiase, EChineseLangsTaiwanHKHiResLF, LIT_AS_DESC_PTR(KS60TCHKHRSANSSBLF), LIT_AS_DESC_PTR(KS60Group), &apacVectorFontBaselineArray, NULL, NULL },
   684     { EAknFontCategoryTitle,        0, EAny, EAny, EAny, EAny, ENotBold, EAntialiase, EChineseLangsTaiwanHKHiResLF, LIT_AS_DESC_PTR(KS60TCHKHRSANSTTLSMBLDLF), LIT_AS_DESC_PTR(KS60Group), &apacVectorFontBaselineArray, NULL, NULL },
   657     { EAknFontCategoryTitle,        0, EAny, EAny, EAny, EAny, ENotBold, EAntialiase, EChineseLangsTaiwanHKHiResLF, LIT_AS_DESC_PTR(KS60TCHKHRSANSTTLSMBLDLF), LIT_AS_DESC_PTR(KS60Group), &apacVectorFontBaselineArray, NULL, NULL },
   685     { EAknFontCategoryAny,          0, EAny, EAny, EAny, EAny, ENotBold, EAntialiase, EChineseLangsTaiwanHKHiResLF, LIT_AS_DESC_PTR(KS60TCHKHRSANSRLF), LIT_AS_DESC_PTR(KS60Group), &apacVectorFontBaselineArray, NULL, NULL },
   658     { EAknFontCategoryAny,          0, EAny, EAny, EAny, EAny, ENotBold, EAntialiase, EChineseLangsTaiwanHKHiResLF, LIT_AS_DESC_PTR(KS60TCHKHRSANSRLF), LIT_AS_DESC_PTR(KS60Group), &apacVectorFontBaselineArray, NULL, NULL }
   686     
       
   687     //new browser fonts start
       
   688     //western tnr
       
   689     { EAknFontCategoryAny,          0, EAny, EStrokeWeightBold, EAny, EAny, ENotBold, EAntialiase, EElafLangsBrowserFonts, LIT_AS_DESC_PTR(KS60LATTHOBLD), LIT_AS_DESC_PTR(KTnrGroup), NULL, &latinHeightRequestArray, LIT_AS_DESC_PTR(KWesternFontMaxExtentText) },
       
   690     { EAknFontCategoryAny,          0, EAny, EAny, EAny, EAny, ENotBold, EAntialiase, EElafLangsBrowserFonts, LIT_AS_DESC_PTR(KS60LATTHOREG), LIT_AS_DESC_PTR(KTnrGroup), NULL, &latinHeightRequestArray, LIT_AS_DESC_PTR(KWesternFontMaxExtentText) },
       
   691     //western arial
       
   692     { EAknFontCategoryAny,          0, EAny, EStrokeWeightBold, EAny, EAny, ENotBold, EAntialiase, EElafLangsBrowserFonts, LIT_AS_DESC_PTR(KS60LATAMTBLD), LIT_AS_DESC_PTR(KArialGroup), NULL, &latinHeightRequestArray, LIT_AS_DESC_PTR(KWesternFontMaxExtentText) },
       
   693     { EAknFontCategoryAny,          0, EAny, EAny, EAny, EAny, ENotBold, EAntialiase, EElafLangsBrowserFonts, LIT_AS_DESC_PTR(KS60LATAMTREG), LIT_AS_DESC_PTR(KArialGroup), NULL, &latinHeightRequestArray, LIT_AS_DESC_PTR(KWesternFontMaxExtentText) },
       
   694     //western courier
       
   695     { EAknFontCategoryAny,          0, EAny, EStrokeWeightBold, EAny, EAny, ENotBold, EAntialiase, EElafLangsBrowserFonts, LIT_AS_DESC_PTR(KS60LATCUMBLD), LIT_AS_DESC_PTR(KCourGroup), NULL, &latinHeightRequestArray, LIT_AS_DESC_PTR(KWesternFontMaxExtentText)},
       
   696     { EAknFontCategoryAny,          0, EAny, EAny, EAny, EAny, ENotBold, EAntialiase, EElafLangsBrowserFonts, LIT_AS_DESC_PTR(KS60LATCUMREG), LIT_AS_DESC_PTR(KCourGroup), NULL, &latinHeightRequestArray, LIT_AS_DESC_PTR(KWesternFontMaxExtentText) }, 
       
   697         
       
   698     //new browser fonts end
       
   699 //end
   659 //end
   700     };
   660     };
   701 // ============================ GLOBAL FUNCTIONS ========================================
   661 // ============================ GLOBAL FUNCTIONS ========================================
   702 
   662 
   703 /**
   663 /**
  1131 * This returns true if the typeface is in the list of typefaces that the system says are available
  1091 * This returns true if the typeface is in the list of typefaces that the system says are available
  1132 * It may leave.
  1092 * It may leave.
  1133 */
  1093 */
  1134 LOCAL_C TBool TypefaceAvailableL( 
  1094 LOCAL_C TBool TypefaceAvailableL( 
  1135     CGraphicsDevice& aDevice, 
  1095     CGraphicsDevice& aDevice, 
  1136     const TTypeface& aTypeface,
  1096     const TTypeface& aTypeface )
  1137     TInt aTypefaceType =EGulNoSymbolFonts )
       
  1138     {
  1097     {
  1139     TBool found(EFalse);
  1098     TBool found(EFalse);
  1140 
  1099 
  1141     CDesCArray* array = new(ELeave) CDesCArrayFlat( 6 );
  1100     CDesCArray* array = new(ELeave) CDesCArrayFlat( 6 );
  1142     CleanupStack::PushL( array );
  1101     CleanupStack::PushL( array );
  1143 
  1102 
  1144     FontUtils::GetAvailableFontsL(aDevice, *array, aTypefaceType);
  1103     FontUtils::GetAvailableFontsL(aDevice, *array, EGulNoSymbolFonts);
  1145     for ( TInt i = 0; i < array->Count(); i++ )
  1104     for ( TInt i = 0; i < array->Count(); i++ )
  1146         {       
  1105         {       
  1147         TPtrC fontName((*array)[i]);
  1106         TPtrC fontName((*array)[i]);
  1148 
  1107 
  1149         if ( fontName.MatchF(aTypeface.iName) == 0 )
  1108         if ( fontName.MatchF(aTypeface.iName) == 0 )
  1236     if ( aMetrics.Posture() == EPostureItalic )
  1195     if ( aMetrics.Posture() == EPostureItalic )
  1237         aFontSpec.iFontStyle.SetPosture(EPostureItalic);
  1196         aFontSpec.iFontStyle.SetPosture(EPostureItalic);
  1238     
  1197     
  1239     // Ensure proportionality flag is set. Assumes all S60 fonts are proportional
  1198     // Ensure proportionality flag is set. Assumes all S60 fonts are proportional
  1240     aFontSpec.iTypeface.SetIsProportional(ETrue);    
  1199     aFontSpec.iTypeface.SetIsProportional(ETrue);    
  1241     
       
  1242     TInt reqLangs = FontProviderRequiredLangs();
       
  1243     if((reqLangs == EChineseLangsPRC) || (reqLangs ==EChineseLangsTaiwanHK)|| 
       
  1244        (reqLangs ==EChineseLangsPRCLF) ||(reqLangs ==EChineseLangsTaiwanHKLF))
       
  1245         {
       
  1246         if((aFontSpec.iHeight > 21) && ( EAntiAliasedGlyphBitmap != aFontSpec.iFontStyle.BitmapType()))
       
  1247             aFontSpec.iFontStyle.SetBitmapType(EAntiAliasedGlyphBitmap);
       
  1248         //stroke font files used, not to use bold
       
  1249         aFontSpec.iFontStyle.SetStrokeWeight(EStrokeWeightNormal );
       
  1250         }
       
  1251     else if(reqLangs == EKoreanLangs)
       
  1252         {
       
  1253         if((aFontSpec.iHeight > 17) && ( EAntiAliasedGlyphBitmap != aFontSpec.iFontStyle.BitmapType()))
       
  1254             aFontSpec.iFontStyle.SetBitmapType(EAntiAliasedGlyphBitmap);        
       
  1255         }
       
  1256     else if((aFontSpec.iHeight > 16) && ( EAntiAliasedGlyphBitmap != aFontSpec.iFontStyle.BitmapType()))
       
  1257         aFontSpec.iFontStyle.SetBitmapType(EAntiAliasedGlyphBitmap);
       
  1258     }
  1200     }
  1259 
  1201 
  1260 LOCAL_C TBool HasRequiredLanguages( 
  1202 LOCAL_C TBool HasRequiredLanguages( 
  1261     TUint aRequiredLanguages, 
  1203     TUint aRequiredLanguages, 
  1262     CGraphicsDevice* /*aDevice*/, 
  1204     CGraphicsDevice* /*aDevice*/, 
  1403         aFoundIndex = FindGroupAliasInTable( 
  1345         aFoundIndex = FindGroupAliasInTable( 
  1404             groupTypeface, aMetrics, aRequiredLanguages, aSizeInPixels, aNeedsExactMatch, aFellBack);
  1346             groupTypeface, aMetrics, aRequiredLanguages, aSizeInPixels, aNeedsExactMatch, aFellBack);
  1405         }
  1347         }
  1406 
  1348 
  1407     TBool specIsSetUp(EFalse);
  1349     TBool specIsSetUp(EFalse);
  1408     
  1350 
  1409 	//new browser fonts start
  1351     if ( aFoundIndex == KErrNotFound)
  1410     //checking whether the typeface is installed
       
  1411     TInt numberOfRows = sizeof( productFontTable )/ sizeof( SAknProductFontTableLine );
       
  1412     SAknProductFontTableLine line = productFontTable[aFoundIndex];
       
  1413     TTypeface pftTypeface;
       
  1414     TBool available(ETrue);
       
  1415     if(aFoundIndex>=0 && aFoundIndex<numberOfRows)
       
  1416         {
       
  1417     pftTypeface.iName = line.iTypefaceName->Left((KMaxTypefaceNameLength));
       
  1418     TRAP_IGNORE( available = TypefaceAvailableL( *aDevice, pftTypeface,EGulAllFonts ) );    
       
  1419         }
       
  1420     //end
       
  1421     if ( (aFoundIndex == KErrNotFound) || ((TInt)EFalse == available))
       
  1422         {
  1352         {
  1423         // Note that because the alias table has language matching, the direct typeface name should be 
  1353         // Note that because the alias table has language matching, the direct typeface name should be 
  1424         // appropriate at least for language.
  1354         // appropriate at least for language.
  1425         if ( haveDirectTypeface )
  1355         if ( haveDirectTypeface )
  1426             {
  1356             {
  1875 EXPORT_C void AknFontProvider::InitializeSystemL ( const CEikonEnv& aEnv )
  1805 EXPORT_C void AknFontProvider::InitializeSystemL ( const CEikonEnv& aEnv )
  1876     {
  1806     {
  1877     //chinese adaptation
  1807     //chinese adaptation
  1878     TBool fChLinkedFonts = FeatureManager::FeatureSupported(KFeatureIdFfLinkedFontsChinese);
  1808     TBool fChLinkedFonts = FeatureManager::FeatureSupported(KFeatureIdFfLinkedFontsChinese);
  1879     TBool fChinese = FeatureManager::FeatureSupported(KFeatureIdChinese);
  1809     TBool fChinese = FeatureManager::FeatureSupported(KFeatureIdChinese);
  1880     TBool fAdditionalFonts = FeatureManager::FeatureSupported(KFeatureIdFfAdditionalFonts);
  1810     if(fChinese && fChLinkedFonts)
  1881     if((fChinese && fChLinkedFonts) || fAdditionalFonts)
       
  1882       {
  1811       {
  1883       //attempt to create linked font only once
  1812       //attempt to create linked font only once
  1884       if(!LinkTypefacesInstalled())
  1813       if(!LinkTypefacesInstalled())
  1885 	    {
  1814 	    {
       
  1815 	     //TRAP call necessary
       
  1816 	     //not need to handle return value, hanled by LinkTypefacesInstalled()
  1886 	     TRAP_IGNORE(IntializeLinkedFontL());
  1817 	     TRAP_IGNORE(IntializeLinkedFontL());
  1887       	}    	  
  1818       	}    	  
  1888       }
  1819       }
  1889     //end       
  1820     //end       
  1890     // This determines which languages are required
  1821     // This determines which languages are required
  2186     _LIT(KTCHKStop, "[TCHK_LINK_STOP]");
  2117     _LIT(KTCHKStop, "[TCHK_LINK_STOP]");
  2187     _LIT(KSCHRStart, "[SCHR_LINK_START]");
  2118     _LIT(KSCHRStart, "[SCHR_LINK_START]");
  2188     _LIT(KSCHRStop, "[SCHR_LINK_STOP]");
  2119     _LIT(KSCHRStop, "[SCHR_LINK_STOP]");
  2189     _LIT(KTCHKHRStart, "[TCHKHR_LINK_START]");
  2120     _LIT(KTCHKHRStart, "[TCHKHR_LINK_START]");
  2190     _LIT(KTCHKHRStop, "[TCHKHR_LINK_STOP]");
  2121     _LIT(KTCHKHRStop, "[TCHKHR_LINK_STOP]");
  2191     _LIT(KWESTBROWStart, "[WESTERN_BROWSER_START]");
       
  2192     _LIT(KWESTBROWStop, "[WESTERN_BROWSER_STOP]");
       
  2193 
  2122 
  2194     TInt ret = KErrNone;
  2123     TInt ret = KErrNone;
  2195     RPointerArray<SLinkedFontDetails> fontfiles;
  2124     RPointerArray<SLinkedFontDetails> fontfiles;
  2196     RFs fs;
  2125     RFs fs;
  2197     RFile rFile;
  2126     RFile rFile;
  2210             KFeatureIdChineseTaiwanHkFonts);
  2139             KFeatureIdChineseTaiwanHkFonts);
  2211     TBool fSCFonts = FeatureManager::FeatureSupported(
  2140     TBool fSCFonts = FeatureManager::FeatureSupported(
  2212             KFeatureIdChinesePrcFonts);
  2141             KFeatureIdChinesePrcFonts);
  2213     TBool fHiResFonts = FeatureManager::FeatureSupported(
  2142     TBool fHiResFonts = FeatureManager::FeatureSupported(
  2214             KFeatureIdChineseFontsHires);
  2143             KFeatureIdChineseFontsHires);
  2215     TBool fAdditionalFonts = FeatureManager::FeatureSupported(
       
  2216             KFeatureIdFfAdditionalFonts);
       
  2217     TBool fChinese = FeatureManager::FeatureSupported(
       
  2218             KFeatureIdChinese);
       
  2219 
  2144 
  2220     
  2145     
  2221     if (fChLinkedFonts)
  2146     if (fChLinkedFonts)
  2222         {
  2147         {
  2223 
  2148 
  2248             stopTok.Copy(KTCHKStop);
  2173             stopTok.Copy(KTCHKStop);
  2249             tfile.Seek(ESeekStart);
  2174             tfile.Seek(ESeekStart);
  2250             ret = DoPopulateAndCreateLinkFontsL(tfile, startTok, stopTok);
  2175             ret = DoPopulateAndCreateLinkFontsL(tfile, startTok, stopTok);
  2251             }
  2176             }
  2252         
  2177         
  2253         }
       
  2254     if(fAdditionalFonts)
       
  2255         {
       
  2256         if((!fChinese) && (!fSCFonts) && (!fTCHKFonts) && (!fHiResFonts))//must be western variant
       
  2257             {
       
  2258             startTok.Copy(KWESTBROWStart);
       
  2259             stopTok.Copy(KWESTBROWStop);
       
  2260             tfile.Seek(ESeekStart);
       
  2261             ret = DoPopulateAndCreateLinkFontsL(tfile, startTok, stopTok);            
       
  2262             }
       
  2263         }
  2178         }
  2264 
  2179 
  2265     
  2180     
  2266     rFile.Close();
  2181     rFile.Close();
  2267     fs.Close();
  2182     fs.Close();
  2293             KFeatureIdChineseTaiwanHkFonts);
  2208             KFeatureIdChineseTaiwanHkFonts);
  2294     TBool fSCFonts = FeatureManager::FeatureSupported(
  2209     TBool fSCFonts = FeatureManager::FeatureSupported(
  2295             KFeatureIdChinesePrcFonts);
  2210             KFeatureIdChinesePrcFonts);
  2296     TBool fHiResFonts = FeatureManager::FeatureSupported(
  2211     TBool fHiResFonts = FeatureManager::FeatureSupported(
  2297             KFeatureIdChineseFontsHires);
  2212             KFeatureIdChineseFontsHires);
  2298     TBool fAdditionalFonts = FeatureManager::FeatureSupported(
       
  2299             KFeatureIdFfAdditionalFonts);
       
  2300 
  2213 
  2301     
  2214     
  2302     TBool ret = EFalse;
  2215     TBool ret = EFalse;
  2303     TInt files = 0, ref = 0;
  2216     TInt files = 0, ref = 0;
  2304     if( (EAknAllLinkedFonts == aFonttype) || (EAknSystemLinkedFonts == aFonttype))
  2217     if( (EAknAllLinkedFonts == aFonttype) || (EAknSystemLinkedFonts == aFonttype))
  2306         if(fSCFonts)
  2219         if(fSCFonts)
  2307            ref +=KAknFontStylesSupported;
  2220            ref +=KAknFontStylesSupported;
  2308         if(fTCHKFonts)
  2221         if(fTCHKFonts)
  2309            ref +=KAknFontStylesSupported;
  2222            ref +=KAknFontStylesSupported;
  2310         }
  2223         }
  2311     if( (EAknAllLinkedFonts == aFonttype) || (EAknContentLinkedFonts == aFonttype))
       
  2312         {
       
  2313         if(fAdditionalFonts)
       
  2314             {
       
  2315             if((!fSCFonts) && (!fTCHKFonts) &&(!fHiResFonts))
       
  2316                 ref +=KAknAdditionalBrowserFonts;
       
  2317             }
       
  2318         }
       
  2319     for (TInt i = 0; i < noOfTypefaces; i++)
  2224     for (TInt i = 0; i < noOfTypefaces; i++)
  2320         {
  2225         {
  2321         TTypefaceSupport typefaceInfo;
  2226         TTypefaceSupport typefaceInfo;
  2322         screenDevice->TypefaceSupport(typefaceInfo, i);
  2227         screenDevice->TypefaceSupport(typefaceInfo, i);
  2323         if( (EAknAllLinkedFonts == aFonttype) || (EAknSystemLinkedFonts == aFonttype))
  2228         if( (EAknAllLinkedFonts == aFonttype) || (EAknSystemLinkedFonts == aFonttype))
  2361                 {
  2266                 {
  2362                 files++;
  2267                 files++;
  2363                 }
  2268                 }
  2364             }
  2269             }
  2365         }
  2270         }
  2366         if( (EAknAllLinkedFonts == aFonttype) || (EAknContentLinkedFonts == aFonttype))
  2271       }
  2367             {
       
  2368            if(fAdditionalFonts)
       
  2369                {
       
  2370                if( (!fSCFonts) && (!fTCHKFonts) && (!fHiResFonts))
       
  2371                    {
       
  2372                    if (typefaceInfo.iTypeface.iName.Compare(KS60LATAMTREG)==0||
       
  2373                        typefaceInfo.iTypeface.iName.Compare(KS60LATAMTBLD)==0||
       
  2374                        typefaceInfo.iTypeface.iName.Compare(KS60LATTHOREG)==0||
       
  2375                        typefaceInfo.iTypeface.iName.Compare(KS60LATTHOBLD)==0||
       
  2376                        typefaceInfo.iTypeface.iName.Compare(KS60LATCUMREG)==0||
       
  2377                        typefaceInfo.iTypeface.iName.Compare(KS60LATCUMBLD)==0)
       
  2378                        {
       
  2379                        files++;
       
  2380                        }
       
  2381                    }
       
  2382                }
       
  2383             }
       
  2384                
       
  2385              
       
  2386         }
       
  2387     if (ref == files)
  2272     if (ref == files)
  2388         ret = ETrue;
  2273         ret = ETrue;
  2389     return ret;
  2274     return ret;
  2390     }
  2275     }
  2391  
  2276