1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef __COEFONTPROVIDER_H__
17 #define __COEFONTPROVIDER_H__
26 /** A helper object designed to make obtaining a font easier, taking into account
32 class CCoeFontProvider : public CBase
35 IMPORT_C static CCoeFontProvider* NewL();
36 IMPORT_C static CCoeFontProvider* NewL(const TDesC& aTypefaceName);
39 IMPORT_C const CFont& Font(const TCoeFont& aFont, const TZoomFactor& aZoomFactor) const;
41 IMPORT_C void SetTypeface(const TTypeface aTypeface);
42 IMPORT_C void UseSystemTypeface();
43 IMPORT_C TTypeface Typeface() const;
44 public: //but not exported
45 void RefetchPixelMappingL();
48 CCoeFontProvider(const TDesC& aTypefaceName);
50 void ReleaseAllFonts();
55 TFont(const TCoeFont& aFontSpec, TInt aZoomFactor, const CFont* aFont = NULL);
56 static TInt Compare(const TFont& aFirst, const TFont& aSecond);
58 const TCoeFont iCoeFont;
59 const TInt iZoomFactor;
63 mutable RArray<TFont> iFonts;
65 RArray<TInt> iLogicalToPixelSizes;
68 #endif // __COEFONTPROVIDER_H__