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 #if !defined(__GULFONT_H__)
22 class TResourceReader;
25 /** Packages the attributes of a logical font.
27 These attributes include a UID (iFontId) and a category (iCategory), either
28 of which can be used to identify a required system font. The possible values
29 for the UID are defined in the UI variant's look and feel layer, so are not
30 the same as the UID values that may be used to create a physical font.
32 An object of this class can be passed by any application to CEikonEnv::Font(),
33 to return the closest matching system font (a CFont-derived object).
39 /** Logical font categories.
41 The font category specifies the type of font that is required. It can be specified
42 as an alternative to the logical font UID. The physical fonts associated with
43 these categories are specified in the LAF layer, so are UI variant-specific. */
46 /** The normal system font. */
48 /** The font used in buttons. */
50 /** The font used for annotations. This is smaller than the normal font.
51 For instance, it is used to draw the page number in some applications. */
53 /** The font used for titles. */
65 /** Bold and italics. */
71 /** Light. This is the opposite of bold, i.e. a smaller than normal pen size is
78 IMPORT_C TLogicalFont();
79 IMPORT_C TLogicalFont(TUid aId);
80 IMPORT_C TLogicalFont(TFontCategory aCategory,TFontStyle aStyle,const TZoomFactor& aZoomFactor);
81 IMPORT_C TLogicalFont(TUid aId,TFontCategory aCategory,TFontStyle aStyle,const TZoomFactor& aZoomFactor);
83 /** The logical font ID. */
85 /** The logical font category. */
86 TFontCategory iCategory;
87 /** The font style. */
89 /** The zoom factor. */
90 TZoomFactor iZoomFactor;
94 class CCleanupStackableFont : public CBase
95 /** Wraps a font (CFbsFont) object that can be pushed onto the cleanup stack.
97 By default, the cleanup stack only handles CBase-derived classes, and untyped
98 (TAny*) objects that can be cleaned up by a simple memory free call. Fonts
99 must also be released, which this class handles automatically in its destructor.
101 The font is initialised from a resource file, and can be identified by name
109 IMPORT_C static CCleanupStackableFont* NewL(TResourceReader& aReader,CWsScreenDevice& aScreenDevice);
110 IMPORT_C static CCleanupStackableFont* NewLC(TResourceReader& aReader,CWsScreenDevice& aScreenDevice);
111 IMPORT_C static CCleanupStackableFont* NewByNameL(TResourceReader& aReader,CWsScreenDevice& aScreenDevice);
112 IMPORT_C static CCleanupStackableFont* NewByNameLC(TResourceReader& aReader,CWsScreenDevice& aScreenDevice);
113 IMPORT_C virtual ~CCleanupStackableFont();
115 IMPORT_C CFbsFont& Font() const;
116 IMPORT_C CFbsFont* TakeOwnershipOfFont();
118 CCleanupStackableFont(CWsScreenDevice& aScreenDevice);
119 static CCleanupStackableFont* NewLC(TBool aByUid,TResourceReader& aReader, CWsScreenDevice& aScreenDevice);
121 CWsScreenDevice& iScreenDevice;