sl@0: // Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // TRgb sl@0: // sl@0: // sl@0: sl@0: sl@0: inline TRgb::TRgb(): sl@0: iValue(0xffffffff) sl@0: /** Constructs a TRgb initialised to KRgbWhite.*/ sl@0: {} sl@0: sl@0: sl@0: inline TRgb::TRgb(TUint32 aValue): sl@0: iValue(((aValue & 0xff0000) >> 16) | (aValue & 0x00ff00) | ((aValue & 0x0000ff) << 16) | (0xff000000 - (aValue & 0xff000000))) sl@0: /** Constructs a TRgb directly from a single 32-bit integer. sl@0: sl@0: The integer is of the form 0xaabbggrr, where bb is the hex number for blue, sl@0: gg is the hex number for green, rr is the hex number for red, and aa is the hex number for sl@0: "transparency" alpha (0 means opaque, 255 means transparent). sl@0: sl@0: This constructor is deprecated. The byte order of Red ,Green and Blue sl@0: does not match other constructors and methods in this class, sl@0: and the meaning of alpha is reversed compared to current convention. sl@0: sl@0: For example, TRgb(0x00080402) using this constructor sl@0: can be replaced with the 3 colour constructor TRgb(2,4,8). sl@0: The equivalent explicit alpha constructors are TRgb(0x020408,0xff) and TRgb(2,4,8,255). sl@0: The equivalent call to SetInternal is SetInternal(0xff020408). sl@0: sl@0: This constructor is deprecated. Use other constructors or SetInternal() instead. sl@0: sl@0: @param aValue Integer representing colour value. Takes form 0x00bbggrr. sl@0: @deprecated */ sl@0: {} sl@0: sl@0: inline TRgb::TRgb(TUint32 aInternalValue, TInt aAlpha) : sl@0: iValue((aInternalValue & 0x00ffffff) | (aAlpha << 24)) sl@0: /** Constructs a TRgb from a 32-bit integer (which corresponds to a colour) and from an alpha value. sl@0: sl@0: The first parameter is of the form 0x00rrggbb, where rr is the hex number for red, sl@0: gg is the hex number for green, and bb is the hex number for blue. sl@0: sl@0: The second parameter corresponds to an alpha channel (0 means transparent, 255 means opaque). sl@0: sl@0: For example, TRgb(2,4,8,255) using the 3 colour+alpha constructor is equal to TRgb(0x00020408, 255) using sl@0: this constructor. sl@0: sl@0: This constructor, which implements alpha in the conventional way, sl@0: replaces TRgb( TUint32 aValue ) which is deprecated. sl@0: sl@0: @param aInternalValue Integer representing a colour value, which takes the form 0x00rrggbb. sl@0: @param aAlpha Alpha component of the colour (0 - 255).*/ sl@0: { sl@0: } sl@0: sl@0: inline TRgb::TRgb(TInt aRed,TInt aGreen,TInt aBlue): sl@0: iValue(aRed<<16|aGreen<<8|aBlue|0xff000000) sl@0: /** Constructs a TRgb from its three component colours. sl@0: sl@0: Each colour has a value between 0 and 255. sl@0: The alpha component is always set to opaque (255) sl@0: sl@0: @param aRed Red component of the colour (0 - 255). sl@0: @param aGreen Green component of the colour (0 - 255). sl@0: @param aBlue Blue component of the colour (0 - 255). */ sl@0: {} sl@0: sl@0: /** Constructs a TRgb from its three colour components and alpha component. sl@0: sl@0: Each component has a value between 0 and 255. sl@0: The fourth parameter corresponds to an alpha channel (0 means transparent, 255 means opaque). sl@0: sl@0: This constructor, which implements alpha in the conventional way, sl@0: replaces TRgb( TUint32 aValue ) which is deprecated. sl@0: sl@0: @param aRed Red component of the colour (0 - 255). sl@0: @param aGreen Green component of the colour (0 - 255). sl@0: @param aBlue Blue component of the colour (0 - 255). sl@0: @param aAlpha Alpha component of the colour (0 - 255).*/ sl@0: inline TRgb::TRgb(TInt aRed,TInt aGreen,TInt aBlue, TInt aAlpha): sl@0: iValue(aRed<<16|aGreen<<8|aBlue|aAlpha<<24) sl@0: {} sl@0: sl@0: sl@0: inline TInt TRgb::Red() const sl@0: /** Gets the red component. sl@0: sl@0: @return The red component (0 - 255). */ sl@0: {return((iValue&0xff0000)>>16);} sl@0: sl@0: sl@0: inline TInt TRgb::Green() const sl@0: /** Gets the green component. sl@0: sl@0: @return The green component (0 - 255). */ sl@0: {return((iValue&0xff00)>>8);} sl@0: sl@0: sl@0: inline TInt TRgb::Blue() const sl@0: /** Gets the blue component. sl@0: sl@0: @return The blue component (0 - 255). */ sl@0: {return(iValue&0xff);} sl@0: sl@0: sl@0: inline TBool TRgb::operator==(const TRgb& aColor) const sl@0: /** Compares this colour with the specified colour for equality. sl@0: sl@0: For two colours to be equal, their red, green and blue components must all sl@0: be equal. sl@0: sl@0: @param aColor Colour to be compared. sl@0: @return ETrue. if the colours are equal; EFalse, otherwise. */ sl@0: sl@0: {return(iValue==aColor.iValue);} sl@0: sl@0: sl@0: inline TBool TRgb::operator!=(const TRgb& aColor) const sl@0: /** Compares this colour with the specified colour for inequality. sl@0: sl@0: Two colours are unequal if one at least one of their red, green and blue components sl@0: are unequal. sl@0: sl@0: @param aColor Colour to be compared. sl@0: @return ETrue, if the colours are not equal; EFalse, otherwise. sl@0: */ sl@0: {return(!(*this==aColor));} sl@0: sl@0: inline TRgb& TRgb::operator&=(const TRgb& aColor) sl@0: /** Logical AND assignment operator. sl@0: sl@0: The operator ANDs the first operand with the second and then assigns the result sl@0: back to the first operand. sl@0: sl@0: Note: sl@0: sl@0: This operates in the TRgb domain. Graphics defines logical operations for sl@0: drawing primitives which operate in the device colour domain. sl@0: sl@0: @param aColor Colour to be compared. sl@0: @return First operand-contains result of logical AND. */ sl@0: {iValue&=aColor.iValue;return(*this);} sl@0: sl@0: inline TRgb& TRgb::operator|=(const TRgb& aColor) sl@0: /** Logical OR assignment operator. sl@0: sl@0: The operator ORs the first operand with the second and then assigns the result sl@0: back to the first operand. sl@0: sl@0: Note: sl@0: sl@0: This operates in the TRgb domain. Graphics defines logical operations for sl@0: drawing primitives which operate in the device colour domain. sl@0: sl@0: @param aColor Colour to be compared. sl@0: @return First operand- contains result of logical OR. */ sl@0: {iValue|=aColor.iValue;return(*this);} sl@0: sl@0: sl@0: inline TRgb& TRgb::operator^=(const TRgb& aColor) sl@0: /** Logical EXCLUSIVE OR assignment operator. sl@0: sl@0: The operator Exclusive ORs the first operand with the second and then assigns sl@0: the result back to the first operand. sl@0: sl@0: Note: sl@0: sl@0: This operates in the TRgb domain. Graphics defines logical operations for sl@0: drawing primitives which operate in the device colour domain. sl@0: sl@0: @param aColor Colour to be compared. sl@0: @return First operand contains result of logical Exclusive OR. */ sl@0: {iValue^=aColor.iValue;iValue^=0xff000000; return(*this);} sl@0: sl@0: sl@0: inline TUint32 TRgb::Value() const sl@0: /** Gets the 32-bit value of the TRgb as an integer. sl@0: This function is deprecated. Use Internal() instead. sl@0: Note: the order of Red, Green and Blue components returned by this method sl@0: is reversed compared to all other methods. The alpha value is also reversed in meaning sl@0: compared to current convention, such that 0 represents opaque and 0xff represents transparent. sl@0: sl@0: @return The 32 bit value of the TRgb. Has the form 0xaabbggrr, where bb is the hex number for blue, sl@0: gg is the hex number for green, rr is the hex number for red, and aa is the hex number for sl@0: "transparency" alpha (0 means opaque, 255 means transparent). sl@0: @deprecated */ sl@0: // rr gg bb aa sl@0: {return (((iValue & 0xff0000) >> 16) | (iValue & 0x00ff00) | ((iValue & 0x0000ff) << 16) | (0xff000000 - (iValue & 0xff000000)));} sl@0: sl@0: inline TUint32 TRgb::Internal() const sl@0: /** Gets the 32-bit value of the TRgb as an integer. sl@0: sl@0: @return The 32 bit value of the TRgb. Has the form 0xaarrggbb. */ sl@0: {return (iValue);} sl@0: sl@0: inline void TRgb::SetInternal(TUint32 aInternal) sl@0: /** Sets the 32-bit value of the TRgb as a 32-bit integer. sl@0: @param aInternal Colour internal representation. Has the form 0xaarrggbb. sl@0: */ sl@0: {iValue = aInternal;} sl@0: sl@0: inline TRgb TRgb::operator~() const sl@0: /** Bitwise logical inversion operator. sl@0: sl@0: @return Contains results of logical inversion. */ sl@0: {TRgb rgb; rgb.SetInternal(iValue^0x00ffffff); return rgb;} sl@0: sl@0: sl@0: inline TRgb TRgb::operator&(const TRgb& aColor) sl@0: /** Bitwise logical AND operator. sl@0: sl@0: @param aColor Colour to be compared. sl@0: @return Contains results of logical AND. */ sl@0: {TRgb rgb; rgb.SetInternal(iValue&aColor.iValue); return rgb;} sl@0: sl@0: sl@0: inline TRgb TRgb::operator|(const TRgb& aColor) sl@0: /** Bitwise logical OR operator. sl@0: sl@0: @param aColor Colour to be compared. sl@0: @return Contains results of logical OR. */ sl@0: {TRgb rgb; rgb.SetInternal(iValue|aColor.iValue); return rgb;} sl@0: sl@0: sl@0: inline TRgb TRgb::operator^(const TRgb& aColor) sl@0: /** Bitwise EXCLUSIVE OR operator sl@0: sl@0: @param aColor Colour to be compared. sl@0: @return Contains results of logical EXCLUSIVE OR. */ sl@0: {TRgb rgb; rgb.SetInternal(iValue^aColor.iValue); return rgb;} sl@0: sl@0: sl@0: /** Gets TRgb from 2 level grayscale. sl@0: sl@0: The function takes a grayscale argument and return a TRgb whose red, green sl@0: and blue values are set to an appropriate level. sl@0: sl@0: @param aGray2 Grayscale value to be converted. sl@0: @return Equivalent 24 bit colour. Gray2 has only 2 levels (black and white), sl@0: the function returns r=g=b=0 or r=g=b=255. */ sl@0: inline TRgb TRgb::_Gray2(TInt aGray2) sl@0: { sl@0: if(aGray2) return(TRgb(0xffffff, 0xff)); sl@0: return(TRgb(0, 0xff)); sl@0: } sl@0: sl@0: /** Gets TRgb from 4 level grayscale. sl@0: sl@0: The function takes a grayscale argument and return a TRgb whose red, green sl@0: and blue values are set to an appropriate level. sl@0: sl@0: @param aGray4 Grayscale value to be converted. sl@0: @return Equivalent 24 bit colour. Gray4 has 4 levels- the function returns sl@0: r=g=b=85*c, where c=0,1,2, or 3. */ sl@0: inline TRgb TRgb::_Gray4(TInt aGray4) sl@0: { sl@0: aGray4&=3; sl@0: aGray4|=aGray4<<2; sl@0: aGray4|=aGray4<<4; sl@0: return(TRgb(aGray4,aGray4,aGray4)); sl@0: } sl@0: sl@0: /** Gets TRgb from 16 level grayscale. sl@0: sl@0: The function takes a grayscale argument and return a TRgb whose red, green sl@0: and blue values are set to an appropriate level. sl@0: sl@0: @param aGray16 Grayscale value to be converted. sl@0: @return Equivalent 24 bit colour. Gray16 has 16 levels - the function returns sl@0: r=g=b=17*c, where c=0, 1, ... 15. */ sl@0: inline TRgb TRgb::_Gray16(TInt aGray16) sl@0: { sl@0: aGray16&=0xf; sl@0: aGray16|=aGray16<<4; sl@0: return(TRgb(aGray16,aGray16,aGray16)); sl@0: } sl@0: sl@0: /** Gets TRgb from 256 level grayscale. sl@0: sl@0: The function takes a grayscale argument and return a TRgb whose red, green sl@0: and blue values are set to an appropriate level. sl@0: sl@0: @param aGray256 Grayscale value to be converted. sl@0: @return Equivalent 24 bit colour. Gray256 has 256 levels- the function sl@0: returns r=g=b=c, where c=0, 1, ... 255. */ sl@0: inline TRgb TRgb::_Gray256(TInt aGray256) sl@0: { sl@0: aGray256&=0xff; sl@0: return(TRgb(aGray256,aGray256,aGray256)); sl@0: } sl@0: sl@0: /** Gets TRgb from 4K colour index. sl@0: sl@0: The function takes a 12 bit index into a colour palette and returns a TRgb sl@0: whose red, green and blue values are set to an appropriate level. sl@0: sl@0: @param aColor4K 12 bit index into a colour palette sl@0: @return Equivalent 24 bit colour. */ sl@0: inline TRgb TRgb::_Color4K(TInt aColor4K) sl@0: { sl@0: TUint32 value = (aColor4K & 0xf00) << 8; sl@0: value |= (aColor4K & 0x0f0) << 4; sl@0: value |= (aColor4K & 0x00f); sl@0: return TRgb(value | (value << 4), 0xff); sl@0: } sl@0: sl@0: /** Gets TRgb from 64K colour index. sl@0: sl@0: The function takes a 16 bit index into a colour palette and returns a TRgb sl@0: whose red, green and blue values are set to an appropriate level. sl@0: sl@0: @param aColor64K 16 bit index into a colour palette sl@0: @return Equivalent 24 bit colour. */ sl@0: inline TRgb TRgb::_Color64K(TInt aColor64K) sl@0: { sl@0: TInt red = (aColor64K&0xF800)>>8; sl@0: red += red>>5; sl@0: TInt green = (aColor64K&0x07E0)>>3; sl@0: green += green>>6; sl@0: TInt blue = (aColor64K&0x001F)<<3; sl@0: blue += blue>>5; sl@0: return TRgb(red,green,blue); sl@0: } sl@0: sl@0: /** Gets TRgb from 16M colour index. sl@0: sl@0: The function takes a 24 bit index into a colour palette and returns the TRgb sl@0: whose red, green and blue values represent it exactly. sl@0: sl@0: @param a0RGB 24 bit index into a colour palette sl@0: @return The TRgb which represents the index exactly. */ sl@0: inline TRgb TRgb::_Color16M(TInt a0RGB) sl@0: { sl@0: return TRgb(a0RGB, 0xff); sl@0: } sl@0: sl@0: /** Gets TRgb from 16MU colour index. sl@0: The function takes a 24 bit colour value with eight bits for each sl@0: component, blue in the low byte, and returns the TRgb sl@0: whose red, green and blue values represent it exactly. sl@0: @param a0RGB The color - 0, R, G, B bytes. / BGR0 - little endian format / sl@0: @return The TRgb which represents the index exactly. */ sl@0: inline TRgb TRgb::_Color16MU(TInt a0RGB) sl@0: { sl@0: return TRgb(a0RGB, 0xff); sl@0: } sl@0: sl@0: /** Gets the index of the closest TRgb value to this, sl@0: based on the matching display mode. sl@0: sl@0: @return The index (0 - 1) representing the nearest TRgb. */ sl@0: inline TInt TRgb::_Gray2() const sl@0: { sl@0: return(Gray256()>>7); sl@0: } sl@0: sl@0: /**Gets the index of the closest TRgb value to this, sl@0: based on the matching display mode. sl@0: sl@0: @return The index (0 - 3) representing the nearest TRgb. */ sl@0: inline TInt TRgb::_Gray4() const sl@0: { sl@0: return(Gray256()>>6); sl@0: } sl@0: sl@0: /** Gets the index of the closest TRgb value to this, sl@0: based on the matching display mode. sl@0: sl@0: @return The index (0 - 15) representing the nearest TRgb.*/ sl@0: inline TInt TRgb::_Gray16() const sl@0: { sl@0: return(Gray256()>>4); sl@0: } sl@0: sl@0: /** Gets the index of the closest TRgb value to this, sl@0: based on the matching display mode. sl@0: sl@0: @return The index (0 - 255) representing the nearest TRgb.*/ sl@0: inline TInt TRgb::_Gray256() const sl@0: { sl@0: return(((Red()<<1)+Green()+(Green()<<2)+Blue())>>3); sl@0: } sl@0: sl@0: /** Gets the index of the closest TRgb value to this, sl@0: based on the matching display mode. sl@0: sl@0: @return The index (0 - 4095) representing the nearest TRgb. */ sl@0: inline TInt TRgb::_Color4K() const sl@0: { sl@0: TInt color4K = (iValue & 0x0000f0) >> 4; sl@0: color4K |= (iValue & 0x00f000) >> 8; sl@0: color4K |= (iValue & 0xf00000) >> 12; sl@0: return color4K; sl@0: } //0RGB sl@0: sl@0: /** Gets the index of the closest TRgb value to this, sl@0: based on the matching display mode. sl@0: sl@0: @return The index (0 - 65535) representing the nearest TRgb.*/ sl@0: inline TInt TRgb::_Color64K() const sl@0: { sl@0: TInt color64K = (iValue & 0x0000f8) >> 3; sl@0: color64K |= (iValue & 0x00fc00) >> 5; sl@0: color64K |= (iValue & 0xf80000) >> 8; sl@0: return color64K; sl@0: } sl@0: sl@0: /** Gets the index of the closest TRgb value to this, sl@0: based on the matching display mode. sl@0: sl@0: @return The index (0 - 16777215) representing the nearest TRgb.*/ sl@0: inline TInt TRgb::_Color16M() const sl@0: { sl@0: return (iValue & 0xffffff); sl@0: // 0RGB sl@0: } sl@0: sl@0: /** Gets the index of the closest TRgb value to this, based on the matching display mode. sl@0: @return The index (0 - 16777215) representing the nearest TRgb. */ sl@0: inline TInt TRgb::_Color16MU() const sl@0: { sl@0: return (iValue & 0xffffff); sl@0: // 0RGB sl@0: } sl@0: sl@0: sl@0: /** Gets the alpha component. sl@0: @return The alpha component (0 - 255). */ sl@0: inline TInt TRgb::Alpha() const sl@0: {return (iValue >> 24);} sl@0: sl@0: sl@0: /** Gets TRgb from 16MA colour index. sl@0: The function takes a 32 bit colour value with eight bits for each sl@0: component, blue in the low byte, and returns the TRgb sl@0: whose red, green, blue and alpha values represent it exactly. sl@0: @param aARGB The color - A, R, G, B bytes. / BGR0 - little endian format / sl@0: @return The TRgb which represents the index exactly. */ sl@0: inline TRgb TRgb::_Color16MA(TUint aARGB) sl@0: { sl@0: TRgb col; col.SetInternal(aARGB); sl@0: return col; sl@0: } sl@0: sl@0: /** Gets the index of the closest TRgb value to this, based on the matching display mode. sl@0: @return The index (0 - 16777215) representing the nearest TRgb. */ sl@0: inline TUint TRgb::_Color16MA() const sl@0: { sl@0: return (iValue); sl@0: // ARGB sl@0: } sl@0: // sl@0: // CPalette sl@0: // sl@0: sl@0: sl@0: inline TInt CPalette::Entries() const sl@0: /** Gets the number of entries in the palette sl@0: sl@0: @return The number of entries in the palette. */ sl@0: {return(iNumEntries);} sl@0: sl@0: // sl@0: // TColor256Utils sl@0: // sl@0: sl@0: sl@0: inline TRgb TColor256Util::Color256(TInt aColor256) const sl@0: /** Gets the TRgb value of the entry at the specified index in the colour lookup sl@0: table. sl@0: sl@0: @param aColor256 The index into the colour lookup table. sl@0: @return The TRgb value of the entry at the specified index. */ sl@0: { return TRgb(iColorTable[aColor256]); } sl@0: sl@0: // sl@0: // TFontStyle sl@0: // sl@0: inline TGlyphBitmapType TFontStyle::BitmapType() const sl@0: /** Gets the anti-aliasing setting for the font, as set by SetBitmapType(). sl@0: sl@0: @return Indicates whether or not this font should be drawn using anti-aliasing. */ sl@0: { sl@0: return (TGlyphBitmapType)(iFlags >> 16); sl@0: } sl@0: sl@0: sl@0: inline void TFontStyle::SetBitmapType(TGlyphBitmapType aBitmapType) sl@0: /** Sets whether the font should be drawn using anti-aliasing. If set, this value sl@0: overrides the default setting (set by CFbsTypefaceStore::SetDefaultBitmapType()) sl@0: for this font. sl@0: sl@0: Anti-aliasing can only be used for scalable fonts. There is currently no anti-aliasing sl@0: support for bitmapped fonts. sl@0: sl@0: @param aBitmapType Indicates whether or not this font should be drawn using sl@0: anti-aliasing. */ sl@0: { sl@0: iFlags &= 0xFFFF; sl@0: iFlags |= (aBitmapType << 16); sl@0: } sl@0: sl@0: // sl@0: // CBitmapDevice sl@0: // sl@0: sl@0: sl@0: inline TInt CBitmapDevice::CreateBitmapContext(CBitmapContext*& aGC) sl@0: /** Creates a bitmap context for this bitmap device. sl@0: sl@0: @param aGC On return, holds a pointer to the created bitmap context. sl@0: @return KErrNone, if successful; otherwise, another of the system-wide error sl@0: codes. */ sl@0: {return(CreateContext((CGraphicsContext*&)aGC));} // relies on CBitmapContext deriving _only_ from CGraphicsContext sl@0: sl@0: // sl@0: // TPictureCapability sl@0: // sl@0: sl@0: inline TPictureCapability::TPictureCapability(TScalingType aScalingType,TBool aCroppable): sl@0: iScalingType(aScalingType),iIsCroppable(aCroppable) sl@0: /** Constructs the object setting the scaling-type and croppability properties. sl@0: sl@0: @param aScalingType Whether or not the picture is scalable. sl@0: @param aCroppable Whether or not the picture is croppable. */ sl@0: {} sl@0: sl@0: // sl@0: // TZoomFactor sl@0: // sl@0: sl@0: sl@0: inline TZoomFactor::TZoomFactor(const MGraphicsDeviceMap* aDevice): sl@0: iZoomFactor(TZoomFactor::EZoomOneToOne), sl@0: iDevice(aDevice) sl@0: /** Constructs a zoom factor object for a specific graphics device map. sl@0: sl@0: The graphics map is either directly associated with a particular graphics sl@0: device itself, or is associated with a hierarchy of device maps whose root sl@0: map is associated with a particular graphics device. sl@0: sl@0: @param aDevice The graphics device map with which the zoom factor is associated. */ sl@0: {} sl@0: sl@0: inline TZoomFactor::TZoomFactor(const TZoomFactor* aDevice): sl@0: iDevice(aDevice) sl@0: { sl@0: iZoomFactor=aDevice->iZoomFactor; sl@0: } sl@0: sl@0: sl@0: inline void TZoomFactor::SetGraphicsDeviceMap(const MGraphicsDeviceMap* aDevice) sl@0: /** Sets the graphics device map for this zoom factor object. sl@0: sl@0: @param aDevice The graphics device map for this TZoomFactor. */ sl@0: {iDevice=aDevice;} sl@0: sl@0: sl@0: inline const MGraphicsDeviceMap* TZoomFactor::GraphicsDeviceMap() const sl@0: /** Gets the graphics device map of this zoom factor object. sl@0: sl@0: @return The graphics device map of the TZoomFactor. */ sl@0: {return(iDevice);} sl@0: sl@0: sl@0: sl@0: /** Gets the ascent of an ANSI capital letter in the font whether or not sl@0: there are any ANSI capitals in the font. sl@0: @return The positive distance from the font baseline to the top of a sl@0: standard ANSI capital letter sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: inline TInt CFont::FontCapitalAscent() const sl@0: { sl@0: return ExtendedFunction(KFontCapitalAscent); sl@0: } sl@0: sl@0: /** Gets the max ascent of any pre-composed glyph in the font. This will sl@0: include accents or diacritics that form part of pre-composed glyphs. It is sl@0: not guaranteed to cover the max ascent of composite glyphs that have to be sl@0: created by a layout engine. This is also the recommended distance between sl@0: the top of a text box and the baseline of the first line of text. sl@0: @return The positive distance from the font baseline to the top of the sl@0: highest pre-composed glyph (including accents) above the baseline sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: inline TInt CFont::FontMaxAscent() const sl@0: { sl@0: return ExtendedFunction(KFontMaxAscent); sl@0: } sl@0: sl@0: /** Gets the descent of an ANSI descending character in the font. sl@0: Whether or not there are any ANSI descenders in the font. sl@0: @return The positive distance from the font baseline to the bottom of the sl@0: lowest ANSI descender sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: inline TInt CFont::FontStandardDescent() const sl@0: { sl@0: return ExtendedFunction(KFontStandardDescent); sl@0: } sl@0: sl@0: /** Gets the max descent of any pre-composed glyph in the font. This will sl@0: include accents or diacritics that form part of pre-composed glyphs. It is sl@0: not guaranteed to cover the max descent of composite glyphs that have to be sl@0: created by a layout engine. sl@0: @return The positive distance from the font baseline to the bottom of the sl@0: lowest pre-composed glyph (including accents) below the baseline sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: inline TInt CFont::FontMaxDescent() const sl@0: { sl@0: return ExtendedFunction(KFontMaxDescent); sl@0: } sl@0: sl@0: /** Gets the suggested line gap for the font. This is the recommended sl@0: baseline to baseline distance between successive lines of text in the font. sl@0: @return The positive recommended gap between successive lines sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: inline TInt CFont::FontLineGap() const sl@0: { sl@0: return ExtendedFunction(KFontLineGap); sl@0: } sl@0: sl@0: /** sl@0: Gets the (positive) maximum height in pixels of the font. sl@0: This may differ from the design height. sl@0: sl@0: @return The maximum height of the font. sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: inline TInt CFont::FontMaxHeight() const sl@0: { sl@0: return FontMaxAscent() + FontMaxDescent(); sl@0: } sl@0: