Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Protected Attributes
nsIFontMetricsGTK Class Reference

#include <nsIFontMetricsGTK.h>

Inheritance diagram for nsIFontMetricsGTK:
Inheritance graph
[legend]
Collaboration diagram for nsIFontMetricsGTK:
Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual nsresult GetWidth (const char *aString, PRUint32 aLength, nscoord &aWidth, nsRenderingContextGTK *aContext)=0
virtual nsresult GetWidth (const PRUnichar *aString, PRUint32 aLength, nscoord &aWidth, PRInt32 *aFontID, nsRenderingContextGTK *aContext)=0
virtual nsresult GetTextDimensions (const PRUnichar *aString, PRUint32 aLength, nsTextDimensions &aDimensions, PRInt32 *aFontID, nsRenderingContextGTK *aContext)=0
virtual nsresult GetTextDimensions (const char *aString, PRInt32 aLength, PRInt32 aAvailWidth, PRInt32 *aBreaks, PRInt32 aNumBreaks, nsTextDimensions &aDimensions, PRInt32 &aNumCharsFit, nsTextDimensions &aLastWordDimensions, PRInt32 *aFontID, nsRenderingContextGTK *aContext)=0
virtual nsresult GetTextDimensions (const PRUnichar *aString, PRInt32 aLength, PRInt32 aAvailWidth, PRInt32 *aBreaks, PRInt32 aNumBreaks, nsTextDimensions &aDimensions, PRInt32 &aNumCharsFit, nsTextDimensions &aLastWordDimensions, PRInt32 *aFontID, nsRenderingContextGTK *aContext)=0
virtual nsresult DrawString (const char *aString, PRUint32 aLength, nscoord aX, nscoord aY, const nscoord *aSpacing, nsRenderingContextGTK *aContext, nsDrawingSurfaceGTK *aSurface)=0
virtual nsresult DrawString (const PRUnichar *aString, PRUint32 aLength, nscoord aX, nscoord aY, PRInt32 aFontID, const nscoord *aSpacing, nsRenderingContextGTK *aContext, nsDrawingSurfaceGTK *aSurface)=0
virtual GdkFont * GetCurrentGDKFont (void)=0
virtual nsresult SetRightToLeftText (PRBool aIsRTL)=0
virtual PRBool GetRightToLeftText ()=0
virtual nsresult GetClusterInfo (const PRUnichar *aText, PRUint32 aLength, PRUint8 *aClusterStarts)=0
virtual PRInt32 GetPosition (const PRUnichar *aText, PRUint32 aLength, nsPoint aPt)=0
virtual nsresult GetRangeWidth (const PRUnichar *aText, PRUint32 aLength, PRUint32 aStart, PRUint32 aEnd, PRUint32 &aWidth)=0
virtual nsresult GetRangeWidth (const char *aText, PRUint32 aLength, PRUint32 aStart, PRUint32 aEnd, PRUint32 &aWidth)=0
virtual PRInt32 GetMaxStringLength ()=0
NS_IMETHOD Init (const nsFont &aFont, nsIAtom *aLangGroup, nsIDeviceContext *aContext)=0
 Initialize the font metrics.
NS_IMETHOD Destroy ()=0
 Destroy this font metrics.
NS_IMETHOD GetXHeight (nscoord &aResult)=0
 Return the font's xheight property, scaled into app-units.
NS_IMETHOD GetSuperscriptOffset (nscoord &aResult)=0
 Return the font's superscript offset (the distance from the baseline to where a superscript's baseline should be placed).
NS_IMETHOD GetSubscriptOffset (nscoord &aResult)=0
 Return the font's subscript offset (the distance from the baseline to where a subscript's baseline should be placed).
NS_IMETHOD GetStrikeout (nscoord &aOffset, nscoord &aSize)=0
 Return the font's strikeout offset (the distance from the baseline to where a strikeout should be placed) and size Positive values are above the baseline, negative below.
NS_IMETHOD GetUnderline (nscoord &aOffset, nscoord &aSize)=0
 Return the font's underline offset (the distance from the baseline to where a underline should be placed) and size.
NS_IMETHOD GetHeight (nscoord &aHeight)=0
 Returns the height (in app units) of the font.
