Reference Manual

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

# Inti::Pango::FontMetrics Class Reference

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

`#include <inti/pango/font.h>`

Inheritance diagram for Inti::Pango::FontMetrics:

List of all members.

## Public Member Functions

Constructors

- FontMetrics (PangoFontMetrics *metrics)
    Construct a new font metrics from an existing PangoFontMetrics.
- FontMetrics (PangoFontMetrics *metrics, bool copy)
    Construct a new font metrics from an existing PangoFontMetrics.
- FontMetrics (const FontMetrics &src)
    Copy constructor.
- virtual ~FontMetrics ()
    Destructor.
- FontMetrics & operator= (const FontMetrics &src)
    Assignment operator.

Accessors

- PangoFontMetrics * pango_font_metrics () const
    Get a pointer to the PangoFontMetrics structure.
- operator PangoFontMetrics * () const
    Conversion operator; safely converts a FontMetrics to a PangoFontMetrics pointer.
- int get_ascent () const
    Returns the ascent from a font metrics structure.
- int get_descent () const
    Gets the descent from a font metrics structure.
- int get_approximate_char_width () const
    Gets the approximate character width for the font metrics structure.
- int get_approximate_digit_width () const
    Gets the approximate digit width for the font metrics structure.

## Detailed Description

A PangoFontMetrics C++ wrapper class.

FontMetrics structure holds the overall metric information for a font.

## Constructor & Destructor Documentation

Inti::Pango::FontMetrics::FontMetrics | ( | PangoFontMetrics * | metrics | ) | `[explicit]`

Construct a new font metrics from an existing PangoFontMetrics.

Parameters:

  metrics | A 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.

Inti::Pango::FontMetrics::FontMetrics | ( | PangoFontMetrics * | metrics,
|  | bool | copy
| ) |

Construct a new font metrics from an existing PangoFontMetrics.

Parameters:

  metrics | A pointer to a PangoFontMetrics.
  copy | Whether 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.

Inti::Pango::FontMetrics::FontMetrics | ( | const FontMetrics & | src | ) |

Copy constructor.

Parameters:

  src | The source FontMetrics.

## Member Function Documentation

int Inti::Pango::FontMetrics::get_approximate_char_width | ( |  | ) | const

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.

int Inti::Pango::FontMetrics::get_approximate_digit_width | ( |  | ) | const

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.

int Inti::Pango::FontMetrics::get_ascent | ( |  | ) | const

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

int Inti::Pango::FontMetrics::get_descent | ( |  | ) | const

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

FontMetrics& Inti::Pango::FontMetrics::operator= | ( | const FontMetrics & | src | ) |

Assignment operator.

Parameters:

  src | The source FontMetrics.

The documentation for this class was generated from the following file:

- font.h

Main Page - Footer