pango.FontMetricsan object containing overall metric information for a
font.Synopsispango.FontMetricsgobject.GBoxedget_ascentget_descentget_approximate_char_widthget_approximate_digit_widthDescriptionA pango.FontMetrics
object holds the overall metric information for a font. A pango.FontMetrics
object is returned from the following methods:pango.Context.get_metrics()pango.Font.get_metrics()pango.Fontset.get_metrics()Methodspango.FontMetrics.get_ascentget_ascentReturns :the ascent in pango units. (1 point ==
pango.SCALE pango units.)The get_ascent() method returns the
font ascent in pango units where one font point is equal to pango.SCALE
(1024) pango units. The ascent is the distance from the baseline to the
logical top of a line of text. (The logical top may be above or below the
top of the actual drawn ink. It is necessary to lay out the text to figure
where the ink will be.)pango.FontMetrics.get_descentget_descentReturns :the descent in pango units. (1 point ==
pango.SCALE pango units.)The get_descent() method returns the
font descent in pango units where one font point is equal to pango.SCALE
(1024) pango units. The descent is the distance from the baseline to the
logical bottom of a line of text. (The logical bottom may be above or below
the bottom of the actual drawn ink. It is necessary to lay out the text to
figure where the ink will be.)pango.FontMetrics.get_approximate_char_widthget_approximate_char_widthReturns :the character width in pango units. (1 point ==
pango.SCALE pango units.)The get_approximate_char_width() method
returns the approximate character width for a font in pango units where one
font point is equal to pango.SCALE (1024) pango units. This is merely a
representative value that is useful, for example, for determining the
initial size for a window. Actual characters in text will be wider and
narrower than this.pango.FontMetrics.get_approximate_digit_widthget_approximate_digit_widthReturns :the digit width in pango units. (1 point ==
pango.SCALE pango units.)The get_approximate_digit_width()
method returns the approximate digit width for a font in pango units where
one font point is equal to pango.SCALE (1024) pango units. This is merely a
representative value that is useful, for example, for determining the
initial size for a window. Actual digits in text can be wider and narrower
than this, though this value is generally somewhat more accurate than the
result of the get_approximate_char_width()
method.