Xfce Foundation Classes
Main Page  | IndexNamespace List  |  Alphabetical List  |  Class List  |  File List


Public Member Functions
Xfc::Pango::FontMetrics Class Reference

A PangoFontMetrics C++ wrapper class. More...

#include <xfc/pango/font.hh>

Inheritance diagram for Xfc::Pango::FontMetrics:
Xfc::G::Boxed Xfc::Object Xfc::Trackable

List of all members.

Public Member Functions

Constructors

Detailed Description

A PangoFontMetrics C++ wrapper class.

FontMetrics structure holds the overall metric information for a font.


Constructor & Destructor Documentation

Xfc::Pango::FontMetrics::FontMetrics ( PangoFontMetrics *  metrics) [explicit]

Construct a new font metrics from an existing PangoFontMetrics.

Parameters:
metricsA pointer to a PangoFontMetrics.

The metrics can be a newly created PangoFontMetrics or an existing PangoFontMetrics. The font metrics object created is a temporary object. It doesn't take over the ownership of PangoFontMetrics and PangoFontMetrics is not freed by the destructor.

Xfc::Pango::FontMetrics::FontMetrics ( PangoFontMetrics *  metrics,
bool  copy 
)

Construct a new font metrics from an existing PangoFontMetrics.

Parameters:
metricsA pointer to a PangoFontMetrics.
copyWhether the FontMetrics object should make a copy of PangoFontMetrics or not.

The metrics can be a newly created PangoFontMetrics or an existing PangoFontMetrics. If copy is true FontMetrics will make a copy of PangoFontMetrics. If copy is false FontMetrics wont make a copy but instead takes over the ownership of PangoFontMetrics. Either way, the destructor will free PangoFontMetrics when the FontMetrics object is destroyed. This constructor is used by G::Boxed::wrap() to wrap PangoFontMetrics objects in a C++ wrapper.

Copy constructor.

Parameters:
srcThe source FontMetrics.

Member Function Documentation

Gets the approximate character width for the font metrics structure.

Returns:
The character width, in pango units. (1 point == PANGO_SCALE pango units.)

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.

Gets the approximate digit width for the font metrics structure.

Returns:
The digit width, in pango units. (1 point == PANGO_SCALE pango units.)

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

Returns the ascent from a font metrics structure.

Returns:
The ascent, in pango units. (1 point == PANGO_SCALE 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.)

Gets the descent from a font metrics structure.

Returns:
The descent, in pango units. (1 point == PANGO_SCALE 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.)

Gets the suggested position to draw the strikethrough.

Returns:
The suggested strikethrough position, in Pango units.

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

Gets the suggested thickness to draw for the strikethrough.

Returns:
The suggested strikethrough thickness, in Pango units.

Gets the suggested position to draw the underline.

Returns:
The suggested underline position, in Pango units.

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.

Gets the suggested thickness to draw for the underline.

Returns:
The suggested underline thickness, in Pango units.
FontMetrics& Xfc::Pango::FontMetrics::operator= ( const FontMetrics src)

Assignment operator.

Parameters:
srcThe source FontMetrics.

The documentation for this class was generated from the following file:
Xfce Foundation Classes
Copyright © 2004-2005 The XFC Development Team XFC