NS_IMETHOD GetLeading (nscoord &aLeading)=0
 Returns the amount of internal leading (in app units) for the font.
NS_IMETHOD GetNormalLineHeight (nscoord &aHeight)=0
 Returns the normal line height (em height + leading).
NS_IMETHOD GetEmHeight (nscoord &aHeight)=0
 Returns the height (in app units) of the Western font's em square.
NS_IMETHOD GetEmAscent (nscoord &aAscent)=0
 Returns, in app units, the ascent part of the Western font's em square.
NS_IMETHOD GetEmDescent (nscoord &aDescent)=0
 Returns, in app units, the descent part of the Western font's em square.
NS_IMETHOD GetMaxHeight (nscoord &aHeight)=0
 Returns the height (in app units) of the Western font's bounding box.
NS_IMETHOD GetMaxAscent (nscoord &aAscent)=0
 Returns, in app units, the maximum distance characters in this font extend above the base line.
NS_IMETHOD GetMaxDescent (nscoord &aDescent)=0
 Returns, in app units, the maximum distance characters in this font extend below the base line.
NS_IMETHOD GetMaxAdvance (nscoord &aAdvance)=0
 Returns, in app units, the maximum character advance for the font.
const nsFontFont ()
 Returns the font associated with these metrics.
NS_IMETHOD GetLangGroup (nsIAtom **aLangGroup)=0
 Returns the language group associated with these metrics.
NS_IMETHOD GetFontHandle (nsFontHandle &aHandle)=0
 Returns the font handle associated with these metrics.
NS_IMETHOD GetAveCharWidth (nscoord &aAveCharWidth)=0
 Returns the average character width.
NS_IMETHOD GetSpaceWidth (nscoord &aSpaceCharWidth)=0
 Returns the often needed width of the space character.

Protected Attributes

nsFont mFont

Detailed Description

Definition at line 50 of file nsIFontMetricsGTK.h.


Member Function Documentation

NS_IMETHOD nsIFontMetrics::Destroy ( ) [pure virtual, inherited]
virtual nsresult nsIFontMetricsGTK::DrawString ( const char *  aString,
PRUint32  aLength,
nscoord  aX,
nscoord  aY,
const nscoord aSpacing,
nsRenderingContextGTK aContext,
nsDrawingSurfaceGTK aSurface 
) [pure virtual]

Implemented in nsFontMetricsGTK, nsFontMetricsXft, and nsFontMetricsPango.

Here is the caller graph for this function:

virtual nsresult nsIFontMetricsGTK::DrawString ( const PRUnichar aString,
PRUint32  aLength,
nscoord  aX,
nscoord  aY,
PRInt32  aFontID,
const nscoord aSpacing,
nsRenderingContextGTK aContext,
nsDrawingSurfaceGTK aSurface 
) [pure virtual]
const nsFont& nsIFontMetrics::Font ( ) [inline, inherited]

Returns the font associated with these metrics.

The return value is only defined after Init() has been called.

Definition at line 214 of file nsIFontMetrics.h.

{ return mFont; }

Here is the caller graph for this function:

NS_IMETHOD nsIFontMetrics::GetAveCharWidth ( nscoord aAveCharWidth) [pure virtual, inherited]
virtual nsresult nsIFontMetricsGTK::GetClusterInfo ( const PRUnichar aText,
PRUint32  aLength,
PRUint8 aClusterStarts 
) [pure virtual]

Implemented in nsFontMetricsGTK, nsFontMetricsXft, and nsFontMetricsPango.

Here is the caller graph for this function:

virtual GdkFont* nsIFontMetricsGTK::GetCurrentGDKFont ( void  ) [pure virtual]

Implemented in nsFontMetricsGTK, nsFontMetricsXft, and nsFontMetricsPango.

Here is the caller graph for this function:

NS_IMETHOD nsIFontMetrics::GetEmAscent ( nscoord aAscent) [pure virtual, inherited]
NS_IMETHOD nsIFontMetrics::GetEmDescent ( nscoord aDescent) [pure virtual, inherited]
NS_IMETHOD nsIFontMetrics::GetEmHeight ( nscoord aHeight) [pure virtual, inherited]

Returns the height (in app units) of the Western font's em square.

This is em ascent plus em descent.

