diff --git a/modules/juce_graphics/fonts/juce_Font.cpp b/modules/juce_graphics/fonts/juce_Font.cpp index 09e63cf051..33ff25fac7 100644 --- a/modules/juce_graphics/fonts/juce_Font.cpp +++ b/modules/juce_graphics/fonts/juce_Font.cpp @@ -802,8 +802,8 @@ float Font::getHeightInPoints() const return 0.0f; } -float Font::getAscentInPoints() const { return getAscent() * getHeightToPointsFactor(); } -float Font::getDescentInPoints() const { return getDescent() * getHeightToPointsFactor(); } +float Font::getAscentInPoints() const { return font->getAscentDescent (*this).ascent * getHeightInPoints(); } +float Font::getDescentInPoints() const { return font->getAscentDescent (*this).descent * getHeightInPoints(); } int Font::getStringWidth (const String& text) const { diff --git a/modules/juce_graphics/fonts/juce_Font.h b/modules/juce_graphics/fonts/juce_Font.h index 9cbc7f0263..fba72f2045 100644 --- a/modules/juce_graphics/fonts/juce_Font.h +++ b/modules/juce_graphics/fonts/juce_Font.h @@ -298,6 +298,7 @@ public: This is the maximum height, from the top of the ascent to the bottom of the descenders. + This value is not affected by the optional ascent or descent override. @see withPointHeight, getHeight */ float getHeightInPoints() const; @@ -310,7 +311,9 @@ public: /** Returns the height of the font above its baseline, in points. This is the maximum height from the baseline to the top. - @see getHeight, getDescent + + This value is affected by the optional ascent override. + @see getAscentOverride, getHeightInPoints, getDescentInPoints */ float getAscentInPoints() const; @@ -322,7 +325,9 @@ public: /** Returns the amount that the font descends below its baseline, in points. This is calculated as (getHeight() - getAscent()). - @see getAscent, getHeight + + This value is affected by the optional descent override. + @see getDescentOverride, getHeightInPoints, getAscentInPoints */ float getDescentInPoints() const;