os/textandloc/fontservices/textbase/inc/textbase.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/textandloc/fontservices/textbase/inc/textbase.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,1180 @@
     1.4 +// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// This file is a subset of original gdi.h.
    1.18 +//
    1.19 +// IMPORTANT NOTE to maintainer:
    1.20 +//     If you add new exports, to make sure they are exported by GDI.DLL,
    1.21 +//     remember to update /graphics/graphicsdeviceinterface/gdi/sgdi/TextBaseStub.cpp.
    1.22 +//
    1.23 +// Text related types/consts are moved from gdi.h to this file, as listed below.
    1.24 +//
    1.25 +// enum TFontPosture
    1.26 +// enum TFontStrokeWeight
    1.27 +// enum TFontPrintPosition
    1.28 +//
    1.29 +// const KMaxTypefaceNameLength
    1.30 +// class TTypeface
    1.31 +// enum TGlyphBitmapType
    1.32 +// class FontEffect
    1.33 +// class TFontStyle
    1.34 +// class TFontSpec
    1.35 +// class TTypefaceSupport
    1.36 +// const KSuperSubScalingPercentage
    1.37 +// const KSuperscriptOffsetPercentage
    1.38 +// const KSubscriptOffsetPercentage
    1.39 +// class CTypefaceStore
    1.40 +// const KMaxFontCacheEntries
    1.41 +// class CFontCache
    1.42 +//
    1.43 +// const KFontCapitalAscent
    1.44 +// const KFontMaxAscent
    1.45 +// const KFontStandardDescent
    1.46 +// const KFontMaxDescent
    1.47 +// const KFontLineGap
    1.48 +// const KFontGetFontTable
    1.49 +// const KFontGetGlyphOutline
    1.50 +// const KFontReleaseGlyphOutline
    1.51 +// const KFontReleaseFontTable
    1.52 +// class CFont
    1.53 +
    1.54 +
    1.55 +#ifndef __TEXTBASE_H__
    1.56 +#define __TEXTBASE_H__
    1.57 +
    1.58 +#include <e32base.h>
    1.59 +#include <f32file.h>
    1.60 +#include <s32std.h>
    1.61 +
    1.62 +class TOpenFontCharMetrics;
    1.63 +class RShapeInfo;
    1.64 +
    1.65 +
    1.66 +#ifndef __GLYPHSEL_TEXTBASE_H__
    1.67 +#define __GLYPHSEL_TEXTBASE_H__
    1.68 +/**
    1.69 +This enumeration holds the possible panic codes that may be raised 
    1.70 +by the TextBase API on detecting an unrecoverable error. */
    1.71 +enum TTextBasePanic
    1.72 +	{
    1.73 +	/** Not used */
    1.74 +	ETextBasePanic_Unknown				= 0,
    1.75 +	/** One or more of the input parameters to the interface were invalid */
    1.76 +	ETextBasePanic_InvalidInputParam		= 1,
    1.77 +	/** Insufficient text for successful completion of the method */
    1.78 +	ETextBasePanic_OutOfText				= 2,
    1.79 +	/** Internal failure. */
    1.80 +	ETextBasePanic_Invariant				= 3,
    1.81 +	/** Reserved panic codes. Not to be used. */
    1.82 +	ETextBasePanic_Reserved1				= 4,
    1.83 +	ETextBasePanic_Reserved2				= 5,
    1.84 +	/** Setting a typeface name that is too long */
    1.85 +	ETextBasePanic_TypefaceNameOverflow	= 6,
    1.86 +	};
    1.87 +#endif
    1.88 +
    1.89 +
    1.90 +/**
    1.91 +Font posture flags.
    1.92 +Fonts can be either upright or italic. 
    1.93 +@publishedAll	
    1.94 +@released
    1.95 +*/
    1.96 +enum TFontPosture
    1.97 +	{
    1.98 +	/** Font posture is normal (upright). */
    1.99 +	EPostureUpright,
   1.100 +	/** Font posture is italic. */
   1.101 +	EPostureItalic
   1.102 +	};
   1.103 +
   1.104 +
   1.105 +/**
   1.106 +Font stroke weight flags. 
   1.107 +@publishedAll	
   1.108 +@released
   1.109 +*/
   1.110 +enum TFontStrokeWeight
   1.111 +	{
   1.112 +	/** Font stroke weight is normal. */
   1.113 +	EStrokeWeightNormal,
   1.114 +	/** Font stroke weight is bold. */
   1.115 +	EStrokeWeightBold
   1.116 +	};
   1.117 +
   1.118 +/**
   1.119 +Font print position flags.
   1.120 +Fonts can be normal, superscript or subscript. 
   1.121 +@publishedAll	
   1.122 +@released
   1.123 +*/
   1.124 +enum TFontPrintPosition
   1.125 +	{
   1.126 +	/** Font is normal. */
   1.127 +	EPrintPosNormal,
   1.128 +	/** Font is superscript. */
   1.129 +	EPrintPosSuperscript,
   1.130 +	/** Font is subscript. */
   1.131 +	EPrintPosSubscript
   1.132 +	};
   1.133 +
   1.134 +
   1.135 +/**
   1.136 +The maximum length of a typeface name (in characters). 
   1.137 +@publishedAll	
   1.138 +@released
   1.139 +*/
   1.140 +const TInt KMaxTypefaceNameLength=0x18;
   1.141 +
   1.142 +
   1.143 +/** Typeface name and attributes.
   1.144 +
   1.145 +This class identifies a typeface by name, and contains the combination of 
   1.146 +attributes of the typeface. These attributes define whether it is a symbol 
   1.147 +typeface, whether the typeface is proportional, and whether it is serif or 
   1.148 +sans-serif. 
   1.149 +
   1.150 +The combination of attributes for a typeface are stored in a bitmask, with 
   1.151 +the various bits indicating different attributes. The bitmask is calculated 
   1.152 +for any particular attribute combination by ORing the enumerated value for 
   1.153 +each individual attribute. 
   1.154 +@publishedAll 
   1.155 +@released
   1.156 +*/
   1.157 +class TTypeface
   1.158 +    {
   1.159 +public:
   1.160 +	enum
   1.161 +		{
   1.162 +		/** Typeface is a proportional typeface (e.g. Swiss)
   1.163 +		*/
   1.164 +		EProportional = 1,
   1.165 +		/** Typeface is a serif typeface (e.g. Times)
   1.166 +		*/
   1.167 +		ESerif = 2,
   1.168 +		/** Typeface is a symbol typeface (e.g. Symbol)
   1.169 +		*/
   1.170 +		ESymbol = 4,
   1.171 +		};
   1.172 +public:
   1.173 +	IMPORT_C TTypeface();
   1.174 +	IMPORT_C TBool operator==(const TTypeface& aTypeface) const;
   1.175 +	IMPORT_C void InternalizeL(RReadStream& aStream);
   1.176 +	IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
   1.177 +	IMPORT_C void SetAttributes(TInt aAttributes);
   1.178 +	IMPORT_C void SetIsProportional(TBool aIsProportional);
   1.179 +	IMPORT_C void SetIsSerif(TBool aIsSerif);
   1.180 +	IMPORT_C void SetIsSymbol(TBool aIsSymbol);
   1.181 +	IMPORT_C TInt Attributes() const;
   1.182 +	IMPORT_C TBool IsProportional() const;
   1.183 +	IMPORT_C TBool IsSerif() const;
   1.184 +	IMPORT_C TBool IsSymbol() const;
   1.185 +	IMPORT_C void SetScriptTypeForMetrics(TLanguage aLanguage);
   1.186 +	IMPORT_C void SetScriptTypeForMetrics(TInt aScript);
   1.187 +	IMPORT_C TInt ScriptTypeForMetrics() const;
   1.188 +	IMPORT_C void SetName(const TDesC& aName);
   1.189 +	IMPORT_C const TDesC& Name() const;
   1.190 +private:
   1.191 +	void ResetAttributes();
   1.192 +	void ResetScriptType();
   1.193 +public:
   1.194 +	/** The typeface name. */
   1.195 +    TBufC<KMaxTypefaceNameLength> iName;
   1.196 +private:
   1.197 +    TUint32 iFlags;
   1.198 +    };
   1.199 +
   1.200 +
   1.201 +/**
   1.202 +An enumerated type for the format of a glyph bitmap. This type is currently 
   1.203 +used to indicate whether glyph bitmaps for scalable fonts are drawn anti-aliased. 
   1.204 +Additional values may be defined in the future.
   1.205 +
   1.206 +@see TFontStyle::SetBitmapType()
   1.207 +@see CFbsTypefaceStore::SetDefaultBitmapType() 
   1.208 +@publishedAll
   1.209 +@released	
   1.210 +*/
   1.211 +enum TGlyphBitmapType
   1.212 +	{
   1.213 +	/** The font store's default glyph bitmap format is used. */
   1.214 +	EDefaultGlyphBitmap = 0,
   1.215 +	/** The standard monochrome format: no anti-aliasing, 1 bit per pixel, 
   1.216 +	run-length encoded. */
   1.217 +	EMonochromeGlyphBitmap,
   1.218 +	/** Standard 8-bits-per-pixel with anti-aliasing. */
   1.219 +	EAntiAliasedGlyphBitmap,
   1.220 +	/** The format used when sub-pixel font rendering is used. */
   1.221 +	ESubPixelGlyphBitmap,
   1.222 +	/** The format used when outline and shadow font rendering is used. 
   1.223 +
   1.224 +	If the raterizer supports the outline and shadow fonts, it will set the bitmaptype as 
   1.225 +	EFourColourBlendGlyphBitmap but only when glyph bitmap type is set as EAntiAliasedGlyphBitmap and 
   1.226 +	when any of the EDropShadow or EOutline effect is on. Only rasterizer providers can use this enum.
   1.227 +	*/
   1.228 +	EFourColourBlendGlyphBitmap,
   1.229 +	/**
   1.230 +	This is used for glyphs, and not fonts, and is needed to inform the font drawing routines
   1.231 +	that the character should be drawn using the overall font setting. 
   1.232 +	For Internal Use Only.
   1.233 +	*/
   1.234 +	EGlyphBitmapTypeNotDefined,
   1.235 +	/**
   1.236 +	This is used to inform the rasterizer that the best match should be
   1.237 +	found for the bitmap type based upon its knowledge.
   1.238 +	For Internal Use Only.
   1.239 +	*/
   1.240 +	EAntiAliasedOrMonochromeGlyphBitmap,
   1.241 +	};
   1.242 +
   1.243 +/**
   1.244 +Defines a set of font effects flags.
   1.245 +
   1.246 +@publishedAll 
   1.247 +@released
   1.248 +WARNING: This Class is for use by system/UI software ONLY.
   1.249 +*/
   1.250 +NONSHARABLE_CLASS(FontEffect)
   1.251 +	{
   1.252 +public:
   1.253 +	enum TEffect
   1.254 +		{
   1.255 +		ENone			= 0x0,		// No effects.
   1.256 +		EAlgorithmicBold= 0x10,		// Font is algorithmic bold (a.k.a pseudo bold.)
   1.257 +		EDropShadow		= 0x20,		// Font has a drop shadow.
   1.258 +		EOutline		= 0x40,		// Font is an outline font.
   1.259 +		EEmbossed		= 0x80,		// Font is embossed.
   1.260 +		EEngraved		= 0x100,	// Font is engraved.
   1.261 +		ESoftEdge		= 0x200,	// Font is soft edged.
   1.262 +		EReserved1		= 0x400,	// Reserved for Symbian use.
   1.263 +		EReserved2		= 0x800,	// Reserved for Symbian use.
   1.264 +		EReserved3		= 0x1000,	// Reserved for Symbian use.
   1.265 +		EReserved4		= 0x2000,	// Reserved for Symbian use.
   1.266 +		EReserved5		= 0x4000,	// Reserved for Symbian use.
   1.267 +		EReserved6		= 0x8000,	// Reserved for Symbian use.
   1.268 +		};
   1.269 +public:
   1.270 +	IMPORT_C static TBool IsEffectOn(TEffect aEffect, TUint32 aFontEffect);
   1.271 +	IMPORT_C static void SetEffect(TEffect aEffect, TBool aOn, TUint32& aFontEffect);
   1.272 +	};
   1.273 +
   1.274 +/** Encapsulates a font style. 
   1.275 +
   1.276 +The font style information is comprised of:
   1.277 +
   1.278 +the posture of the font upright or italic
   1.279 +
   1.280 +the stroke weight of the font  normal or bold
   1.281 +
   1.282 +the print position of the font normal, subscript or superscript
   1.283 +
   1.284 +Note that the underline and strike-through attributes are not included in 
   1.285 +this class, but are set in the graphics context.
   1.286 +
   1.287 +@see CGraphicsContext::SetUnderlineStyle()
   1.288 +@see CGraphicsContext::SetStrikethroughStyle() 
   1.289 +@publishedAll
   1.290 +@released
   1.291 +*/
   1.292 +class TFontStyle
   1.293 +	{
   1.294 +public:
   1.295 +	IMPORT_C TFontStyle();
   1.296 +	IMPORT_C TFontStyle(TFontPosture aPost,TFontStrokeWeight aStrWgt,TFontPrintPosition aPrintPos);
   1.297 +	IMPORT_C void InternalizeL(RReadStream& aStream);
   1.298 +	IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
   1.299 +	IMPORT_C TFontPosture Posture() const;
   1.300 +	IMPORT_C TFontStrokeWeight StrokeWeight() const;
   1.301 +	IMPORT_C TFontPrintPosition PrintPosition() const;
   1.302 +	IMPORT_C void SetPosture(TFontPosture aPosture);
   1.303 +	IMPORT_C void SetStrokeWeight(TFontStrokeWeight aStrokeWeight);
   1.304 +	IMPORT_C void SetPrintPosition(TFontPrintPosition aPrintPosition);
   1.305 +	inline TGlyphBitmapType BitmapType() const;
   1.306 +	inline void SetBitmapType(TGlyphBitmapType aBitmapType);
   1.307 +	IMPORT_C TBool operator==(const TFontStyle& aFontStyle) const;
   1.308 +	IMPORT_C TUint32 Effects() const;
   1.309 +	IMPORT_C TBool IsEffectOn(FontEffect::TEffect aEffect) const;
   1.310 +	IMPORT_C void SetEffects(TUint32 aEffects);
   1.311 +	IMPORT_C void SetEffects(FontEffect::TEffect aEffect, TBool aOn);
   1.312 +private:
   1.313 +	enum
   1.314 +		{
   1.315 +		EItalic=0x1,
   1.316 +		EBold=0x2,
   1.317 +		ESuper=0x4,
   1.318 +		ESub=0x8
   1.319 +		};
   1.320 +private:
   1.321 +	TUint32 iFlags; // bitmap type - 16 bits (high), font effects - 12 bits (middle), style - 4 bits (low)
   1.322 +	TAny* iReserved1;
   1.323 +	TAny* iReserved2;
   1.324 +	};
   1.325 +
   1.326 +
   1.327 +
   1.328 +/**
   1.329 +Specifies the font specification in device independent terms.
   1.330 +@publishedAll 
   1.331 +@released
   1.332 +*/
   1.333 +class TFontSpec
   1.334 +	{
   1.335 +public:
   1.336 +	IMPORT_C TFontSpec();
   1.337 +	IMPORT_C TFontSpec(const TDesC& aTypefaceName,TInt aHeight);
   1.338 +	IMPORT_C TBool operator==(const TFontSpec& aFontSpec) const;
   1.339 +	IMPORT_C void InternalizeL(RReadStream& aStream);
   1.340 +	IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
   1.341 +	IMPORT_C void SetScriptTypeForMetrics(TLanguage aLanguage);
   1.342 +	IMPORT_C TInt ScriptTypeForMetrics() const;
   1.343 +public:
   1.344 +	/** The typeface. */
   1.345 +	TTypeface iTypeface;
   1.346 +	/** The height of the typeface (in twips). */
   1.347 +	TInt iHeight;
   1.348 +	/** The font style of the typeface. */
   1.349 +	TFontStyle iFontStyle;
   1.350 +	};
   1.351 +
   1.352 +
   1.353 +
   1.354 +/** Typeface family support information.
   1.355 +
   1.356 +This data-only class includes the name and attributes of a typeface, how many 
   1.357 +font heights are available, its minimum and maximum heights, and whether or 
   1.358 +not it is scaleable  a typeface is scaleable if it supports heights at 
   1.359 +fixed intervals between the minimum and maximum heights. 
   1.360 +@publishedAll 
   1.361 +@released
   1.362 +*/
   1.363 +class TTypefaceSupport
   1.364 +    {
   1.365 +public:
   1.366 +	/** The name and attributes of the typeface. */
   1.367 +    TTypeface iTypeface;
   1.368 +	/** The number of distinct font heights available in the typeface. */
   1.369 +    TInt iNumHeights;
   1.370 +	/** The typeface's minimum font height, in twips. */
   1.371 +    TInt iMinHeightInTwips;
   1.372 +	/** The typeface's maximum font height, in twips. */
   1.373 +    TInt iMaxHeightInTwips;
   1.374 +	/** Whether the typeface is scaleable. ETrue if it is scaleable, otherwise 
   1.375 +	EFalse. */
   1.376 +    TBool iIsScalable; // supports heights from min to max at fixed interval
   1.377 +    };
   1.378 +
   1.379 +/**
   1.380 +The percentage used to multiply a normal font height when calculating its 
   1.381 +superscript or subscript height. 
   1.382 +@publishedAll	
   1.383 +@released
   1.384 +*/
   1.385 +const TInt KSuperSubScalingPercentage=67;
   1.386 +
   1.387 +/**
   1.388 +The percentage of a font height used to calculate its baseline offset for a 
   1.389 +superscript print position. 
   1.390 +@publishedAll	
   1.391 +@released
   1.392 +*/
   1.393 +const TInt KSuperscriptOffsetPercentage=-28;
   1.394 +
   1.395 +/**
   1.396 +The percentage of a font height used to calculate its baseline offset for a 
   1.397 +subscript print position. 
   1.398 +@publishedAll	
   1.399 +@released
   1.400 +*/
   1.401 +const TInt KSubscriptOffsetPercentage=14;
   1.402 +
   1.403 +class CFont;
   1.404 +
   1.405 +/** Typeface store abstract base interface.
   1.406 +
   1.407 +This class provides the interface to a store for typefaces.
   1.408 +
   1.409 +See also CFontStore. 
   1.410 +@publishedAll
   1.411 +@released
   1.412 +*/
   1.413 +class CTypefaceStore : public CBase
   1.414 +	{
   1.415 +public:
   1.416 +	IMPORT_C ~CTypefaceStore();
   1.417 +
   1.418 +	/**
   1.419 +	Gets the font which is the nearest to the given font specification.
   1.420 +
   1.421 +	When the font is no longer needed, call @c ReleaseFont().
   1.422 +
   1.423 +	Note that this deprecated function is replaced by the new @c GetNearestFontToDesignHeightInTwips() 
   1.424 +	yielding (virtually) the same result. However clients are strongly encouraged to use the new
   1.425 +	@c GetNearestFontToMaxHeightInTwips() function instead. This will guarantee that every 
   1.426 +	character within any given text string will fit within the given amount of twips, whereas the design 
   1.427 +	height is an aesthetic unit decided by the font designer without strict physical meaning, which 
   1.428 +	may result in cropped characters.
   1.429 +
   1.430 +	@param aFont On return, contains a pointer to the nearest font.
   1.431 +	@param aFontSpec The specification of the font to be matched.
   1.432 +	@return KErrNone if successful; a system-wide error code otherwise.
   1.433 +	@publishedAll
   1.434 +	@deprecated Use GetNearestFontToDesignHeightInTwips
   1.435 +	*/
   1.436 +	virtual TInt GetNearestFontInTwips(CFont*& aFont, const TFontSpec& aFontSpec) = 0;
   1.437 +
   1.438 +	/**
   1.439 +	Gets the font which is the nearest to the given font specification.
   1.440 +	
   1.441 +	When the font is no longer needed, call @c ReleaseFont().
   1.442 +
   1.443 +	This new function replaces the deprecated @c GetNearestFontInTwips() yielding (virtually) the 
   1.444 +	same result. However clients are strongly encouraged to use the new
   1.445 +	@c GetNearestFontToMaxHeightInTwips() function instead. This will guarantee that every 
   1.446 +	character within any given text string will fit within the given amount of twips, whereas the design 
   1.447 +	height is an aesthetic unit decided by the font designer without strict physical meaning, which 
   1.448 +	may result in cropped characters.
   1.449 +
   1.450 +	@param aFont On return, contains a pointer to the nearest font.
   1.451 +	@param aFontSpec The specification of the font to be matched.
   1.452 +	@return KErrNone if successful; a system-wide error code otherwise.
   1.453 +	@publishedAll
   1.454 +	@released
   1.455 +	*/
   1.456 +	virtual TInt GetNearestFontToDesignHeightInTwips(CFont*& aFont, const TFontSpec& aFontSpec) = 0;
   1.457 +	
   1.458 +	/**
   1.459 +	Gets the font which is the nearest to the given font specification.
   1.460 +	
   1.461 +	When the font is no longer needed, call @c ReleaseFont().
   1.462 +
   1.463 +	The font and bitmap server returns a pointer to the nearest matching font 
   1.464 +	from those available. Matches to max height of font - this does its best 
   1.465 +	to return a font that will fit within the maximum height specified (but 
   1.466 +	note that variations due to hinting algorithms may rarely result in this 
   1.467 +	height being exceeded by up to one pixel). Problems can also be 
   1.468 +	encountered with bitmap fonts where the typeface exists but doesn't have 
   1.469 +	a font small enough.
   1.470 +
   1.471 +	@param aFont On return, contains a pointer to the nearest font.
   1.472 +	@param aFontSpec The specification of the font to be matched.
   1.473 +	@param aMaxHeight The maximum height within which the font must fit.
   1.474 +	@return KErrNone if successful; a system-wide error code otherwise.
   1.475 +	@publishedAll
   1.476 +	@released
   1.477 +	*/
   1.478 +	virtual TInt GetNearestFontToMaxHeightInTwips(CFont*& aFont, const TFontSpec& aFontSpec, TInt aMaxHeight) = 0;
   1.479 +
   1.480 +	/** Gets the number of typefaces supported by the typeface store.
   1.481 +	
   1.482 +	@return The number of supported typefaces. */
   1.483 +	virtual TInt NumTypefaces() const=0;
   1.484 +
   1.485 +	/** Gets typeface information for a specified typeface index.
   1.486 + 
   1.487 + 	This information is returned in aTypefaceSupport, and
   1.488 +	includes the typeface name and typeface attributes, the number of font
   1.489 + 	heights, the maximum and minimum font heights, and whether it is a
   1.490 +	scaleable typeface.
   1.491 + 
   1.492 + 	@param aTypefaceSupport On return, if the function executed successfully, 
   1.493 + 	this object contains the typeface information.
   1.494 +  	@param aTypefaceIndex A typeface index number, in the range: zero to
   1.495 +             (NumTypefaces() - 1). */
   1.496 +	virtual void TypefaceSupport(TTypefaceSupport& aTypefaceSupport,TInt aTypefaceIndex) const=0;
   1.497 +
   1.498 +	/** Gets the height of the font with specified height and typeface indices, 
   1.499 +	in twips.
   1.500 +	
   1.501 +	The value returned is rounded up or down to the nearest font height in twips.
   1.502 +	
   1.503 +	@param aTypefaceIndex A typeface index number, in the range: 0 to 
   1.504 +	(NumTypefaces() - 1). 
   1.505 +	@param aHeightIndex A font height index number.
   1.506 +	@return The height of the font, in twips. */
   1.507 +	virtual TInt FontHeightInTwips(TInt aTypefaceIndex,TInt aHeightIndex) const=0;
   1.508 +	IMPORT_C void ReleaseFont(CFont* aFont);
   1.509 +	IMPORT_C static TInt BaselineOffset(TInt aHeight,TFontPrintPosition aPos);
   1.510 +	IMPORT_C static TInt SuperSubHeight(TInt aHeight,TFontPrintPosition aPos);
   1.511 +protected:
   1.512 +	IMPORT_C CTypefaceStore();
   1.513 +	IMPORT_C void ConstructL();
   1.514 +	IMPORT_C void AddFontL(CFont* aFont);
   1.515 +	IMPORT_C TBool IncrementFontCount(const CFont* aFont);
   1.516 +private:
   1.517 +	TBool FindFont(const CFont* aFont, TInt& aIdx) const;
   1.518 +	NONSHARABLE_CLASS(TFontAccess)
   1.519 +	/**
   1.520 +	Pairs a font with a count of how many clients of the typeface store 
   1.521 +	are accessing that font. 
   1.522 +    */
   1.523 +		{
   1.524 +	public:
   1.525 +		/** A device specific font. */
   1.526 +		CFont* iFont;
   1.527 +		/** The number of clients accessing the font. */
   1.528 +		TInt iAccessCount;
   1.529 +		};
   1.530 +protected:
   1.531 +	/** A list of fonts accessed by clients of the typeface store, which pairs 
   1.532 +	a font with a count of the number of clients accessing the font.
   1.533 +	
   1.534 +	Implemented as an array of TFontAccess objects.
   1.535 +	
   1.536 +	An object is added to this array for every font accessed. If the font is 
   1.537 +	released by all clients, and the access count drops to zero, the font is 
   1.538 +	removed from the list. */
   1.539 +	CArrayFixFlat<TFontAccess>* iFontAccess;
   1.540 +	};
   1.541 +
   1.542 +/** The maximum number of entries in the font cache.
   1.543 +
   1.544 +@see CFontCache */
   1.545 +const TInt KMaxFontCacheEntries=32;
   1.546 +
   1.547 +/** Font cache. 
   1.548 +
   1.549 +When a CFont* needs to be found for a particular TFontSpec, the cache can 
   1.550 +be searched to see if the TFontSpec is already in the cache. If the TFontSpec 
   1.551 +is in the cache, its corresponding CFont* can be returned. Otherwise 
   1.552 +GetNearestFontInTwips() must be used to search all of the available fonts for 
   1.553 +the nearest CFont- a procedure which takes much longer than a simple cache
   1.554 +search.
   1.555 +
   1.556 +The current font cache should be destroyed and a new cache created whenever 
   1.557 +the zoom factor or device map changes, as these changes break the relation 
   1.558 +between CFont and TFontSpec. 
   1.559 +@publishedAll
   1.560 +@released
   1.561 +*/
   1.562 +class CFontCache : public CBase
   1.563 +	{
   1.564 +public:
   1.565 +	IMPORT_C CFontCache();
   1.566 +	IMPORT_C CFontCache(TInt aMaxEntries);
   1.567 +	IMPORT_C ~CFontCache();
   1.568 +	IMPORT_C CFont* Search(const TFontSpec& aFontSpec);
   1.569 +	IMPORT_C CFont* AddEntryL(CFont* aFont,const TFontSpec& aFontSpec);
   1.570 +	IMPORT_C CFont* RemoveFirstEntry();
   1.571 +public:
   1.572 +	/** The number of cache hits since the font cache was created i.e. 
   1.573 +	successful results from CFontCache::Search(). */
   1.574 +	TInt iNumHits;
   1.575 +	/** The number of cache misses since the font cache was created i.e. 
   1.576 +	unsuccessful results from CFontCache::Search(). */
   1.577 +	TInt iNumMisses;
   1.578 +private:
   1.579 +	class CFontCacheEntry : public CBase
   1.580 +		{
   1.581 +	public:
   1.582 +		CFontCacheEntry(CFont* aFont,const TFontSpec& aFontSpec,CFontCacheEntry* aNext);
   1.583 +	public:
   1.584 +		CFont* iFont;
   1.585 +		TFontSpec iSpec;
   1.586 +		CFontCacheEntry* iNext;
   1.587 +		};
   1.588 +private:
   1.589 +	TInt iNumEntries;
   1.590 +	TInt iMaxEntries;
   1.591 +	CFontCacheEntry* iFirst;
   1.592 +	};
   1.593 +
   1.594 +/**
   1.595 +WARNING: this Class is for internal use ONLY.  Compatibility is not guaranteed in future releases.
   1.596 +UIDs corresponding to the CFont API extension functions
   1.597 +@internalTechnology
   1.598 +*/
   1.599 +const TUid KFontCapitalAscent	= {0x1020498E};
   1.600 +const TUid KFontMaxAscent		= {0x10204B10};
   1.601 +const TUid KFontStandardDescent	= {0x10204B11};
   1.602 +const TUid KFontMaxDescent		= {0x10205AFC};
   1.603 +const TUid KFontLineGap			= {0x10204B12};
   1.604 +const TUid KFontGetFontTable    = {0x102872C1};
   1.605 +const TUid KFontGetGlyphOutline = {0x102872C2};
   1.606 +const TUid KFontReleaseGlyphOutline = {0x2002A1FD};
   1.607 +const TUid KFontReleaseFontTable = {0x2002AC24};
   1.608 +
   1.609 +
   1.610 +/** Abstract font interface.
   1.611 +
   1.612 +The CFont class provides a device-independent interface to a device-dependent 
   1.613 +font usually obtained from a call to GetNearestFont...() on a graphics device. 
   1.614 +It is used as a handle in CGraphicsContext::UseFont() and to obtain 
   1.615 +device-dependent information about the font - notably the pixel width of a text 
   1.616 +string.
   1.617 +
   1.618 +@see CFbsFont
   1.619 +@see CGraphicsContext::UseFont() 
   1.620 +@publishedAll 
   1.621 +@released
   1.622 +*/
   1.623 +class CFont : public CBase
   1.624 +	{
   1.625 +	friend class CTypefaceStore;
   1.626 +public:
   1.627 +
   1.628 +	/** Text direction flags.
   1.629 +
   1.630 +	This enum is used in TMeasureTextInput and determines whether the text is 
   1.631 +	drawn horizontally or vertically. Note: text is drawn vertically in some 
   1.632 +	styles of Japanese, etc.
   1.633 +
   1.634 +	@see TMeasureTextInput */
   1.635 +	enum TTextDirection
   1.636 +		{
   1.637 +	/** Text is drawn horizontally. */
   1.638 + 		/** Text is drawn horizontally. */
   1.639 +   		EHorizontal,
   1.640 + 		/** Text is drawn vertically. */
   1.641 +		EVertical
   1.642 +		};
   1.643 +
   1.644 +	/** Complicated parameter block used for contextual glyph selection, 
   1.645 +	ligature creation and diacritic placement when drawing text in complex 
   1.646 +	scripts
   1.647 +
   1.648 +	This class declares a constructor, another scoped class, and several other 
   1.649 +	enums. However this class is unlikely to be useful to third party developers.
   1.650 +
   1.651 +	@see CFont::GetCharacterPosition()
   1.652 +	@see CFont::GetCharacterPosition2()
   1.653 +	@publishedAll
   1.654 +	@released
   1.655 +	*/
   1.656 +	class TPositionParam
   1.657 +		{
   1.658 +	public:
   1.659 +		/** Standard constructor. */
   1.660 +		TPositionParam():
   1.661 +			iDirection(EHorizontal),
   1.662 +			iFlags(0),
   1.663 +			iPosInText(0),
   1.664 +			iOutputGlyphs(0)
   1.665 +			{
   1.666 +			}
   1.667 +
   1.668 +		enum
   1.669 +			{
   1.670 +			EMaxInputChars = 18,	// ligatures cannot be made from more than 18 components
   1.671 +			EMaxOutputGlyphs = 8	// output can consist of up to 8 characters (one base and 7 combining characters)
   1.672 +			};
   1.673 +
   1.674 +		/**Flags for TPositionParam::iFlags. */
   1.675 +		enum TFlags
   1.676 +			{
   1.677 +			/** Input text is logically ordered not visually ordered. */
   1.678 +			EFLogicalOrder = 1
   1.679 +			};
   1.680 +
   1.681 +		/** Input: Orientation (EHorizontal or EVertical) in which to draw
   1.682 +		the text. */
   1.683 +		TInt16 iDirection;
   1.684 +		/** Input: Flags from TFlags. */
   1.685 +		TUint16 iFlags;
   1.686 +		/** Input: Text containing the characters to be positioned. */
   1.687 +		TPtrC iText;
   1.688 +
   1.689 +		/** Input and output: Position within iText to shape. On exit
   1.690 +		it will index the first character not positioned */
   1.691 +		TInt iPosInText;
   1.692 +		/** Input and output: Pen position. */
   1.693 +		TPoint iPen;			
   1.694 +
   1.695 +		/** Output of GetCharacterPosition and GetCharacterPosition2.
   1.696 +		@see CFont::GetCharacterPosition
   1.697 +		@see CFont::GetCharacterPosition2
   1.698 +		@publishedAll
   1.699 +		@released */
   1.700 +		class TOutput
   1.701 +			{
   1.702 +		public:
   1.703 +			/** Standard constructor. */
   1.704 +			TOutput() : iBitmapSize(TSize::EUninitialized),
   1.705 +				iBounds(TRect::EUninitialized) {}
   1.706 +			/** Character or glyph code. */
   1.707 +			TUint iCode;			
   1.708 +			/** Bitmap data for the glyph, if available */
   1.709 +			const TUint8* iBitmap;	
   1.710 +			/** Size of the bitmap before algorithmic bolding, size 
   1.711 +			multiplication, etc. */
   1.712 +			TSize iBitmapSize;		
   1.713 +			/** Bitmap bounds relative to the original pen position. */
   1.714 +			TRect iBounds;			
   1.715 +			};
   1.716 +
   1.717 +		/** Information about the glyphs that were output. */
   1.718 +		TOutput iOutput[EMaxOutputGlyphs];	
   1.719 +		/** Number of glyphs actually output. */
   1.720 +		TInt iOutputGlyphs;					
   1.721 +		};	
   1.722 +
   1.723 +
   1.724 +	/** Input parameter block.
   1.725 +
   1.726 +	This is optionally used by CFont::MeasureText(), which is the powerful text 
   1.727 +	measurement function underlying all the other text measurement functions.
   1.728 +
   1.729 +	@see CFont::MeasureText() 
   1.730 +	@publishedAll
   1.731 +	@released
   1.732 +	*/
   1.733 +	class TMeasureTextInput
   1.734 +		{
   1.735 +	public:
   1.736 +		TMeasureTextInput():
   1.737 +			iStartInputChar(0),
   1.738 +			iEndInputChar(KMaxTInt),
   1.739 +			iDirection(EHorizontal),
   1.740 +			iFlags(0),
   1.741 +			iMaxAdvance(KMaxTInt),
   1.742 +			iMaxBounds(KMaxTInt),
   1.743 +			iCharJustNum(0),
   1.744 +			iCharJustExcess(0),
   1.745 +			iWordJustNum(0),
   1.746 +			iWordJustExcess(0)
   1.747 +			{
   1.748 +			}
   1.749 +
   1.750 +		/**Flags for TMeasureTextInput::iFlags. */
   1.751 +		enum TFlags
   1.752 +			{
   1.753 + 			/** Input text is visually ordered left-to-right. */
   1.754 + 			EFVisualOrder = 1,
   1.755 + 			/** Input text is visually ordered right-to-left.
   1.756 + 			Overrides EFVisualOrder. */
   1.757 + 			EFVisualOrderRightToLeft = 2,
   1.758 + 			/** Flag to consider side bearings when checking bounds for line-break */
   1.759 + 			EFIncludePenPositionInBoundsCheck = 4
   1.760 +			};
   1.761 +
   1.762 +		/** Starting index specifying first input character in iText.
   1.763 +	
   1.764 +		Together with iEndInputChar, this allows some context before and 
   1.765 +		after the measured text to be supplied so that shaping can work 
   1.766 +		properly. */
   1.767 +		TInt iStartInputChar;	
   1.768 +	
   1.769 +		/** Index specifying the final input character.
   1.770 +	
   1.771 +		Together with iStartInputChar, this allows some context before and 
   1.772 +		after the measured text to be supplied so that shaping can work 
   1.773 +		properly. */
   1.774 +		TInt iEndInputChar;		
   1.775 +	
   1.776 +		/** The direction in which to draw the text. */
   1.777 +		TUint16 iDirection;
   1.778 +	
   1.779 +		/** Flags from TFlags. */
   1.780 +		TUint16 iFlags;
   1.781 +	
   1.782 +		/** The maximum advance. */
   1.783 +		TInt iMaxAdvance;		
   1.784 +		
   1.785 +		/** The maximum width (or height if drawing vertically) of bounds. */
   1.786 +		TInt iMaxBounds;		
   1.787 +	
   1.788 +		/** The number of glyph groups to be letter-spaced. */
   1.789 +		TInt iCharJustNum;		
   1.790 +	
   1.791 +		/** The amount of space to be used for letter spacing. */
   1.792 +		TInt iCharJustExcess;	
   1.793 +		
   1.794 +		/** The number of spaces to be used for word spacing. */
   1.795 +		TInt iWordJustNum;		
   1.796 +	
   1.797 +		/** The amount of space to be used for word spacing. */
   1.798 +		TInt iWordJustExcess;	
   1.799 +		};
   1.800 +
   1.801 +	/** Output parameter block.
   1.802 +
   1.803 +	This is optionally used by CFont::MeasureText(), which is the powerful text 
   1.804 +	measurement function underlying all the other text measurement functions.
   1.805 +
   1.806 +	@see CFont::MeasureText() 
   1.807 +	@publishedAll
   1.808 +	@released
   1.809 +	*/
   1.810 +	class TMeasureTextOutput
   1.811 +		{
   1.812 +		public:
   1.813 +		/** The number of input characters that would be drawn.
   1.814 +	
   1.815 +		This may be less than the length of the text if a maximum advance or bounding 
   1.816 +		box size is specified. */
   1.817 +		TInt iChars;			
   1.818 +		/** The number of glyphs that would be drawn. */
   1.819 +		TInt iGlyphs;			
   1.820 +		/** The number of groups that would be drawn.
   1.821 +	
   1.822 +		A group is a base glyph plus one or more combining characters. */
   1.823 +		TInt iGroups;			
   1.824 +		/** The number of word spaces (U+0020) that would be drawn. */
   1.825 +		TInt iSpaces;			
   1.826 +		/** The bounding box of all the glyphs that would be drawn. */
   1.827 +		TRect iBounds;			
   1.828 +		/** The maximum width and height of any glyph. */
   1.829 +		TSize iMaxGlyphSize;	
   1.830 +		};
   1.831 +
   1.832 +	/**
   1.833 +	Data availability flags.
   1.834 +
   1.835 +	Some fonts like printer fonts may only have width information and can return 
   1.836 +	ECharacterWidthOnly to show this: the text drawing routines in CFont synthesize 
   1.837 +	the rest of the data if necessary.
   1.838 +
   1.839 +	@see GetCharacterData() 
   1.840 +	@publishedAll	
   1.841 +	@released
   1.842 +	*/
   1.843 +	enum TCharacterDataAvailability
   1.844 +		{
   1.845 +		/** No font information available. */
   1.846 +		ENoCharacterData,
   1.847 +		/** Width information only is available. */
   1.848 +		ECharacterWidthOnly,
   1.849 +		/** All character data is available. */
   1.850 +		EAllCharacterData
   1.851 +		};
   1.852 +
   1.853 +private:
   1.854 +	// virtual functions have been made protected and public non-virtual ones
   1.855 +	// added to convert CFont to a handle-body pattern. SC is kept throught the
   1.856 +	// new functions and BC is kept by keeping the protected functions in the
   1.857 +	// same place in the class, and therefore in the same place in the vtable
   1.858 +	/**
   1.859 +	@publishedAll
   1.860 +	WARNING: Function for internal use ONLY.  Compatibility is not guaranteed in future releases. Please see derived class for implementation.
   1.861 +	*/
   1.862 +	virtual TUid DoTypeUid() const=0;
   1.863 +	/**
   1.864 +	@publishedAll
   1.865 +	WARNING: Function for internal use ONLY.  Compatibility is not guaranteed in future releases. Please see derived class for implementation.
   1.866 +	*/
   1.867 +	virtual TInt DoHeightInPixels() const=0;
   1.868 +	/**
   1.869 +	@publishedAll
   1.870 +	WARNING: Function for internal use ONLY.  Compatibility is not guaranteed in future releases. Please see derived class for implementation.
   1.871 +	*/
   1.872 +	virtual TInt DoAscentInPixels() const=0;
   1.873 +	IMPORT_C virtual TInt DoDescentInPixels() const;
   1.874 +	/**
   1.875 +	@publishedAll
   1.876 +	WARNING: Function for internal use ONLY.  Compatibility is not guaranteed in future releases. Please see derived class for implementation.
   1.877 +	*/
   1.878 +	virtual TInt DoCharWidthInPixels(TChar aChar) const=0;
   1.879 +	/**
   1.880 +	@publishedAll
   1.881 +	WARNING: Function for internal use ONLY.  Compatibility is not guaranteed in future releases. Please see derived class for implementation.
   1.882 +	*/
   1.883 +	virtual TInt DoTextWidthInPixels(const TDesC& aText) const=0;
   1.884 +	/**
   1.885 +	@publishedAll
   1.886 +	WARNING: Function for internal use ONLY.  Compatibility is not guaranteed in future releases. Please see derived class for implementation.
   1.887 +	*/
   1.888 +	virtual TInt DoBaselineOffsetInPixels() const=0;
   1.889 +	/**
   1.890 +	@publishedAll
   1.891 +	WARNING: Function for internal use ONLY.  Compatibility is not guaranteed in future releases. Please see derived class for implementation.
   1.892 +	*/
   1.893 +	virtual TInt DoTextCount(const TDesC& aText,TInt aWidthInPixels) const=0;
   1.894 +	/**
   1.895 +	@publishedAll
   1.896 +	WARNING: Function for internal use ONLY.  Compatibility is not guaranteed in future releases. Please see derived class for implementation.
   1.897 +	*/
   1.898 +	virtual TInt DoTextCount(const TDesC& aText,TInt aWidthInPixels,TInt& aExcessWidthInPixels) const=0;
   1.899 +	/**
   1.900 +	@publishedAll
   1.901 +	WARNING: Function for internal use ONLY.  Compatibility is not guaranteed in future releases. Please see derived class for implementation.
   1.902 +	*/
   1.903 +	virtual TInt DoMaxCharWidthInPixels() const=0;
   1.904 +	/**
   1.905 +	@publishedAll
   1.906 +	WARNING: Function for internal use ONLY.  Compatibility is not guaranteed in future releases. Please see derived class for implementation.
   1.907 +	*/
   1.908 +	virtual TInt DoMaxNormalCharWidthInPixels() const=0;
   1.909 +	/**
   1.910 +	@publishedAll
   1.911 +	WARNING: Function for internal use ONLY.  Compatibility is not guaranteed in future releases. Please see derived class for implementation.
   1.912 +	*/
   1.913 +	virtual TFontSpec DoFontSpecInTwips() const=0;
   1.914 +
   1.915 +protected:	
   1.916 +	IMPORT_C virtual TCharacterDataAvailability DoGetCharacterData(TUint aCode, TOpenFontCharMetrics& aMetrics,const TUint8*& aBitmap,TSize& aBitmapSize) const;
   1.917 +	IMPORT_C virtual TBool DoGetCharacterPosition(TPositionParam& aParam) const;
   1.918 +	IMPORT_C virtual TInt DoExtendedFunction(TUid aFunctionId, TAny* aParam = NULL) const;
   1.919 +
   1.920 +protected:
   1.921 +	IMPORT_C virtual ~CFont();
   1.922 +
   1.923 +public:
   1.924 +	inline TInt FontCapitalAscent() const;
   1.925 +	inline TInt FontMaxAscent() const;
   1.926 +	inline TInt FontStandardDescent() const;
   1.927 +	inline TInt FontMaxDescent() const;
   1.928 +	inline TInt FontLineGap() const;
   1.929 +	inline TInt FontMaxHeight() const;
   1.930 +
   1.931 +public:
   1.932 +	/** Gets run-time identity of the actual font type. This enables safe casting to 
   1.933 +	a derived type.
   1.934 +	
   1.935 +	For example, if the derived type is a CFbsFont, the return value is KCFbsFontUid. 
   1.936 +	You would need to cast to a CFbsFont to get a character bounding box. Similarly, 
   1.937 +	a CBitmapFont returns KCBitmapFontUidVal.
   1.938 +	
   1.939 +	@return The font-type identifier. */
   1.940 +	IMPORT_C TUid TypeUid() const;
   1.941 +
   1.942 +	/** Gets the font height in pixels.
   1.943 +	Note that this deprecated function is replaced by the new @c FontMaxHeight().
   1.944 +
   1.945 +	@return The font height in pixels.
   1.946 +	@see FontMaxHeight()
   1.947 +	@deprecated */
   1.948 +	IMPORT_C TInt HeightInPixels() const;
   1.949 +
   1.950 +	/** Gets the font ascent in pixels.
   1.951 +	Note that this deprecated function is replaced by the new @c FontMaxAscent()
   1.952 +	or in some cases @c FontCapitalAscent().	
   1.953 +	
   1.954 +	@return The font ascent in pixels.
   1.955 +	@see FontCapitalAscent()
   1.956 +	@see FontMaxAscent()
   1.957 +	@deprecated */
   1.958 +	IMPORT_C TInt AscentInPixels() const;
   1.959 +	
   1.960 +	/** Gets the font descent in pixels.
   1.961 +	Note that this deprecated function is replaced by the new @c FontMaxDescent()
   1.962 +	or in some cases @c FontStandardDescent().	
   1.963 +	
   1.964 +	@return The font descent in pixels.
   1.965 +	@see FontStandardDescent() 
   1.966 +	@see FontMaxDescent()
   1.967 +	@deprecated */
   1.968 +	IMPORT_C TInt DescentInPixels() const;
   1.969 +
   1.970 +	/** Gets the width in pixels in this font of the specified character.
   1.971 +	
   1.972 +	Note: For OpenType fonts this function returns the horizontal advance of
   1.973 +	the character, which may be different from the actual width.
   1.974 +	
   1.975 +	@param aChar The character whose width should be determined. 
   1.976 +	@return The width in pixels of the specified character in this font. */
   1.977 +	IMPORT_C TInt CharWidthInPixels(TChar aChar) const;
   1.978 +
   1.979 +	/** Gets the width in pixels of the specified descriptor when displayed in this 
   1.980 +	font.
   1.981 +	
   1.982 +	@param aText The descriptor whose width should be determined. 
   1.983 +	@return The width of the specified descriptor when displayed in this font, 
   1.984 +	in pixels. */
   1.985 +	IMPORT_C TInt TextWidthInPixels(const TDesC& aText) const;
   1.986 +
   1.987 +	/** Gets the baseline offset in pixels. 
   1.988 +	
   1.989 +	The baseline offset is how far a font is raised or lowered from its normal 
   1.990 +	baseline.
   1.991 +	
   1.992 +	@return Offset from normal baseline, in pixels. */
   1.993 +	IMPORT_C TInt BaselineOffsetInPixels() const;
   1.994 +
   1.995 +	/** Gets how much of the specified descriptor can be displayed in this font without 
   1.996 +	exceeding the specified width.
   1.997 +	
   1.998 +	Note:
   1.999 +	
  1.1000 +	This function does not display any of the descriptor itself - it is used 
  1.1001 +	before display, to test whether the whole descriptor can be displayed.
  1.1002 +	
  1.1003 +	@param aText The descriptor. 
  1.1004 +	@param aWidthInPixels The available width for character display. 
  1.1005 +	@return The number of characters which will be able to be displayed without 
  1.1006 +	exceeding the specified width. The count starts from the beginning of the 
  1.1007 +	descriptor. */
  1.1008 +	IMPORT_C TInt TextCount(const TDesC& aText,TInt aWidthInPixels) const;
  1.1009 +
  1.1010 +	/** Gets how much of the specified descriptor can be displayed in this font without 
  1.1011 +	exceeding the specified width. 
  1.1012 +	
  1.1013 +	It also returns the excess width - defined as the specified available width 
  1.1014 +	minus the width of the portion of the descriptor which can be displayed without 
  1.1015 +	exceeding the available width.
  1.1016 +	
  1.1017 +	@param aText The descriptor. 
  1.1018 +	@param aWidthInPixels The available width for character display. 
  1.1019 +	@param aExcessWidthInPixels The excess width after displaying the portion of 
  1.1020 +	the descriptor, in pixels. 
  1.1021 +	@return The number of characters which will be able to be displayed without 
  1.1022 +	exceeding the specified width. The count starts from the beginning of the 
  1.1023 +	descriptor. */
  1.1024 +	IMPORT_C TInt TextCount(const TDesC& aText,TInt aWidthInPixels,TInt& aExcessWidthInPixels) const;
  1.1025 +
  1.1026 +	/** Gets the width in pixels of the widest character in this font.
  1.1027 +	
  1.1028 +	@return The width of the maximum width character, in pixels. */
  1.1029 +	IMPORT_C TInt MaxCharWidthInPixels() const;
  1.1030 +
  1.1031 +	/** Gets the width in pixels of the widest normal character in this font.
  1.1032 +	
  1.1033 +	Normal characters include all character in a character set except non-alphabetic 
  1.1034 +	characters (e.g. the copyright symbol, or a block graphics symbol, for example).
  1.1035 +	
  1.1036 +	@return The width of the maximum width normal character, in pixels. */
  1.1037 +	IMPORT_C TInt MaxNormalCharWidthInPixels() const;
  1.1038 +
  1.1039 +	/** Gets the font specification of this font in twips.
  1.1040 +	
  1.1041 +	@return The font specification of this font (in twips). */
  1.1042 +	IMPORT_C TFontSpec FontSpecInTwips() const;
  1.1043 +	IMPORT_C TCharacterDataAvailability GetCharacterData(TUint aCode, TOpenFontCharMetrics& aMetrics,const TUint8*& aBitmap,TSize& aBitmapSize) const;
  1.1044 +	IMPORT_C TBool GetCharacterPosition(TPositionParam& aParam) const;
  1.1045 +	IMPORT_C TInt WidthZeroInPixels() const;
  1.1046 +	IMPORT_C TInt MeasureText(const TDesC& aText, const TMeasureTextInput* aInput = NULL, TMeasureTextOutput* aOutput = NULL) const;
  1.1047 +	IMPORT_C static TBool CharactersJoin(TInt aLeftCharacter, TInt aRightCharacter);
  1.1048 +	IMPORT_C TInt ExtendedFunction(TUid aFunctionId, TAny* aParam = NULL) const;
  1.1049 +	IMPORT_C TBool GetCharacterPosition2(TPositionParam& aParam, RShapeInfo& aShapeInfo) const;
  1.1050 +
  1.1051 +	/** Gets the width in pixels of the specified descriptor when displayed in this 
  1.1052 +	font.
  1.1053 +	
  1.1054 +	@param aText The descriptor whose width should be determined.
  1.1055 +	@param aParam Parameter block that controls how much of aText is measured
  1.1056 +	@return The width of the specified descriptor when displayed in this font, 
  1.1057 +	in pixels. */
  1.1058 +	IMPORT_C TInt TextWidthInPixels(const TDesC& aText,const TMeasureTextInput* aParam) const;
  1.1059 +	};
  1.1060 +
  1.1061 +
  1.1062 +// inline functions from original gdi.inl
  1.1063 +/** Gets the ascent of an ANSI capital letter in the font whether or not
  1.1064 +there are any ANSI capitals in the font.
  1.1065 +@return The positive distance from the font baseline to the top of a
  1.1066 +standard ANSI capital letter
  1.1067 +@publishedAll
  1.1068 +@released
  1.1069 +*/
  1.1070 +inline TInt CFont::FontCapitalAscent() const
  1.1071 +    {
  1.1072 +    return ExtendedFunction(KFontCapitalAscent);
  1.1073 +    }
  1.1074 +
  1.1075 +/** Gets the max ascent of any pre-composed glyph in the font. This will
  1.1076 +include accents or diacritics that form part of pre-composed glyphs. It is
  1.1077 +not guaranteed to cover the max ascent of composite glyphs that have to be
  1.1078 +created by a layout engine. This is also the recommended distance between
  1.1079 +the top of a text box and the baseline of the first line of text. 
  1.1080 +@return The positive distance from the font baseline to the top of the
  1.1081 +highest pre-composed glyph (including accents) above the baseline
  1.1082 +@publishedAll
  1.1083 +@released
  1.1084 +*/
  1.1085 +inline TInt CFont::FontMaxAscent() const
  1.1086 +    {
  1.1087 +    return ExtendedFunction(KFontMaxAscent);
  1.1088 +    }
  1.1089 +
  1.1090 +/** Gets the descent of an ANSI descending character in the font.
  1.1091 +Whether or not there are any ANSI descenders in the font.
  1.1092 +@return The positive distance from the font baseline to the bottom of the
  1.1093 +lowest ANSI descender
  1.1094 +@publishedAll
  1.1095 +@released
  1.1096 +*/
  1.1097 +inline TInt CFont::FontStandardDescent() const
  1.1098 +    {
  1.1099 +    return ExtendedFunction(KFontStandardDescent);
  1.1100 +    }
  1.1101 +
  1.1102 +/** Gets the max descent of any pre-composed glyph in the font. This will
  1.1103 +include accents or diacritics that form part of pre-composed glyphs. It is
  1.1104 +not guaranteed to cover the max descent of composite glyphs that have to be
  1.1105 +created by a layout engine.
  1.1106 +@return The positive distance from the font baseline to the bottom of the
  1.1107 +lowest pre-composed glyph (including accents) below the baseline
  1.1108 +@publishedAll
  1.1109 +@released
  1.1110 +*/
  1.1111 +inline TInt CFont::FontMaxDescent() const
  1.1112 +    {
  1.1113 +    return ExtendedFunction(KFontMaxDescent);
  1.1114 +    }
  1.1115 +
  1.1116 +/** Gets the suggested line gap for the font. This is the recommended
  1.1117 +baseline to baseline distance between successive lines of text in the font.
  1.1118 +@return The positive recommended gap between successive lines
  1.1119 +@publishedAll
  1.1120 +@released
  1.1121 +*/
  1.1122 +inline TInt CFont::FontLineGap() const
  1.1123 +    {
  1.1124 +    return ExtendedFunction(KFontLineGap);
  1.1125 +    }
  1.1126 +
  1.1127 +/**
  1.1128 +Gets the (positive) maximum height in pixels of the font.
  1.1129 +This may differ from the design height.
  1.1130 +
  1.1131 +@return The maximum height of the font.
  1.1132 +@publishedAll
  1.1133 +@released
  1.1134 +*/
  1.1135 +inline TInt CFont::FontMaxHeight() const
  1.1136 +    {
  1.1137 +    return FontMaxAscent() + FontMaxDescent();
  1.1138 +    }
  1.1139 +
  1.1140 +
  1.1141 +// from original gdistruct.h
  1.1142 +/*
  1.1143 +Structure used to pass input/output parameters between RFontTable and CFbsFont.
  1.1144 +@internalTechnology
  1.1145 +*/
  1.1146 +class TGetFontTableParam 
  1.1147 +    {
  1.1148 +public:
  1.1149 +    TUint32 iTag;
  1.1150 +    TAny *iContent;
  1.1151 +    TInt iLength;
  1.1152 +    };
  1.1153 +
  1.1154 +/*
  1.1155 +Structure used to pass input/output parameters between RGlyphOutlineIterator and CFbsFont.
  1.1156 +Used when opening an outline iterator.
  1.1157 +@internalTechnology
  1.1158 +*/
  1.1159 +class TGetGlyphOutlineParam 
  1.1160 +    {
  1.1161 +public:
  1.1162 +    TInt iCount;
  1.1163 +    const TUint *iCodes; 
  1.1164 +    TBool iHinted;
  1.1165 +    TAny **iOutlines;
  1.1166 +    TInt *iLengths; 
  1.1167 +    };
  1.1168 +
  1.1169 +/*
  1.1170 +Structure used to pass input/output parameters between RGlyphOutlineIterator and CFbsFont.
  1.1171 +Used when closing an outline iterator.
  1.1172 +@internalTechnology
  1.1173 +*/
  1.1174 +class TReleaseGlyphOutlineParam 
  1.1175 +    {
  1.1176 +public:
  1.1177 +    TInt iCount;
  1.1178 +    const TUint *iCodes;
  1.1179 +    TBool iHinted;
  1.1180 +    };
  1.1181 +
  1.1182 +
  1.1183 +#endif // __TEXTBASE_H__