Implemented in nsFontMetricsXlib, nsFontMetricsGTK, nsFontMetricsOS2, nsFontMetricsWin, nsFontMetricsQt, nsFontMetricsPh, nsFontMetricsXft, nsFontMetricsXft, nsFontMetricsPango, nsFontMetricsPS, nsFontMetricsBeOS, nsFontMetricsMac, and nsCairoFontMetrics.

Here is the caller graph for this function:

NS_IMETHOD nsIFontMetrics::GetFontHandle ( nsFontHandle aHandle) [pure virtual, inherited]
NS_IMETHOD nsIFontMetrics::GetHeight ( nscoord aHeight) [pure virtual, inherited]

Returns the height (in app units) of the font.

This is ascent plus descent plus any internal leading

This method will be removed once the callers have been moved over to the new GetEmHeight (and possibly GetMaxHeight).

Implemented in nsFontMetricsXlib, nsFontMetricsGTK, nsFontMetricsOS2, nsFontMetricsWin, nsFontMetricsQt, nsFontMetricsPh, nsFontMetricsXft, nsFontMetricsXft, nsFontMetricsPS, nsFontMetricsPango, nsFontMetricsBeOS, nsFontMetricsMac, nsCairoFontMetrics, and nsRegressionTestFontMetrics.

Here is the caller graph for this function:

NS_IMETHOD nsIFontMetrics::GetLangGroup ( nsIAtom **  aLangGroup) [pure virtual, inherited]
NS_IMETHOD nsIFontMetrics::GetLeading ( nscoord aLeading) [pure virtual, inherited]

Returns the amount of internal leading (in app units) for the font.

This is computed as the "height - (ascent + descent)"

Implemented in nsFontMetricsXlib, nsFontMetricsGTK, nsFontMetricsOS2, nsFontMetricsWin, nsFontMetricsQt, nsFontMetricsPh, nsFontMetricsXft, nsFontMetricsXft, nsFontMetricsPango, nsFontMetricsPS, nsCairoFontMetrics, nsFontMetricsBeOS, nsFontMetricsMac, and nsRegressionTestFontMetrics.

NS_IMETHOD nsIFontMetrics::GetMaxAdvance ( nscoord aAdvance) [pure virtual, inherited]
NS_IMETHOD nsIFontMetrics::GetMaxAscent ( nscoord aAscent) [pure virtual, inherited]

Returns, in app units, the maximum distance characters in this font extend above the base line.

Implemented in nsFontMetricsXlib, nsFontMetricsGTK, nsFontMetricsOS2, nsFontMetricsWin, nsFontMetricsPh, nsFontMetricsQt, nsFontMetricsXft, nsFontMetricsXft, nsFontMetricsPango, nsFontMetricsPS, nsFontMetricsBeOS, nsFontMetricsMac, nsCairoFontMetrics, and nsRegressionTestFontMetrics.

Here is the caller graph for this function:

NS_IMETHOD nsIFontMetrics::GetMaxDescent ( nscoord aDescent) [pure virtual, inherited]

Returns, in app units, the maximum distance characters in this font extend below the base line.

Implemented in nsFontMetricsXlib, nsFontMetricsGTK, nsFontMetricsOS2, nsFontMetricsWin, nsFontMetricsPh, nsFontMetricsQt, nsFontMetricsXft, nsFontMetricsXft, nsFontMetricsPango, nsFontMetricsPS, nsFontMetricsBeOS, nsFontMetricsMac, nsCairoFontMetrics, and nsRegressionTestFontMetrics.

Here is the caller graph for this function:

NS_IMETHOD nsIFontMetrics::GetMaxHeight ( nscoord aHeight) [pure virtual, inherited]

Returns the height (in app units) of the Western font's bounding box.

This is max ascent plus max descent.

Implemented in nsFontMetricsXlib, nsFontMetricsGTK, nsFontMetricsOS2, nsFontMetricsWin, nsFontMetricsPh, nsFontMetricsQt, nsFontMetricsXft, nsFontMetricsXft, nsFontMetricsPango, nsFontMetricsPS, nsFontMetricsBeOS, nsFontMetricsMac, and nsCairoFontMetrics.

virtual PRInt32 nsIFontMetricsGTK::GetMaxStringLength ( ) [pure virtual]

Implemented in nsFontMetricsGTK, nsFontMetricsXft, and nsFontMetricsPango.

