2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _PANGOMM_FONT_H
4 #define _PANGOMM_FONT_H
13 * Copyright (C) 1998-1999 The gtkmm Development Team
15 * This library is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU Library General Public
17 * License as published by the Free Software Foundation; either
18 * version 2 of the License, or (at your option) any later version.
20 * This library is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 * Library General Public License for more details.
25 * You should have received a copy of the GNU Library General Public
26 * License along with this library; if not, write to the Free
27 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
31 #include <glibmm/object.h>
32 #include <pangomm/rectangle.h>
33 #include <pangomm/language.h>
34 #include <pangomm/glyph.h>
35 #include <pangomm/fontdescription.h>
36 #include <pangomm/fontmetrics.h>
37 #include <pangomm/coverage.h>
38 #include <pango/pango-font.h>
41 #ifndef DOXYGEN_SHOULD_SKIP_THIS
42 typedef struct _PangoFont PangoFont;
43 typedef struct _PangoFontClass PangoFontClass;
44 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
48 { class Font_Class; } // namespace Pango
52 const int SCALE = 1024;
53 const double SCALE_XX_SMALL = 0.5787037037037;
54 const double SCALE_X_SMALL = 0.6444444444444;
55 const double SCALE_SMALL = 0.8333333333333;
56 const double SCALE_MEDIUM = 1.0;
57 const double SCALE_LARGE = 1.2;
58 const double SCALE_X_LARGE = 1.4399999999999;
59 const double SCALE_XX_LARGE = 1.728;
61 #ifndef DOXYGEN_SHOULD_SKIP_THIS
63 #endif //DOXYGEN_SHOULD_SKIP_THIS
65 /** A Pango::Font is used to represent a font in a rendering-system-independent matter.
68 class Font : public Glib::Object
71 #ifndef DOXYGEN_SHOULD_SKIP_THIS
74 typedef Font CppObjectType;
75 typedef Font_Class CppClassType;
76 typedef PangoFont BaseObjectType;
77 typedef PangoFontClass BaseClassType;
79 private: friend class Font_Class;
80 static CppClassType font_class_;
85 Font& operator=(const Font&);
88 explicit Font(const Glib::ConstructParams& construct_params);
89 explicit Font(PangoFont* castitem);
91 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
96 #ifndef DOXYGEN_SHOULD_SKIP_THIS
97 static GType get_type() G_GNUC_CONST;
98 static GType get_base_type() G_GNUC_CONST;
101 ///Provides access to the underlying C GObject.
102 PangoFont* gobj() { return reinterpret_cast<PangoFont*>(gobject_); }
104 ///Provides access to the underlying C GObject.
105 const PangoFont* gobj() const { return reinterpret_cast<PangoFont*>(gobject_); }
107 ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
108 PangoFont* gobj_copy();
112 //This would return a PangoEngineShape* but the definition of the struct is surrounded by #define PANGO_ENABLE_BACKEND [...] #endif. So don't wrap it.
116 /** Return value: a newly-allocated Pango::FontDescription object.
117 * @return A newly-allocated Pango::FontDescription object.
119 FontDescription describe() const;
121 /** Return value: a newly-allocated Pango::FontDescription object.
122 * @return A newly-allocated Pango::FontDescription object.
126 FontDescription describe_with_absolute_size() const;
128 /** Computes the coverage map for a given font and language tag.
129 * @param language The language tag.
130 * @return A newly-allocated Pango::Coverage object.
132 Glib::RefPtr<Coverage> get_coverage(const Language& language) const;
134 /** Gets overall metric information for a font.
135 * The metrics may be substantially different for different scripts.
136 * However, this function overload returns the metrics for the entire font.
138 FontMetrics get_metrics() const;
140 /** Gets overall metric information for a font. Since the metrics may be
141 * substantially different for different scripts, a language tag can
142 * be provided to indicate that the metrics should be retrieved that
143 * correspond to the script(s) used by that language.
144 * @param language Language tag used to determine which script to get the metrics
146 * @return A Pango::Metrics object.
148 FontMetrics get_metrics(const Language& language) const;
151 /** Gets the logical and ink extents of a glyph within a font. The
152 * coordinate system for each rectangle has its origin at the
153 * base line and horizontal origin of the character with increasing
154 * coordinates extending to the right and down. The macros PANGO_ASCENT(),
155 * PANGO_DESCENT(), PANGO_LBEARING(), and PANGO_RBEARING can be used to convert
156 * from the extents rectangle to more traditional font metrics. The units
157 * of the rectangles are in 1/PANGO_SCALE of a device unit.
158 * @param glyph The glyph index.
159 * @param ink_rect Rectangle used to store the extents of the glyph as drawn.
160 * @param logical_rect Rectangle used to store the logical extents of the glyph.
162 void get_glyph_extents(Glyph glyph, Rectangle& ink_rect, Rectangle& logical_rect) const;
165 /** Gets the font map for which the font was created.
166 * @return The Pango::FontMap for the font
170 Glib::RefPtr<FontMap> get_font_map();
172 /** Gets the font map for which the font was created.
173 * @return The Pango::FontMap for the font
177 Glib::RefPtr<const FontMap> get_font_map() const;
179 /** Get the ink extents of a glyph within the font.
180 * @param glyph The glyph index.
181 * @return The extents of the glyph as drawn.
183 Rectangle get_glyph_ink_extents(Glyph glyph) const;
185 /** Gets the logical extents of a glyph within the font.
186 * @param glyph The glyph index.
187 * @return The logical extents of the glyph.
189 Rectangle get_glyph_logical_extents(Glyph glyph) const;
195 //C++ methods used to invoke GTK+ virtual functions:
196 #ifdef GLIBMM_VFUNCS_ENABLED
197 #endif //GLIBMM_VFUNCS_ENABLED
200 //GTK+ Virtual Functions (override these to change behaviour):
201 #ifdef GLIBMM_VFUNCS_ENABLED
202 #endif //GLIBMM_VFUNCS_ENABLED
204 //Default Signal Handlers::
205 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
206 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
211 } /* namespace Pango */
216 /** A Glib::wrap() method for this object.
218 * @param object The C instance.
219 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
220 * @result A C++ instance that wraps this C instance.
222 * @relates Pango::Font
224 Glib::RefPtr<Pango::Font> wrap(PangoFont* object, bool take_copy = false);
228 #endif /* _PANGOMM_FONT_H */