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 |
103 |
112 |
104 // Texts for measuring maximum ascents and descents: |
113 // Texts for measuring maximum ascents and descents: |
105 _LIT(KWesternFontMaxExtentText, "\x00C1\x00C7" ); |
114 _LIT(KWesternFontMaxExtentText, "\x00C1\x00C7" ); |
106 |
115 |
107 // Language support map |
116 // Language support map |
470 _LIT(KTimes, "times"); |
494 _LIT(KTimes, "times"); |
471 _LIT(KTimesNewRoman, "times new roman"); |
495 _LIT(KTimesNewRoman, "times new roman"); |
472 _LIT(KSerif, "serif"); |
496 _LIT(KSerif, "serif"); |
473 _LIT(KMonospace, "monospaced"); |
497 _LIT(KMonospace, "monospaced"); |
474 _LIT(KCourier, "courier"); |
498 _LIT(KCourier, "courier"); |
|
499 _LIT(KCourierNew, "courier new"); |
|
500 _LIT(KBaskerville, "Baskerville"); |
|
501 _LIT(KTrebuchet, "Trebuchet"); |
475 |
502 |
476 // Group names |
503 // Group names |
477 _LIT(KS60Group, "S60Group"); |
504 _LIT(KS60Group, "S60Group"); |
478 |
505 //new browser fonts start |
|
506 _LIT(KArialGroup, "ArialGroup"); |
|
507 _LIT(KTnrGroup, "TnrGroup"); |
|
508 _LIT(KCourGroup, "CourGroup"); |
|
509 //new browser fonts end |
479 // Default |
510 // Default |
480 _LIT(KDefaultGroupName, "S60Group"); |
511 _LIT(KDefaultGroupName, "S60Group"); |
481 |
512 |
482 /* |
513 /* |
483 * Language and typefaces combinations to use without regard to size and style |
514 * Language and typefaces combinations to use without regard to size and style |
519 { LIT_AS_DESC_PTR(KSystemOne) ,LIT_AS_DESC_PTR(KS60Group), &languagesAndTypefaceTable, ETrue }, |
550 { LIT_AS_DESC_PTR(KSystemOne) ,LIT_AS_DESC_PTR(KS60Group), &languagesAndTypefaceTable, ETrue }, |
520 { LIT_AS_DESC_PTR(KSansSerifHyphen) ,LIT_AS_DESC_PTR(KS60Group), &languagesAndTypefaceTable, ETrue }, |
551 { LIT_AS_DESC_PTR(KSansSerifHyphen) ,LIT_AS_DESC_PTR(KS60Group), &languagesAndTypefaceTable, ETrue }, |
521 { LIT_AS_DESC_PTR(KSansSerif) ,LIT_AS_DESC_PTR(KS60Group), &languagesAndTypefaceTable, ETrue }, |
552 { LIT_AS_DESC_PTR(KSansSerif) ,LIT_AS_DESC_PTR(KS60Group), &languagesAndTypefaceTable, ETrue }, |
522 { LIT_AS_DESC_PTR(KSerif) ,LIT_AS_DESC_PTR(KS60Group), &languagesAndTypefaceTable, ETrue }, |
553 { LIT_AS_DESC_PTR(KSerif) ,LIT_AS_DESC_PTR(KS60Group), &languagesAndTypefaceTable, ETrue }, |
523 { LIT_AS_DESC_PTR(KMonospace) ,LIT_AS_DESC_PTR(KS60Group), &languagesAndTypefaceTable, ETrue }, |
554 { LIT_AS_DESC_PTR(KMonospace) ,LIT_AS_DESC_PTR(KS60Group), &languagesAndTypefaceTable, ETrue }, |
524 { LIT_AS_DESC_PTR(KArial) ,LIT_AS_DESC_PTR(KS60Group), &languagesAndTypefaceTable, EFalse }, |
555 { LIT_AS_DESC_PTR(KTrebuchet) ,LIT_AS_DESC_PTR(KArialGroup), &languagesAndTypefaceTable, EFalse }, |
|
556 { LIT_AS_DESC_PTR(KArial) ,LIT_AS_DESC_PTR(KArialGroup), &languagesAndTypefaceTable, EFalse }, |
525 { LIT_AS_DESC_PTR(KVerdana),LIT_AS_DESC_PTR(KS60Group), &languagesAndTypefaceTable, EFalse }, |
557 { LIT_AS_DESC_PTR(KVerdana),LIT_AS_DESC_PTR(KS60Group), &languagesAndTypefaceTable, EFalse }, |
526 { LIT_AS_DESC_PTR(KHelvetica),LIT_AS_DESC_PTR(KS60Group), &languagesAndTypefaceTable, EFalse }, |
558 { LIT_AS_DESC_PTR(KHelvetica),LIT_AS_DESC_PTR(KS60Group), &languagesAndTypefaceTable, EFalse }, |
527 { LIT_AS_DESC_PTR(KGeorgia),LIT_AS_DESC_PTR(KS60Group), &languagesAndTypefaceTable, EFalse }, |
559 { LIT_AS_DESC_PTR(KBaskerville),LIT_AS_DESC_PTR(KTnrGroup), &languagesAndTypefaceTable, EFalse }, |
528 { LIT_AS_DESC_PTR(KTimes),LIT_AS_DESC_PTR(KS60Group), &languagesAndTypefaceTable, EFalse }, |
560 { LIT_AS_DESC_PTR(KGeorgia),LIT_AS_DESC_PTR(KTnrGroup), &languagesAndTypefaceTable, EFalse }, |
529 { LIT_AS_DESC_PTR(KTimesNewRoman) ,LIT_AS_DESC_PTR(KS60Group), &languagesAndTypefaceTable, EFalse }, |
561 { LIT_AS_DESC_PTR(KTimes),LIT_AS_DESC_PTR(KTnrGroup), &languagesAndTypefaceTable, EFalse }, |
530 { LIT_AS_DESC_PTR(KCourier) ,LIT_AS_DESC_PTR(KS60Group), &languagesAndTypefaceTable, EFalse }, |
562 { LIT_AS_DESC_PTR(KTimesNewRoman) ,LIT_AS_DESC_PTR(KTnrGroup), &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 }, |
531 { LIT_AS_DESC_PTR(KNullDesC) ,LIT_AS_DESC_PTR(KS60Group), &languagesAndTypefaceTable, EFalse } |
565 { LIT_AS_DESC_PTR(KNullDesC) ,LIT_AS_DESC_PTR(KS60Group), &languagesAndTypefaceTable, EFalse } |
532 }; |
566 }; |
533 |
567 |
534 // Product font table. |
568 // Product font table. |
535 |
569 |
646 |
680 |
647 { EAknFontCategorySecondary, 0, EAny, EAny, EAny, EAny, ENotBold, EAntialiase, EChineseLangsTaiwanHKHiResLF, LIT_AS_DESC_PTR(KS60TCHKHRSANSRLF), LIT_AS_DESC_PTR(KS60Group), &apacVectorFontBaselineArray, NULL, NULL }, |
681 { EAknFontCategorySecondary, 0, EAny, EAny, EAny, EAny, ENotBold, EAntialiase, EChineseLangsTaiwanHKHiResLF, LIT_AS_DESC_PTR(KS60TCHKHRSANSRLF), LIT_AS_DESC_PTR(KS60Group), &apacVectorFontBaselineArray, NULL, NULL }, |
648 { EAknFontCategoryPrimarySmall, 0, EAny, EAny, EAny, EAny, ENotBold, EAntialiase, EChineseLangsTaiwanHKHiResLF, LIT_AS_DESC_PTR(KS60TCHKHRSANSSBLF), 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 }, |
649 { EAknFontCategoryPrimary, 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 }, |
650 { EAknFontCategoryTitle, 0, EAny, EAny, EAny, EAny, ENotBold, EAntialiase, EChineseLangsTaiwanHKHiResLF, LIT_AS_DESC_PTR(KS60TCHKHRSANSTTLSMBLDLF), 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 }, |
651 { EAknFontCategoryAny, 0, EAny, EAny, EAny, EAny, ENotBold, EAntialiase, EChineseLangsTaiwanHKHiResLF, LIT_AS_DESC_PTR(KS60TCHKHRSANSRLF), 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 }, |
|
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 |
652 //end |
699 //end |
653 }; |
700 }; |
654 // ============================ GLOBAL FUNCTIONS ======================================== |
701 // ============================ GLOBAL FUNCTIONS ======================================== |
655 |
702 |
656 /** |
703 /** |
1188 if ( aMetrics.Posture() == EPostureItalic ) |
1236 if ( aMetrics.Posture() == EPostureItalic ) |
1189 aFontSpec.iFontStyle.SetPosture(EPostureItalic); |
1237 aFontSpec.iFontStyle.SetPosture(EPostureItalic); |
1190 |
1238 |
1191 // Ensure proportionality flag is set. Assumes all S60 fonts are proportional |
1239 // Ensure proportionality flag is set. Assumes all S60 fonts are proportional |
1192 aFontSpec.iTypeface.SetIsProportional(ETrue); |
1240 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); |
1193 } |
1258 } |
1194 |
1259 |
1195 LOCAL_C TBool HasRequiredLanguages( |
1260 LOCAL_C TBool HasRequiredLanguages( |
1196 TUint aRequiredLanguages, |
1261 TUint aRequiredLanguages, |
1197 CGraphicsDevice* /*aDevice*/, |
1262 CGraphicsDevice* /*aDevice*/, |
1338 aFoundIndex = FindGroupAliasInTable( |
1403 aFoundIndex = FindGroupAliasInTable( |
1339 groupTypeface, aMetrics, aRequiredLanguages, aSizeInPixels, aNeedsExactMatch, aFellBack); |
1404 groupTypeface, aMetrics, aRequiredLanguages, aSizeInPixels, aNeedsExactMatch, aFellBack); |
1340 } |
1405 } |
1341 |
1406 |
1342 TBool specIsSetUp(EFalse); |
1407 TBool specIsSetUp(EFalse); |
1343 |
1408 |
1344 if ( aFoundIndex == KErrNotFound) |
1409 //new browser fonts start |
|
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)) |
1345 { |
1422 { |
1346 // Note that because the alias table has language matching, the direct typeface name should be |
1423 // Note that because the alias table has language matching, the direct typeface name should be |
1347 // appropriate at least for language. |
1424 // appropriate at least for language. |
1348 if ( haveDirectTypeface ) |
1425 if ( haveDirectTypeface ) |
1349 { |
1426 { |
2191 } |
2283 } |
2192 } |
2284 } |
2193 fontfiles.Close(); |
2285 fontfiles.Close(); |
2194 return ret; |
2286 return ret; |
2195 } |
2287 } |
2196 TBool LinkTypefacesInstalled() |
2288 TBool LinkTypefacesInstalled(TAknLinkedFontTypes aFonttype) |
2197 { |
2289 { |
2198 CWsScreenDevice * screenDevice = CCoeEnv::Static()->ScreenDevice(); |
2290 CWsScreenDevice * screenDevice = CCoeEnv::Static()->ScreenDevice(); |
2199 TInt noOfTypefaces = screenDevice->NumTypefaces(); |
2291 TInt noOfTypefaces = screenDevice->NumTypefaces(); |
2200 TBool fTCHKFonts = FeatureManager::FeatureSupported( |
2292 TBool fTCHKFonts = FeatureManager::FeatureSupported( |
2201 KFeatureIdChineseTaiwanHkFonts); |
2293 KFeatureIdChineseTaiwanHkFonts); |
2202 TBool fSCFonts = FeatureManager::FeatureSupported( |
2294 TBool fSCFonts = FeatureManager::FeatureSupported( |
2203 KFeatureIdChinesePrcFonts); |
2295 KFeatureIdChinesePrcFonts); |
2204 TBool fHiResFonts = FeatureManager::FeatureSupported( |
2296 TBool fHiResFonts = FeatureManager::FeatureSupported( |
2205 KFeatureIdChineseFontsHires); |
2297 KFeatureIdChineseFontsHires); |
|
2298 TBool fAdditionalFonts = FeatureManager::FeatureSupported( |
|
2299 KFeatureIdFfAdditionalFonts); |
2206 |
2300 |
2207 |
2301 |
2208 TBool ret = EFalse; |
2302 TBool ret = EFalse; |
2209 TInt files = 0, ref = 0; |
2303 TInt files = 0, ref = 0; |
2210 if(fSCFonts) |
2304 if( (EAknAllLinkedFonts == aFonttype) || (EAknSystemLinkedFonts == aFonttype)) |
2211 ref +=3; |
2305 { |
2212 if(fTCHKFonts) |
2306 if(fSCFonts) |
2213 ref +=3; |
2307 ref +=KAknFontStylesSupported; |
|
2308 if(fTCHKFonts) |
|
2309 ref +=KAknFontStylesSupported; |
|
2310 } |
|
2311 if( (EAknAllLinkedFonts == aFonttype) || (EAknContentLinkedFonts == aFonttype)) |
|
2312 { |
|
2313 if(fAdditionalFonts) |
|
2314 { |
|
2315 if((!fSCFonts) && (!fTCHKFonts) &&(!fHiResFonts)) |
|
2316 ref +=KAknAdditionalBrowserFonts; |
|
2317 } |
|
2318 } |
2214 for (TInt i = 0; i < noOfTypefaces; i++) |
2319 for (TInt i = 0; i < noOfTypefaces; i++) |
2215 { |
2320 { |
2216 TTypefaceSupport typefaceInfo; |
2321 TTypefaceSupport typefaceInfo; |
2217 screenDevice->TypefaceSupport(typefaceInfo, i); |
2322 screenDevice->TypefaceSupport(typefaceInfo, i); |
|
2323 if( (EAknAllLinkedFonts == aFonttype) || (EAknSystemLinkedFonts == aFonttype)) |
|
2324 { |
2218 if (fSCFonts && fHiResFonts) |
2325 if (fSCFonts && fHiResFonts) |
2219 { |
2326 { |
2220 if (typefaceInfo.iTypeface.iName.Compare(KS60SCHRSANSRLF)==0|| |
2327 if (typefaceInfo.iTypeface.iName.Compare(KS60SCHRSANSRLF)==0|| |
2221 typefaceInfo.iTypeface.iName.Compare(KS60SCHRSANSSBLF)==0|| |
2328 typefaceInfo.iTypeface.iName.Compare(KS60SCHRSANSSBLF)==0|| |
2222 typefaceInfo.iTypeface.iName.Compare(KS60SCHRSANSTTLSMBLDLF)==0) |
2329 typefaceInfo.iTypeface.iName.Compare(KS60SCHRSANSTTLSMBLDLF)==0) |