Here is the caller graph for this function:

NS_IMETHOD nsIFontMetrics::GetNormalLineHeight ( nscoord aHeight) [pure virtual, inherited]

Returns the normal line height (em height + leading).

Implemented in nsFontMetricsXlib, nsFontMetricsGTK, nsFontMetricsOS2, nsFontMetricsWin, nsFontMetricsQt, nsFontMetricsPh, nsFontMetricsXft, nsFontMetricsXft, nsFontMetricsPS, nsFontMetricsPango, nsCairoFontMetrics, nsFontMetricsBeOS, and nsFontMetricsMac.

Here is the caller graph for this function:

virtual PRInt32 nsIFontMetricsGTK::GetPosition ( const PRUnichar aText,
PRUint32  aLength,
nsPoint  aPt 
) [pure virtual]

Implemented in nsFontMetricsGTK, nsFontMetricsXft, and nsFontMetricsPango.

Here is the caller graph for this function:

virtual nsresult nsIFontMetricsGTK::GetRangeWidth ( const PRUnichar aText,
PRUint32  aLength,
PRUint32  aStart,
PRUint32  aEnd,
PRUint32 aWidth 
) [pure virtual]

Implemented in nsFontMetricsGTK, nsFontMetricsXft, and nsFontMetricsPango.

Here is the caller graph for this function:

virtual nsresult nsIFontMetricsGTK::GetRangeWidth ( const char *  aText,
PRUint32  aLength,
PRUint32  aStart,
PRUint32  aEnd,
PRUint32 aWidth 
) [pure virtual]
virtual PRBool nsIFontMetricsGTK::GetRightToLeftText ( ) [pure virtual]

Implemented in nsFontMetricsGTK, nsFontMetricsXft, and nsFontMetricsPango.

Here is the caller graph for this function:

NS_IMETHOD nsIFontMetrics::GetSpaceWidth ( nscoord aSpaceCharWidth) [pure virtual, inherited]

Returns the often needed width of the space character.

Implemented in nsFontMetricsXlib, nsFontMetricsGTK, nsFontMetricsOS2, nsFontMetricsWin, nsFontMetricsPh, nsFontMetricsQt, nsFontMetricsXft, nsFontMetricsXft, nsFontMetricsPango, nsFontMetricsPS, nsFontMetricsBeOS, nsFontMetricsMac, and nsCairoFontMetrics.

Here is the caller graph for this function:

NS_IMETHOD nsIFontMetrics::GetStrikeout ( nscoord aOffset,
nscoord aSize 
) [pure virtual, inherited]

Return the font's strikeout offset (the distance from the baseline to where a strikeout should be placed) and size Positive values are above the baseline, negative below.

Implemented in nsFontMetricsXlib, nsFontMetricsGTK, nsFontMetricsOS2, nsFontMetricsWin, nsFontMetricsQt, nsFontMetricsPh, nsFontMetricsPS, nsFontMetricsXft, nsFontMetricsXft, nsFontMetricsPango, nsFontMetricsBeOS, nsFontMetricsMac, nsCairoFontMetrics, and nsRegressionTestFontMetrics.

Here is the caller graph for this function:

NS_IMETHOD nsIFontMetrics::GetSubscriptOffset ( nscoord aResult) [pure virtual, inherited]

Return the font's subscript offset (the distance from the baseline to where a subscript's baseline should be placed).

The value returned will be a positive value.

Implemented in nsFontMetricsXlib, nsFontMetricsGTK, nsFontMetricsOS2, nsFontMetricsWin, nsFontMetricsQt, nsFontMetricsPh, nsFontMetricsPS, nsFontMetricsXft, nsFontMetricsXft, nsFontMetricsPango, nsFontMetricsBeOS, nsFontMetricsMac, nsCairoFontMetrics, and nsRegressionTestFontMetrics.

NS_IMETHOD nsIFontMetrics::GetSuperscriptOffset ( nscoord aResult) [pure virtual, inherited]

Return the font's superscript offset (the distance from the baseline to where a superscript's baseline should be placed).

The value returned will be a positive value.

