bug 27164; added new GetNormalLineHeight API for proper line-height

git-svn-id: svn://10.0.0.236/trunk@68261 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
erik%netscape.com 2000-05-04 21:46:22 +00:00
parent bbec0a38d2
commit 5cd12e9864
5 changed files with 28 additions and 3 deletions

View File

@ -132,15 +132,22 @@ public:
*/
NS_IMETHOD GetHeight(nscoord &aHeight) = 0;
#if defined(XP_UNIX)
#define NEW_FONT_HEIGHT_APIS 1
#endif
#ifdef NEW_FONT_HEIGHT_APIS
/**
* Returns the normal line height (em height + leading).
*/
NS_IMETHOD GetNormalLineHeight(nscoord &aHeight) = 0;
#endif /* NEW_FONT_HEIGHT_APIS */
/**
* Returns the amount of internal leading (in app units) for the font. This
* is computed as the "height - (ascent + descent)"
*/
NS_IMETHOD GetLeading(nscoord &aLeading) = 0;
#if defined(XP_UNIX)
#define NEW_FONT_HEIGHT_APIS 1
#endif
#ifdef NEW_FONT_HEIGHT_APIS
/**

View File

@ -433,6 +433,12 @@ NS_IMETHODIMP nsFontMetricsGTK::GetHeight(nscoord &aHeight)
return NS_OK;
}
NS_IMETHODIMP nsFontMetricsGTK::GetNormalLineHeight(nscoord &aHeight)
{
aHeight = mEmHeight + mLeading;
return NS_OK;
}
NS_IMETHODIMP nsFontMetricsGTK::GetLeading(nscoord &aLeading)
{
aLeading = mLeading;

View File

@ -113,6 +113,7 @@ public:
NS_IMETHOD GetUnderline(nscoord& aOffset, nscoord& aSize);
NS_IMETHOD GetHeight(nscoord &aHeight);
NS_IMETHOD GetNormalLineHeight(nscoord &aHeight);
NS_IMETHOD GetLeading(nscoord &aLeading);
NS_IMETHOD GetEmHeight(nscoord &aHeight);
NS_IMETHOD GetEmAscent(nscoord &aAscent);

View File

@ -272,6 +272,16 @@ nsFontMetricsPS :: GetHeight(nscoord &aHeight)
return NS_OK;
}
/** ---------------------------------------------------
* See documentation in nsFontMetricsPS.h
*/
NS_IMETHODIMP
nsFontMetricsPS :: GetNormalLineHeight(nscoord &aHeight)
{
aHeight = mEmHeight + mLeading;
return NS_OK;
}
/** ---------------------------------------------------
* See documentation in nsFontMetricsPS.h
* @update 2/26/99 dwc

View File

@ -54,6 +54,7 @@ public:
NS_IMETHOD GetUnderline(nscoord& aOffset, nscoord& aSize);
NS_IMETHOD GetHeight(nscoord &aHeight);
NS_IMETHOD GetNormalLineHeight(nscoord &aHeight);
NS_IMETHOD GetLeading(nscoord &aLeading);
NS_IMETHOD GetEmHeight(nscoord &aHeight);
NS_IMETHOD GetEmAscent(nscoord &aAscent);