williamr@2
|
1 |
// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
2 |
// All rights reserved.
|
williamr@2
|
3 |
// This component and the accompanying materials are made available
|
williamr@2
|
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
|
williamr@2
|
5 |
// which accompanies this distribution, and is available
|
williamr@2
|
6 |
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
|
williamr@2
|
7 |
//
|
williamr@2
|
8 |
// Initial Contributors:
|
williamr@2
|
9 |
// Nokia Corporation - initial contribution.
|
williamr@2
|
10 |
//
|
williamr@2
|
11 |
// Contributors:
|
williamr@2
|
12 |
//
|
williamr@2
|
13 |
// Description:
|
williamr@2
|
14 |
//
|
williamr@2
|
15 |
|
williamr@2
|
16 |
#ifndef FNTSTORE_H__
|
williamr@2
|
17 |
#define FNTSTORE_H__
|
williamr@2
|
18 |
|
williamr@2
|
19 |
#include <e32std.h>
|
williamr@2
|
20 |
#include <f32file.h>
|
williamr@2
|
21 |
#include <gdi.h>
|
williamr@2
|
22 |
#include <openfont.h>
|
williamr@2
|
23 |
|
williamr@2
|
24 |
class CLinkedTypefaceSpecification;
|
williamr@2
|
25 |
class CLinkedFontSpecification;
|
williamr@2
|
26 |
class TLinkedTypefaceSpecArgs;
|
williamr@2
|
27 |
class CFbClient;
|
williamr@2
|
28 |
class CFontStoreFile;
|
williamr@2
|
29 |
class CFontBitmap;
|
williamr@2
|
30 |
class RReadStream;
|
williamr@2
|
31 |
class TTypefaceFontBitmap;
|
williamr@2
|
32 |
class TShapeHeader;
|
williamr@2
|
33 |
class TShapeMessageParameters;
|
williamr@2
|
34 |
class CTypefaceSupportInfo;
|
williamr@2
|
35 |
|
williamr@2
|
36 |
|
williamr@2
|
37 |
/**
|
williamr@2
|
38 |
@internalTechnology
|
williamr@2
|
39 |
*/
|
williamr@2
|
40 |
class TCharacterMetrics
|
williamr@2
|
41 |
{
|
williamr@2
|
42 |
public:
|
williamr@2
|
43 |
IMPORT_C TCharacterMetrics();
|
williamr@2
|
44 |
|
williamr@2
|
45 |
TInt16 iAscentInPixels;
|
williamr@2
|
46 |
TInt16 iHeightInPixels;
|
williamr@2
|
47 |
TInt16 iLeftAdjustInPixels;
|
williamr@2
|
48 |
TInt16 iMoveInPixels;
|
williamr@2
|
49 |
TInt16 iRightAdjustInPixels;
|
williamr@2
|
50 |
};
|
williamr@2
|
51 |
|
williamr@2
|
52 |
class TAlgStyle
|
williamr@2
|
53 |
/**
|
williamr@2
|
54 |
An algorithmic style for how a font is drawn.
|
williamr@2
|
55 |
|
williamr@2
|
56 |
Holds attributes such as whether the font is bold or italic, and the width
|
williamr@2
|
57 |
and height factors. This is used as an input parameter for the GetFontById() method
|
williamr@2
|
58 |
of some font management classes. See CWsScreenDevice::GetFontById() for more information.
|
williamr@2
|
59 |
@publishedAll
|
williamr@2
|
60 |
@released
|
williamr@2
|
61 |
@see CWsScreenDevice::GetFontById()
|
williamr@2
|
62 |
@see CFbsTypefaceStore::GetFontById()
|
williamr@2
|
63 |
@see CFbsDevice::GetFontById()
|
williamr@2
|
64 |
*/
|
williamr@2
|
65 |
{
|
williamr@2
|
66 |
public:
|
williamr@2
|
67 |
IMPORT_C TAlgStyle();
|
williamr@2
|
68 |
IMPORT_C void SetIsBold(TBool aIsBold);
|
williamr@2
|
69 |
IMPORT_C void SetIsItalic(TBool aIsItalic);
|
williamr@2
|
70 |
IMPORT_C void SetIsMono(TBool aIsMono);
|
williamr@2
|
71 |
IMPORT_C void SetWidthFactor(TInt aWidthFactor);
|
williamr@2
|
72 |
IMPORT_C void SetHeightFactor(TInt aHeightFactor);
|
williamr@2
|
73 |
IMPORT_C TBool IsBold() const;
|
williamr@2
|
74 |
IMPORT_C TBool IsItalic() const;
|
williamr@2
|
75 |
IMPORT_C TBool IsMono() const;
|
williamr@2
|
76 |
IMPORT_C TInt WidthFactor() const;
|
williamr@2
|
77 |
IMPORT_C TInt HeightFactor() const;
|
williamr@2
|
78 |
IMPORT_C TBool operator==(const TAlgStyle& aAlgStyle) const;
|
williamr@2
|
79 |
TBool operator!=(const TAlgStyle& aAlgStyle) const;
|
williamr@2
|
80 |
public:
|
williamr@2
|
81 |
/** Baseline offset in pixels. */
|
williamr@2
|
82 |
TInt iBaselineOffsetInPixels;
|
williamr@2
|
83 |
private:
|
williamr@2
|
84 |
enum
|
williamr@2
|
85 |
{
|
williamr@2
|
86 |
EBold=1,
|
williamr@2
|
87 |
EItalic=2,
|
williamr@2
|
88 |
EMono=4,
|
williamr@2
|
89 |
};
|
williamr@2
|
90 |
/** This member is private and not intended for use. */
|
williamr@2
|
91 |
TInt8 iFlags;
|
williamr@2
|
92 |
/** This member is private and not intended for use. */
|
williamr@2
|
93 |
TInt8 iWidthFactor;
|
williamr@2
|
94 |
/** This member is private and not intended for use. */
|
williamr@2
|
95 |
TInt8 iHeightFactor;
|
williamr@2
|
96 |
};
|
williamr@2
|
97 |
|
williamr@2
|
98 |
class CLinkedFontInformation;
|
williamr@2
|
99 |
|
williamr@2
|
100 |
/**
|
williamr@2
|
101 |
Bitmap font class.
|
williamr@2
|
102 |
An object of this class may either access and use a bitmap font (a CFontBitmap)
|
williamr@2
|
103 |
or an open font (a COpenFont).
|
williamr@2
|
104 |
Stored in a CFontStore.
|
williamr@2
|
105 |
@publishedAll
|
williamr@2
|
106 |
@released
|
williamr@2
|
107 |
*/
|
williamr@2
|
108 |
class CBitmapFont : public CFont
|
williamr@2
|
109 |
{
|
williamr@2
|
110 |
friend class CFontStore;
|
williamr@2
|
111 |
friend class CLinkedFontSpecification;
|
williamr@2
|
112 |
friend class CLinkedFontInformation;
|
williamr@2
|
113 |
public:
|
williamr@2
|
114 |
// New functions
|
williamr@2
|
115 |
TUid Uid() const;
|
williamr@2
|
116 |
IMPORT_C TCharacterMetrics CharacterMetrics(TInt aCode,const TUint8*& aBytes) const;
|
williamr@2
|
117 |
IMPORT_C TBool GetCharacterData(TInt aSessionHandle, TInt aCode, TOpenFontCharMetrics& aMetrics, const TUint8*& aBitmap) const;
|
williamr@2
|
118 |
IMPORT_C TBool Rasterize(TInt aSessionHandle,TInt aCode,TOpenFontGlyphData* aGlyphData) const;
|
williamr@2
|
119 |
IMPORT_C void GetFontMetrics(TOpenFontMetrics& aMetrics) const;
|
williamr@2
|
120 |
IMPORT_C TBool GetFaceAttrib(TOpenFontFaceAttrib& aAttrib) const;
|
williamr@2
|
121 |
IMPORT_C TInt BitmapEncoding() const;
|
williamr@2
|
122 |
IMPORT_C TBool HasCharacterL(TInt aCode) const;
|
williamr@2
|
123 |
IMPORT_C TBool CharacterNeedsToBeRasterized(TInt aSessionHandle,TInt aCode) const;
|
williamr@2
|
124 |
IMPORT_C TShapeHeader* ShapeTextL(const TDesC16& aText,
|
williamr@2
|
125 |
TInt aSessionHandle, const TShapeMessageParameters& aParams);
|
williamr@2
|
126 |
IMPORT_C void DeleteShape(TInt aSessionHandle,TShapeHeader* aHeader);
|
williamr@2
|
127 |
IMPORT_C void operator delete(TAny*);
|
williamr@2
|
128 |
inline TBool IsOpenFont() const;
|
williamr@2
|
129 |
inline COpenFont* OpenFont() const;
|
williamr@2
|
130 |
inline TGlyphBitmapType GlyphBitmapType() const;
|
williamr@2
|
131 |
IMPORT_C CLinkedFontInformation* LinkedFontInformation() const;
|
williamr@2
|
132 |
IMPORT_C CBitmapFont* NextFontClientSpace() const;
|
williamr@2
|
133 |
IMPORT_C TBool IsLinkedFont()const;
|
williamr@2
|
134 |
IMPORT_C CBitmapFont* FontWithCharacter(TInt aCode, CLinkedFontInformation *&aInfo, TBool aSearchAllFonts, TBool aGetCanonicalDefault) const;
|
williamr@2
|
135 |
|
williamr@2
|
136 |
private:
|
williamr@2
|
137 |
// From CFont
|
williamr@2
|
138 |
IMPORT_C virtual TUid DoTypeUid() const;
|
williamr@2
|
139 |
IMPORT_C virtual TInt DoHeightInPixels() const;
|
williamr@2
|
140 |
IMPORT_C virtual TInt DoAscentInPixels() const;
|
williamr@2
|
141 |
IMPORT_C virtual TInt DoCharWidthInPixels(TChar aChar) const;
|
williamr@2
|
142 |
IMPORT_C virtual TInt DoTextWidthInPixels(const TDesC &aText) const;
|
williamr@2
|
143 |
IMPORT_C virtual TInt DoBaselineOffsetInPixels() const;
|
williamr@2
|
144 |
IMPORT_C virtual TInt DoTextCount(const TDesC &aText, TInt aWidthInPixels) const;
|
williamr@2
|
145 |
IMPORT_C virtual TInt DoTextCount(const TDesC &aText, TInt aWidthInPixels, TInt &aExcessWidthInPixels) const;
|
williamr@2
|
146 |
IMPORT_C virtual TInt DoMaxCharWidthInPixels() const;
|
williamr@2
|
147 |
IMPORT_C virtual TInt DoMaxNormalCharWidthInPixels() const;
|
williamr@2
|
148 |
IMPORT_C virtual TFontSpec DoFontSpecInTwips() const;
|
williamr@2
|
149 |
IMPORT_C virtual TInt DoExtendedFunction(TUid aFunctionId, TAny* aParam = NULL) const;
|
williamr@2
|
150 |
|
williamr@2
|
151 |
private:
|
williamr@2
|
152 |
CBitmapFont(RHeap* aHeap,const TFontSpec& aFontSpecInTwips, const TAlgStyle& aAlgStyle, CFontBitmap* aFontBitmap);
|
williamr@2
|
153 |
CBitmapFont(RHeap* aHeap,const TFontSpec& aFontSpecInTwips, const TAlgStyle& aAlgStyle, COpenFont* aOpenFont);
|
williamr@2
|
154 |
void ConstructL();
|
williamr@2
|
155 |
~CBitmapFont();
|
williamr@2
|
156 |
static CBitmapFont* NewL(RHeap* aHeap, const TFontSpec& aFontSpecInTwips, const TAlgStyle& aAlgStyle, CFontBitmap* aFontBitmap);
|
williamr@2
|
157 |
static CBitmapFont* NewL(RHeap* aHeap, const TFontSpec& aFontSpecInTwips, const TAlgStyle& aAlgStyle, COpenFont* aOpenFont);
|
williamr@2
|
158 |
inline void operator delete(TAny*, TAny*) {}
|
williamr@2
|
159 |
TInt Width(TInt aNum) const;
|
williamr@2
|
160 |
TInt Height(TInt aNum) const;
|
williamr@2
|
161 |
CFontBitmap* FontBitmap() const;
|
williamr@2
|
162 |
void InstallOpenFontShaper(COpenFont* aOpenFont, CShaper::TInput& aShaperInput);
|
williamr@2
|
163 |
|
williamr@2
|
164 |
private:
|
williamr@2
|
165 |
TFontSpec iFontSpecInTwips;
|
williamr@2
|
166 |
|
williamr@2
|
167 |
public:
|
williamr@2
|
168 |
/** The algorithmic font style. */
|
williamr@2
|
169 |
TAlgStyle iAlgStyle; // must not move this member
|
williamr@2
|
170 |
|
williamr@2
|
171 |
private:
|
williamr@2
|
172 |
// Binary Compatibility warning - data member iOpenFont is referenced by inline methods
|
williamr@2
|
173 |
RHeap* iHeap;
|
williamr@2
|
174 |
TInt iFontBitmapOffset;
|
williamr@2
|
175 |
COpenFont* iOpenFont; // if iOpenFont is non-null this is an open font and many functions are forwarded to it
|
williamr@2
|
176 |
|
williamr@2
|
177 |
#ifdef SYMBIAN_SUPPORT_LINKED_FONTS
|
williamr@2
|
178 |
CLinkedFontInformation *iFontLinkage;
|
williamr@2
|
179 |
#endif
|
williamr@2
|
180 |
};
|
williamr@2
|
181 |
|
williamr@2
|
182 |
class CFontStore : public CTypefaceStore
|
williamr@2
|
183 |
/**
|
williamr@2
|
184 |
A store for fonts.
|
williamr@2
|
185 |
|
williamr@2
|
186 |
Stores and handles both open and fixed-size fonts. Open fonts are made from
|
williamr@2
|
187 |
open (scalable) typefaces by Open Font plug-in rasterizers. Fonts of other
|
williamr@2
|
188 |
typefaces are stored in a limited number of fixed sizes. However, which is
|
williamr@2
|
189 |
being used is transparent to the user of this class. For example the GetNearestFont...()
|
williamr@2
|
190 |
functions get a bitmap font which may be retrieved from memory or generated
|
williamr@2
|
191 |
via a rasterizer.
|
williamr@2
|
192 |
@publishedAll
|
williamr@2
|
193 |
@released
|
williamr@2
|
194 |
*/
|
williamr@2
|
195 |
{
|
williamr@2
|
196 |
#ifdef SYMBIAN_SUPPORT_LINKED_FONTS
|
williamr@2
|
197 |
friend class CLinkedFonts;
|
williamr@2
|
198 |
friend class CLinkedFontSpecification;
|
williamr@2
|
199 |
friend class CLinkedTypefaceSpecification;
|
williamr@2
|
200 |
#endif
|
williamr@2
|
201 |
|
williamr@2
|
202 |
public:
|
williamr@2
|
203 |
IMPORT_C static CFontStore* NewL(RHeap* aHeap);
|
williamr@2
|
204 |
IMPORT_C ~CFontStore();
|
williamr@2
|
205 |
IMPORT_C TUid AddFileL(const TDesC& aName);
|
williamr@2
|
206 |
IMPORT_C void RemoveFile(TUid aFileUid);
|
williamr@2
|
207 |
IMPORT_C TInt GetNearestFontInTwips(CFont *&aFont, const TFontSpec& aFontSpec);
|
williamr@2
|
208 |
IMPORT_C TInt GetNearestFontInPixels(CFont *&aFont, const TFontSpec &aFontSpec);
|
williamr@2
|
209 |
IMPORT_C TInt GetNearestFontToDesignHeightInTwips(CFont *&aFont, const TFontSpec& aFontSpec);
|
williamr@2
|
210 |
IMPORT_C TInt GetNearestFontToDesignHeightInPixels(CFont *&aFont, const TFontSpec& aFontSpec);
|
williamr@2
|
211 |
IMPORT_C TInt GetNearestFontToMaxHeightInTwips(CFont*& aFont, const TFontSpec& aFontSpec, TInt aMaxHeight);
|
williamr@2
|
212 |
IMPORT_C TInt GetNearestFontToMaxHeightInPixels(CFont*& aFont, const TFontSpec& aFontSpec, TInt aMaxHeight);
|
williamr@2
|
213 |
IMPORT_C TInt GetNearestFontInTwips(CFont *&aFont, const TOpenFontSpec& aFontSpec);
|
williamr@2
|
214 |
IMPORT_C TInt GetNearestFontInPixels(CFont *&aFont, const TOpenFontSpec &aFontSpec);
|
williamr@2
|
215 |
IMPORT_C TInt GetNearestFontToDesignHeightInTwips(CFont *&aFont, const TOpenFontSpec& aFontSpec);
|
williamr@2
|
216 |
IMPORT_C TInt GetNearestFontToDesignHeightInPixels(CFont *&aFont, const TOpenFontSpec& aFontSpec);
|
williamr@2
|
217 |
IMPORT_C TInt GetNearestFontToMaxHeightInTwips(CFont*& aFont, const TOpenFontSpec& aFontSpec, TInt aMaxHeight);
|
williamr@2
|
218 |
IMPORT_C TInt GetNearestFontToMaxHeightInPixels(CFont*& aFont, const TOpenFontSpec& aFontSpec, TInt aMaxHeight);
|
williamr@2
|
219 |
IMPORT_C TInt GetFontById(CFont *&aFont,TUid aUid,const TAlgStyle& aAlgStyle);
|
williamr@2
|
220 |
IMPORT_C TInt NumTypefaces() const;
|
williamr@2
|
221 |
IMPORT_C void TypefaceSupport(TTypefaceSupport &aTypefaceSupport,TInt aTypefaceIndex) const;
|
williamr@2
|
222 |
IMPORT_C TInt FontHeightInTwips(TInt aTypefaceIndex,TInt aHeightIndex) const;
|
williamr@2
|
223 |
IMPORT_C TInt FontHeightInPixels(TInt aTypefaceIndex,TInt aHeightIndex) const;
|
williamr@2
|
224 |
IMPORT_C void InstallRasterizerL(COpenFontRasterizer* aRasterizer);
|
williamr@2
|
225 |
IMPORT_C void DeleteSessionCache(TInt aSessionHandle);
|
williamr@2
|
226 |
inline TGlyphBitmapType DefaultBitmapType() const;
|
williamr@2
|
227 |
inline void SetDefaultBitmapType(TGlyphBitmapType aType);
|
williamr@2
|
228 |
IMPORT_C void InstallShaperFactoryL(CShaperFactory* aShaperFactory);
|
williamr@2
|
229 |
const CArrayPtrFlat<CShaperFactory>* ShaperFactoryList() const;
|
williamr@2
|
230 |
COpenFontSessionCacheList* GetSessionCacheList();
|
williamr@2
|
231 |
TInt GetShaperCacheMemUsage();
|
williamr@2
|
232 |
void SetShaperCacheMemUsage(TInt aUsage);
|
williamr@2
|
233 |
CArrayPtrFlat<COpenFontFile>* GetOpenFontFileList();
|
williamr@2
|
234 |
void IncNumShaperCaches();
|
williamr@2
|
235 |
void DecNumShaperCaches();
|
williamr@2
|
236 |
TInt GetNumShaperCaches();
|
williamr@2
|
237 |
IMPORT_C TInt CreateLinkedTypeface(const TLinkedTypefaceSpecArgs &aLinkedTypefaceSpec, TInt aSession, TInt& aId);
|
williamr@2
|
238 |
IMPORT_C void RemoveLinkedFont(CBitmapFont *aFont);
|
williamr@2
|
239 |
IMPORT_C TBool IsValidLinkedFontSpecification(TInt aHandle);
|
williamr@2
|
240 |
IMPORT_C TBool HaveTypefaceFamilyName(const TDesC& aName);
|
williamr@2
|
241 |
private:
|
williamr@2
|
242 |
CFontStore(RHeap* aHeap);
|
williamr@2
|
243 |
void ConstructL();
|
williamr@2
|
244 |
void InternalizeFontStoreFileL(CFontStoreFile* aFontStoreFile, TInt aFontVersion);
|
williamr@2
|
245 |
TTypeface* GetNearestTypeface(const TTypeface& aTypeface) const;
|
williamr@2
|
246 |
TTypefaceFontBitmap GetNearestTypefaceFontBitmap(const TFontSpec& aFontSpecInPixels, TInt aMaxHeight);
|
williamr@2
|
247 |
CFontBitmap* GetFontBitmapById(TUid aUid);
|
williamr@2
|
248 |
TBool IsFontLoaded(CFont*& aFont, const TAlgStyle& aAlgStyle, const TFontSpec& aFontSpecInPixels, TUid aUid, TInt aMaxHeight = 0) const;
|
williamr@2
|
249 |
TBool IsFontLoaded(CFont*& aFont, const TAlgStyle& aAlgStyle, const TOpenFontSpec& aFontSpecInPixels, TInt aMaxHeight) const;
|
williamr@2
|
250 |
CBitmapFont* NewFontL(const TFontSpec& aFontSpecInTwips,const TAlgStyle& aAlgStyle,CFontBitmap* aFontBitmap);
|
williamr@2
|
251 |
CBitmapFont* NewFontL(const TOpenFontSpec& aFontSpecInTwips,const TAlgStyle& aAlgStyle,COpenFont* aOpenFont);
|
williamr@2
|
252 |
TInt VerticalPixelsToTwips(TInt aPixelHeight) const;
|
williamr@2
|
253 |
TInt VerticalTwipsToPixels(TInt aTwipsHeight) const;
|
williamr@2
|
254 |
void GetNearestBitmapFontInPixelsL(CFont*& aFont, TFontSpec& aFontSpec, TInt aMaxHeight);
|
williamr@2
|
255 |
void GetNearestOpenFontInPixelsL(
|
williamr@2
|
256 |
CFont*& aFont, TOpenFontSpec& aActualFontSpec, const TOpenFontSpec& aDesiredFontSpec, TInt aMaxHeight);
|
williamr@2
|
257 |
#ifdef SYMBIAN_SUPPORT_LINKED_FONTS
|
williamr@2
|
258 |
TInt GetNearestRealFontInPixels(CFont*& aFont, const TOpenFontSpec& aFontSpec, TInt aMaxHeight);
|
williamr@2
|
259 |
TInt GetNearestFontInPixelsL(CFont*& aFont, const TOpenFontSpec& aFontSpec, TInt aMaxHeight);
|
williamr@2
|
260 |
TInt CreateLinkedTypefaceL(const TLinkedTypefaceSpecArgs &aLinkedTypefaceSpec, TInt aSession, TInt& aId);
|
williamr@2
|
261 |
TInt GetCanonicalIndex(TInt aTypefaceIndex) const;
|
williamr@2
|
262 |
void TypefaceSupportLinked(TTypefaceSupport &aTypefaceSupport, TInt aTypefaceIndex) const;
|
williamr@2
|
263 |
#endif
|
williamr@2
|
264 |
TInt GetNearestFontInPixels(CFont*& aFont, const TOpenFontSpec& aFontSpec, TInt aMaxHeight);
|
williamr@2
|
265 |
void SanityCheckForTtfL(RFile& aFile, TUint aFontFileSize, TBool aStrictChecking);
|
williamr@2
|
266 |
void SanityCheckFontFileL(TParse& aParse);
|
williamr@2
|
267 |
TInt GetNearestOpenFontInPixelsByFontName(COpenFont*& aNearestOpenFont, TOpenFontSpec& aActualFontSpec, const TOpenFontSpec& aDesiredFontSpec, TInt aMaxHeight);
|
williamr@2
|
268 |
TInt GetNearestOpenFontInPixelsBySimilarity(COpenFont*& aNearestOpenFont, TOpenFontSpec& aActualFontSpec, const TOpenFontSpec& aDesiredFontSpec, TInt aMaxHeight);
|
williamr@2
|
269 |
TInt AddTypefacesToSupportList(COpenFontFile* aOpenFontFile);
|
williamr@2
|
270 |
void RemoveTypefacesFromSupportList(COpenFontFile* aOpenFontFile);
|
williamr@2
|
271 |
TInt FindBitmapFontFileIndexByUid(TUid aUid);
|
williamr@2
|
272 |
TBool IncRefCountOfLoadedFont(const TDesC& aFullName, TUid& aFontUid);
|
williamr@2
|
273 |
TBool LoadFileAsOpenFontL(const TDesC& aFullName, TUid& aFontUid);
|
williamr@2
|
274 |
TUid LoadFileAsBitmapFontL(TParse& aParse);
|
williamr@2
|
275 |
static void CleanupRemoveFontFile(TAny* aCleanupInfo);
|
williamr@2
|
276 |
|
williamr@2
|
277 |
public:
|
williamr@2
|
278 |
/** The width of 1000 pixels in twips.
|
williamr@2
|
279 |
|
williamr@2
|
280 |
This is set in the constructor. If the appropriate HALData attributes are
|
williamr@2
|
281 |
set (EDisplayXPixels and EDisplayXTwips) then the value is calculated using
|
williamr@2
|
282 |
these; otherwise the value is set to 11860. */
|
williamr@2
|
283 |
TInt iKPixelWidthInTwips;
|
williamr@2
|
284 |
|
williamr@2
|
285 |
/** The height of 1000 pixels in twips.
|
williamr@2
|
286 |
|
williamr@2
|
287 |
This is set in the constructor. If the appropriate HALData attributes are
|
williamr@2
|
288 |
set (EDisplayYPixels and EDisplayYTwips) then the value is calculated using
|
williamr@2
|
289 |
these; otherwise the value is set to 11860. */
|
williamr@2
|
290 |
TInt iKPixelHeightInTwips;
|
williamr@2
|
291 |
|
williamr@2
|
292 |
private:
|
williamr@2
|
293 |
// Binary Compatibility warning - data member iDefaultBitmapType is referenced by inline methods
|
williamr@2
|
294 |
RFs iFs;
|
williamr@2
|
295 |
RHeap* iHeap;
|
williamr@2
|
296 |
CArrayPtrFlat<CFontStoreFile> iFontStoreFileList;
|
williamr@2
|
297 |
CArrayPtrFlat<TTypeface> iTypefaceList;
|
williamr@2
|
298 |
CArrayPtrFlat<CFontBitmap> iFontBitmapList;
|
williamr@2
|
299 |
CArrayFixFlat<TTypefaceFontBitmap> iTypefaceFontBitmapList;
|
williamr@2
|
300 |
CArrayPtrFlat<COpenFontFile> iOpenFontFileList;
|
williamr@2
|
301 |
TInt iReserved[6]; // keep iDefaultBitmapType at the correct offset
|
williamr@2
|
302 |
CArrayPtrFlat<COpenFontRasterizer> iOpenFontRasterizerList;
|
williamr@2
|
303 |
COpenFontSessionCacheList* iOpenFontSessionCacheList;
|
williamr@2
|
304 |
TInt iOpenFontUid;
|
williamr@2
|
305 |
TGlyphBitmapType iDefaultBitmapType;
|
williamr@2
|
306 |
CArrayPtrFlat<CShaperFactory> iShaperFactoryList;
|
williamr@2
|
307 |
TInt iOpenFontShaperCacheMemUsage;
|
williamr@2
|
308 |
TInt iNumberOfShaperCaches;
|
williamr@2
|
309 |
RPointerArray<CTypefaceSupportInfo> iOpenFontTypefaceSupportList;
|
williamr@2
|
310 |
#ifdef SYMBIAN_SUPPORT_LINKED_FONTS
|
williamr@2
|
311 |
RPointerArray<CLinkedTypefaceSpecification> *iLinkedTypefaceSpecificationList;
|
williamr@2
|
312 |
RPointerArray<CLinkedFontSpecification> *iLinkedFontSpecificationList;
|
williamr@2
|
313 |
#endif
|
williamr@2
|
314 |
};
|
williamr@2
|
315 |
|
williamr@2
|
316 |
// inline functions start here
|
williamr@2
|
317 |
|
williamr@2
|
318 |
/** Returns whether the bitmap font object is an open font (a COpenFont) rather
|
williamr@2
|
319 |
than a bitmap font (a CFontBitmap).
|
williamr@2
|
320 |
|
williamr@2
|
321 |
@return ETrue if the bitmap font object is using an open font (a COpenFont);
|
williamr@2
|
322 |
EFalse if it is using a bitmap font (a CFontBitmap).
|
williamr@2
|
323 |
@see OpenFont()
|
williamr@2
|
324 |
*/
|
williamr@2
|
325 |
inline TBool CBitmapFont::IsOpenFont() const
|
williamr@2
|
326 |
{
|
williamr@2
|
327 |
return iOpenFont != NULL;
|
williamr@2
|
328 |
}
|
williamr@2
|
329 |
|
williamr@2
|
330 |
/** Returns a pointer to the open font being used by the bitmap font object.
|
williamr@2
|
331 |
|
williamr@2
|
332 |
@return A pointer to an open font.
|
williamr@2
|
333 |
@see IsOpenFont()
|
williamr@2
|
334 |
*/
|
williamr@2
|
335 |
inline COpenFont* CBitmapFont::OpenFont() const
|
williamr@2
|
336 |
{
|
williamr@2
|
337 |
return iOpenFont;
|
williamr@2
|
338 |
}
|
williamr@2
|
339 |
|
williamr@2
|
340 |
/** Gets the anti-aliasing setting for the font, see TGlyphBitmapType for
|
williamr@2
|
341 |
the range of values.
|
williamr@2
|
342 |
|
williamr@2
|
343 |
This is only applicable to open fonts (COpenFonts) not bitmap fonts (CBitmapFonts).
|
williamr@2
|
344 |
|
williamr@2
|
345 |
Note that this setting is stored in the device-independent font specification
|
williamr@2
|
346 |
which is set when the bitmap font object is constructed.
|
williamr@2
|
347 |
|
williamr@2
|
348 |
@return The anti-aliasing setting for the font.
|
williamr@2
|
349 |
@see IsOpenFont()
|
williamr@2
|
350 |
@see TGlyphBitmapType
|
williamr@2
|
351 |
@see COpenFont
|
williamr@2
|
352 |
@see CBitmapFont
|
williamr@2
|
353 |
*/
|
williamr@2
|
354 |
inline TGlyphBitmapType CBitmapFont::GlyphBitmapType() const
|
williamr@2
|
355 |
{
|
williamr@2
|
356 |
return iFontSpecInTwips.iFontStyle.BitmapType();
|
williamr@2
|
357 |
}
|
williamr@2
|
358 |
|
williamr@2
|
359 |
/** Returns a default bitmap type.
|
williamr@2
|
360 |
|
williamr@2
|
361 |
@return A default bitmap type.
|
williamr@2
|
362 |
@see TGlyphBitmapType
|
williamr@2
|
363 |
*/
|
williamr@2
|
364 |
inline TGlyphBitmapType CFontStore::DefaultBitmapType() const
|
williamr@2
|
365 |
{
|
williamr@2
|
366 |
return iDefaultBitmapType;
|
williamr@2
|
367 |
}
|
williamr@2
|
368 |
|
williamr@2
|
369 |
/** Sets a default bitmap type.
|
williamr@2
|
370 |
|
williamr@2
|
371 |
@param aType A default bitmap type.
|
williamr@2
|
372 |
@see TGlyphBitmapType
|
williamr@2
|
373 |
*/
|
williamr@2
|
374 |
inline void CFontStore::SetDefaultBitmapType(TGlyphBitmapType aType)
|
williamr@2
|
375 |
{
|
williamr@2
|
376 |
iDefaultBitmapType = aType;
|
williamr@2
|
377 |
}
|
williamr@2
|
378 |
|
williamr@2
|
379 |
#endif
|