PgFontMetrics

A PangoFontMetrics structure holds the overall metric information for a font (possibly 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.

Constructors

this
this(PangoFontMetrics* pangoFontMetrics, bool ownedRef)

Sets our main struct and passes it to the parent class.

this
this()

Creates a new PangoFontMetrics structure. This is only for internal use by Pango backends and there is no public way to set the fields of the structure.

Destructor

A destructor is present on this object, but not explicitly documented in the source.

Members

Functions

getApproximateCharWidth
int getApproximateCharWidth()

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.

getApproximateDigitWidth
int getApproximateDigitWidth()

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 pango_font_metrics_get_approximate_char_width() for digits.

getAscent
int getAscent()

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

getDescent
int getDescent()

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

getPgFontMetricsStruct
PangoFontMetrics* getPgFontMetricsStruct(bool transferOwnership)

Get the main Gtk struct

getStrikethroughPosition
int getStrikethroughPosition()

Gets the suggested position to draw the strikethrough. The value returned is the distance <emphasis>above</emphasis> the baseline of the top of the strikethrough.

getStrikethroughThickness
int getStrikethroughThickness()

Gets the suggested thickness to draw for the strikethrough.

getStruct
void* getStruct()

the main Gtk struct as a void*

getUnderlinePosition
int getUnderlinePosition()

Gets the suggested position to draw the underline. The value returned is the distance <emphasis>above</emphasis> the baseline of the top of the underline. Since most fonts have underline positions beneath the baseline, this value is typically negative.

getUnderlineThickness
int getUnderlineThickness()

Gets the suggested thickness to draw for the underline.

ref_
PgFontMetrics ref_()

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

unref
void unref()

Decrease the reference count of a font metrics structure by one. If the result is zero, frees the structure and any associated memory.

Static functions

getType
GType getType()

Variables

pangoFontMetrics
PangoFontMetrics* pangoFontMetrics;

the main Gtk struct