diff --git a/mozilla/gfx/public/nsIFontMetrics.h b/mozilla/gfx/public/nsIFontMetrics.h index ef72f4d272f..b1850b9eeea 100644 --- a/mozilla/gfx/public/nsIFontMetrics.h +++ b/mozilla/gfx/public/nsIFontMetrics.h @@ -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 /** diff --git a/mozilla/gfx/src/gtk/nsFontMetricsGTK.cpp b/mozilla/gfx/src/gtk/nsFontMetricsGTK.cpp index 92faba9858e..d9a1b82b5f3 100644 --- a/mozilla/gfx/src/gtk/nsFontMetricsGTK.cpp +++ b/mozilla/gfx/src/gtk/nsFontMetricsGTK.cpp @@ -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; diff --git a/mozilla/gfx/src/gtk/nsFontMetricsGTK.h b/mozilla/gfx/src/gtk/nsFontMetricsGTK.h index cf512ed34ac..8d3ca2b8444 100644 --- a/mozilla/gfx/src/gtk/nsFontMetricsGTK.h +++ b/mozilla/gfx/src/gtk/nsFontMetricsGTK.h @@ -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); diff --git a/mozilla/gfx/src/ps/nsFontMetricsPS.cpp b/mozilla/gfx/src/ps/nsFontMetricsPS.cpp index fa5f02e215f..c94148e8098 100644 --- a/mozilla/gfx/src/ps/nsFontMetricsPS.cpp +++ b/mozilla/gfx/src/ps/nsFontMetricsPS.cpp @@ -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 diff --git a/mozilla/gfx/src/ps/nsFontMetricsPS.h b/mozilla/gfx/src/ps/nsFontMetricsPS.h index c06eaf5abf9..501b9d855bf 100644 --- a/mozilla/gfx/src/ps/nsFontMetricsPS.h +++ b/mozilla/gfx/src/ps/nsFontMetricsPS.h @@ -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);