2
// Generated by gtkmmproc -- DO NOT MODIFY!
3
#ifndef _PANGOMM_FONTMETRICS_H
4
#define _PANGOMM_FONTMETRICS_H
12
* Copyright (C) 1998-1999 The gtkmm Development Team
14
* This library is free software; you can redistribute it and/or
15
* modify it under the terms of the GNU Library General Public
16
* License as published by the Free Software Foundation; either
17
* version 2 of the License, or (at your option) any later version.
19
* This library is distributed in the hope that it will be useful,
20
* but WITHOUT ANY WARRANTY; without even the implied warranty of
21
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22
* Library General Public License for more details.
24
* You should have received a copy of the GNU Library General Public
25
* License along with this library; if not, write to the Free
26
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29
#include <pango/pango-font.h>
32
#ifndef DOXYGEN_SHOULD_SKIP_THIS
33
extern "C" { typedef struct _PangoFontMetrics PangoFontMetrics; }
39
/** A Pango::FontMetrics holds the overall metric information for a font (possibly restricted to a script).
44
#ifndef DOXYGEN_SHOULD_SKIP_THIS
45
typedef FontMetrics CppObjectType;
46
typedef PangoFontMetrics BaseObjectType;
48
static GType get_type() G_GNUC_CONST;
49
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
53
explicit FontMetrics(PangoFontMetrics* gobject, bool make_a_copy = true);
55
FontMetrics(const FontMetrics& other);
56
FontMetrics& operator=(const FontMetrics& other);
60
void swap(FontMetrics& other);
62
///Provides access to the underlying C instance.
63
PangoFontMetrics* gobj() { return gobject_; }
65
///Provides access to the underlying C instance.
66
const PangoFontMetrics* gobj() const { return gobject_; }
68
///Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs.
69
PangoFontMetrics* gobj_copy() const;
72
PangoFontMetrics* gobject_;
79
/** Gets the ascent from a font metrics structure. The ascent is
80
* the distance from the baseline to the logical top of a line
81
* of text. (The logical top may be above or below the top of the
82
* actual drawn ink. It is necessary to lay out the text to figure
83
* where the ink will be.)
84
* @return The ascent, in pango units. (1 point == Pango::SCALE pango units.).
86
int get_ascent() const;
88
/** Gets the descent from a font metrics structure. The descent is
89
* the distance from the baseline to the logical bottom of a line
90
* of text. (The logical bottom may be above or below the bottom of the
91
* actual drawn ink. It is necessary to lay out the text to figure
92
* where the ink will be.)
93
* @return The descent, in pango units. (1 point == Pango::SCALE pango units.).
95
int get_descent() const;
97
/** Gets the approximate character width for a font metrics structure.
98
* This is merely a representative value useful, for example, for
99
* determining the initial size for a window. Actual characters in
100
* text will be wider and narrower than this.
101
* @return The character width, in pango units. (1 point == Pango::SCALE pango units.).
103
int get_approximate_char_width() const;
105
/** Gets the approximate digit width for a font metrics structure.
106
* This is merely a representative value useful, for example, for
107
* determining the initial size for a window. Actual digits in
108
* text can be wider and narrower than this, though this value
109
* is generally somewhat more accurate than the result of
110
* pango_font_metrics_get_approximate_digit_width().
111
* @return The digit width, in pango units. (1 point == Pango::SCALE pango units.).
113
int get_approximate_digit_width() const;
116
/** Gets the suggested position to draw the underline.
117
* The value returned is the distance <em>above</em> the
118
* baseline of the top of the underline. Since most fonts have
119
* underline positions beneath the baseline, this value is typically
121
* @return The suggested underline position, in Pango units.
125
int get_underline_position() const;
127
/** Gets the suggested thickness to draw for the underline.
128
* @return The suggested underline thickness, in Pango units.
132
int get_underline_thickness() const;
134
/** Gets the suggested position to draw the strikethrough.
135
* The value returned is the distance <em>above</em> the
136
* baseline of the top of the strikethrough.
137
* @return The suggested strikethrough position, in Pango units.
141
int get_strikethrough_position() const;
143
/** Gets the suggested thickness to draw for the strikethrough.
144
* @return The suggested strikethrough thickness, in Pango units.
148
int get_strikethrough_thickness() const;
159
/** @relates Pango::FontMetrics
160
* @param lhs The left-hand side
161
* @param rhs The right-hand side
163
inline void swap(FontMetrics& lhs, FontMetrics& rhs)
171
/** @relates Pango::FontMetrics
172
* @param object The C instance
173
* @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
174
* @result A C++ instance that wraps this C instance.
176
Pango::FontMetrics wrap(PangoFontMetrics* object, bool take_copy = false);
178
#ifndef DOXYGEN_SHOULD_SKIP_THIS
180
class Value<Pango::FontMetrics> : public Glib::Value_Boxed<Pango::FontMetrics>
182
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
186
#endif /* _PANGOMM_FONTMETRICS_H */