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 "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef __COEFONTPROVIDER_H__
17 #define __COEFONTPROVIDER_H__
25 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
27 #endif //SYMBIAN_ENABLE_SPLIT_HEADERS
29 /** A helper object designed to make obtaining a font easier, taking into account
35 class CCoeFontProvider : public CBase
38 IMPORT_C static CCoeFontProvider* NewL();
39 IMPORT_C static CCoeFontProvider* NewL(const TDesC& aTypefaceName);
42 IMPORT_C const CFont& Font(const TCoeFont& aFont, const TZoomFactor& aZoomFactor) const;
44 IMPORT_C void SetTypeface(const TTypeface aTypeface);
45 IMPORT_C void UseSystemTypeface();
46 IMPORT_C TTypeface Typeface() const;
47 public: //but not exported
48 void RefetchPixelMappingL();
51 CCoeFontProvider(const TDesC& aTypefaceName);
53 void ReleaseAllFonts();
58 TFont(const TCoeFont& aFontSpec, TInt aZoomFactor, const CFont* aFont = NULL);
59 static TInt Compare(const TFont& aFirst, const TFont& aSecond);
61 const TCoeFont iCoeFont;
62 const TInt iZoomFactor;
66 mutable RArray<TFont> iFonts;
68 RArray<TInt> iLogicalToPixelSizes;
71 #endif // __COEFONTPROVIDER_H__