2.14 <PangoFontMetrics>

Structure: <PangoFontMetrics>

A <PangoFontMetrics> structure holds the overall metric information for a font.

The information in a <PangoFontMetrics> structure may be restricted to a script. The fields of this structure are private to implementations of a font backend. See the documentation of the corresponding getters for documentation of their meaning.

For an overview of the most important metrics, see:

Procedures

Method: font-metrics:get-approximate-char-width self ⇒ %return
Method: get-approximate-char-width self ⇒ %return

Gets the approximate character width for a font metrics structure.

This is merely a representative value useful, for example, for determining the initial size for a window. Actual characters in text will be wider and narrower than this.

self

Passed: a <PangoFontMetrics>.

a <PangoFontMetrics> structure

%return

Returned: a 32-bit integer.

the character width, in Pango units.

Method: font-metrics:get-approximate-digit-width self ⇒ %return
Method: get-approximate-digit-width self ⇒ %return

Gets the approximate digit width for a font metrics structure.

This is merely a representative value useful, for example, for determining the initial size for a window. Actual digits in text can be wider or narrower than this, though this value is generally somewhat more accurate than the result of font-metrics:get-approximate-char-width for digits.

self

Passed: a <PangoFontMetrics>.

a <PangoFontMetrics> structure

%return

Returned: a 32-bit integer.

the digit width, in Pango units.

Method: font-metrics:get-ascent self ⇒ %return
Method: get-ascent self ⇒ %return

Gets the ascent from a font metrics structure.

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.)

self

Passed: a <PangoFontMetrics>.

a <PangoFontMetrics> structure

%return

Returned: a 32-bit integer.

the ascent, in Pango units.

Method: font-metrics:get-descent self ⇒ %return
Method: get-descent self ⇒ %return

Gets the descent from a font metrics structure.

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.)

self

Passed: a <PangoFontMetrics>.

a <PangoFontMetrics> structure

%return

Returned: a 32-bit integer.

the descent, in Pango units.

Method: font-metrics:get-height self ⇒ %return
Method: get-height self ⇒ %return

Gets the line height from a font metrics structure.

The line height is the recommended distance between successive baselines in wrapped text using this font.

If the line height is not available, 0 is returned.

self

Passed: a <PangoFontMetrics>.

a <PangoFontMetrics> structure

%return

Returned: a 32-bit integer.

the height, in Pango units

Method: font-metrics:get-strikethrough-position self ⇒ %return
Method: get-strikethrough-position self ⇒ %return

Gets the suggested position to draw the strikethrough.

The value returned is the distance above the baseline of the top of the strikethrough.

self

Passed: a <PangoFontMetrics>.

a <PangoFontMetrics> structure

%return

Returned: a 32-bit integer.

the suggested strikethrough position, in Pango units.

Method: font-metrics:get-strikethrough-thickness self ⇒ %return
Method: get-strikethrough-thickness self ⇒ %return

Gets the suggested thickness to draw for the strikethrough.

self

Passed: a <PangoFontMetrics>.

a <PangoFontMetrics> structure

%return

Returned: a 32-bit integer.

the suggested strikethrough thickness, in Pango units.

Method: font-metrics:get-underline-position self ⇒ %return
Method: get-underline-position self ⇒ %return

Gets the suggested position to draw the underline.

The value returned is the distance above the baseline of the top of the underline. Since most fonts have underline positions beneath the baseline, this value is typically negative.

self

Passed: a <PangoFontMetrics>.

a <PangoFontMetrics> structure

%return

Returned: a 32-bit integer.

the suggested underline position, in Pango units.

Method: font-metrics:get-underline-thickness self ⇒ %return
Method: get-underline-thickness self ⇒ %return

Gets the suggested thickness to draw for the underline.

self

Passed: a <PangoFontMetrics>.

a <PangoFontMetrics> structure

%return

Returned: a 32-bit integer.

the suggested underline thickness, in Pango units.

Method: font-metrics:ref self ⇒ %return
Method: ref self ⇒ %return

Increase the reference count of a font metrics structure by one.

self

Passed: a <PangoFontMetrics>.

a <PangoFontMetrics> structure, may be #f

%return

Returned: a <PangoFontMetrics>, or #f.

self

Method: font-metrics:unref self
Method: unref self

Decrease the reference count of a font metrics structure by one.

If the result is zero, frees the structure and any associated memory.

self

Passed: a <PangoFontMetrics>.

a <PangoFontMetrics> structure, may be #f