Implemented in nsFontMetricsXlib, nsFontMetricsGTK, nsFontMetricsOS2, nsFontMetricsWin, nsFontMetricsQt, nsFontMetricsPS, nsFontMetricsPh, nsFontMetricsXft, nsFontMetricsXft, nsFontMetricsBeOS, nsFontMetricsPango, nsFontMetricsMac, nsCairoFontMetrics, and nsRegressionTestFontMetrics.

virtual nsresult nsIFontMetricsGTK::GetTextDimensions ( const PRUnichar aString,
PRUint32  aLength,
nsTextDimensions aDimensions,
PRInt32 aFontID,
nsRenderingContextGTK aContext 
) [pure virtual]

Implemented in nsFontMetricsGTK, nsFontMetricsXft, and nsFontMetricsPango.

Here is the caller graph for this function:

virtual nsresult nsIFontMetricsGTK::GetTextDimensions ( const char *  aString,
PRInt32  aLength,
PRInt32  aAvailWidth,
PRInt32 aBreaks,
PRInt32  aNumBreaks,
nsTextDimensions aDimensions,
PRInt32 aNumCharsFit,
nsTextDimensions aLastWordDimensions,
PRInt32 aFontID,
nsRenderingContextGTK aContext 
) [pure virtual]
virtual nsresult nsIFontMetricsGTK::GetTextDimensions ( const PRUnichar aString,
PRInt32  aLength,
PRInt32  aAvailWidth,
PRInt32 aBreaks,
PRInt32  aNumBreaks,
nsTextDimensions aDimensions,
PRInt32 aNumCharsFit,
nsTextDimensions aLastWordDimensions,
PRInt32 aFontID,
nsRenderingContextGTK aContext 
) [pure virtual]
NS_IMETHOD nsIFontMetrics::GetUnderline ( nscoord aOffset,
nscoord aSize 
) [pure virtual, inherited]

Return the font's underline offset (the distance from the baseline to where a underline should be placed) and size.

Positive values are above the baseline, negative below.

Implemented in nsFontMetricsXlib, nsFontMetricsGTK, nsFontMetricsOS2, nsFontMetricsWin, nsFontMetricsQt, nsFontMetricsPh, nsFontMetricsXft, nsFontMetricsXft, nsFontMetricsPS, nsFontMetricsPango, nsFontMetricsBeOS, nsFontMetricsMac, nsCairoFontMetrics, and nsRegressionTestFontMetrics.

Here is the caller graph for this function:

virtual nsresult nsIFontMetricsGTK::GetWidth ( const char *  aString,
PRUint32  aLength,
nscoord aWidth,
nsRenderingContextGTK aContext 
) [pure virtual]

Implemented in nsFontMetricsGTK, nsFontMetricsXft, and nsFontMetricsPango.

Here is the caller graph for this function:

virtual nsresult nsIFontMetricsGTK::GetWidth ( const PRUnichar aString,
PRUint32  aLength,
nscoord aWidth,
PRInt32 aFontID,
nsRenderingContextGTK aContext 
) [pure virtual]
NS_IMETHOD nsIFontMetrics::GetXHeight ( nscoord aResult) [pure virtual, inherited]
NS_IMETHOD nsIFontMetrics::Init ( const nsFont aFont,
nsIAtom aLangGroup,
nsIDeviceContext aContext 
) [pure virtual, inherited]

Initialize the font metrics.

Call this after creating the font metrics. Font metrics you get from the font cache do NOT need to be initialized

See also:
nsIDeviceContext::GetMetricsFor()

Implemented in nsFontMetricsXlib, nsFontMetricsGTK, nsFontMetricsOS2, nsFontMetricsWin, nsFontMetricsQt, nsFontMetricsPS, nsFontMetricsXft, nsFontMetricsXft, nsFontMetricsBeOS, nsFontMetricsPh, nsFontMetricsPango, nsFontMetricsMac, and nsCairoFontMetrics.

virtual nsresult nsIFontMetricsGTK::SetRightToLeftText ( PRBool  aIsRTL) [pure virtual]

Implemented in nsFontMetricsGTK, nsFontMetricsXft, nsFontMetricsXft, and nsFontMetricsPango.

Here is the caller graph for this function:


Member Data Documentation

nsFont nsIFontMetrics::mFont [protected, inherited]

Definition at line 238 of file nsIFontMetrics.h.


The documentation for this class was generated from the following file: