FontMetrics Class Reference

#include <Pt/Gfx/FontMetrics.h>

Metrics that describe a font face at a given size. More...

Public Member Functions

 FontMetrics ()
 Constructs empty font metrics.
 
Float ascent () const
 Returns the ascent above the baseline.
 
void setAscent (Float n)
 Sets the ascent.
 
Float descent () const
 Returns the descent below the baseline.
 
void setDescent (Float n)
 Sets the descent.
 
Float height () const
 Returns the font height (ascent + descent).
 
Float capHeight () const
 Returns the height of capital letters.
 
void setCapHeight (Float n)
 Sets the cap height.
 
Float xHeight () const
 Returns the height of lowercase x.
 
void setXHeight (Float n)
 Sets the x-height.
 
Float leading () const
 Returns the external leading between lines.
 
void setLeading (Float n)
 Sets the leading.
 
Float lineHeight () const
 Returns the line height (ascent + descent + leading).
 
Float underlinePos () const
 Returns the underline position below the baseline.
 
void setUnderlinePos (Float n)
 Sets the underline position.
 
Float underlineThickness () const
 Returns the underline thickness.
 
void setUnderlineThickness (Float n)
 Sets the underline thickness.
 
Float strikeoutPos () const
 Returns the strikeout position above the baseline.
 
void setStrikeoutPos (Float n)
 Sets the strikeout position.
 
Float strikeoutThickness () const
 Returns the strikeout line thickness.
 
void setStrikeoutThickness (Float n)
 Sets the strikeout thickness.
 

Detailed Description

FontMetrics contains values such as ascent, descent and underline geometry for the font selected by a painter. These metrics can be used to align text, compute line spacing and position decorative lines.