2 * This file is part of gtkD.
4 * gtkD is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * gtkD is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with gtkD; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
27 * outFile = PgFontMetrics
28 * strct = PangoFontMetrics
31 * clss = PgFontMetrics
39 * - pango_font_metrics_
47 * - pango.PgFontDescription
48 * - pango.PgFontFamily
51 * - pango.PgFontsetSimple
53 * - pango.PgAttributeList
57 * - pango.PgLayoutIter
58 * - pango.PgScriptIter
60 * - PangoAttribute* -> PgAttribute
61 * - PangoAttributeList* -> PgAttributeList
62 * - PangoContext* -> PgContext
63 * - PangoFontDescription* -> PgFontDescription
64 * - PangoFontFace* -> PgFontFace
65 * - PangoFontFamily* -> PgFontFamily
66 * - PangoFontMap* -> PgFontMap
67 * - PangoFontsetSimple* -> PgFontsetSimple
68 * - PangoItem* -> PgItem
69 * - PangoLanguage* -> PgLanguage
70 * - PangoLayout* -> PgLayout
71 * - PangoLayoutIter* -> PgLayoutIter
72 * - PangoScriptIter* -> PgScriptIter
73 * - PangoTabArray* -> PgTabArray
78 module pango
.PgFontMetrics
;
84 import tango
.io
.Stdout
; // use the tango loging?
88 private import gtkc
.pangotypes
;
90 private import gtkc
.pango
;
93 private import pango
.PgContext
;
94 private import pango
.PgItem
;
95 private import pango
.PgLayout
;
96 private import pango
.PgFontDescription
;
97 private import pango
.PgFontFamily
;
98 private import pango
.PgFontFace
;
99 private import pango
.PgFontMap
;
100 private import pango
.PgFontsetSimple
;
101 private import pango
.PgAttribute
;
102 private import pango
.PgAttributeList
;
103 private import pango
.PgLanguage
;
104 private import pango
.PgTabArray
;
105 private import pango
.PgLayout
;
106 private import pango
.PgLayoutIter
;
107 private import pango
.PgScriptIter
;
114 * Pango supports a flexible architecture where a
115 * particular rendering architecture can supply an
116 * implementation of fonts. The PangoFont structure
117 * represents an abstract rendering-system-independent font.
118 * Pango provides routines to list available fonts, and
119 * to load a font of a given description.
121 public class PgFontMetrics
124 /** the main Gtk struct */
125 protected PangoFontMetrics
* pangoFontMetrics
;
128 public PangoFontMetrics
* getPgFontMetricsStruct()
130 return pangoFontMetrics
;
134 /** the main Gtk struct as a void* */
135 protected void* getStruct()
137 return cast(void*)pangoFontMetrics
;
141 * Sets our main struct and passes it to the parent class
143 public this (PangoFontMetrics
* pangoFontMetrics
)
147 if ( pangoFontMetrics
is null )
152 Stdout("struct pangoFontMetrics is null on constructor").newline
;
156 printf("struct pangoFontMetrics is null on constructor");
163 assert(pangoFontMetrics
!is null, "struct pangoFontMetrics is null on constructor");
165 this.pangoFontMetrics
= pangoFontMetrics
;
218 * Increase the reference count of a font metrics structure by one.
220 * a PangoFontMetrics structure
224 public PangoFontMetrics
* doref()
226 // PangoFontMetrics* pango_font_metrics_ref (PangoFontMetrics *metrics);
227 return pango_font_metrics_ref(pangoFontMetrics
);
231 * Decrease the reference count of a font metrics structure by one. If
232 * the result is zero, frees the structure and any associated
235 * a PangoFontMetrics structure
239 // void pango_font_metrics_unref (PangoFontMetrics *metrics);
240 pango_font_metrics_unref(pangoFontMetrics
);
244 * Gets the ascent from a font metrics structure. The ascent is
245 * the distance from the baseline to the logical top of a line
246 * of text. (The logical top may be above or below the top of the
247 * actual drawn ink. It is necessary to lay out the text to figure
248 * where the ink will be.)
250 * a PangoFontMetrics structure
252 * the ascent, in Pango units. (1 point == PANGO_SCALE Pango units.)
254 public int getAscent()
256 // int pango_font_metrics_get_ascent (PangoFontMetrics *metrics);
257 return pango_font_metrics_get_ascent(pangoFontMetrics
);
261 * Gets the descent from a font metrics structure. The descent is
262 * the distance from the baseline to the logical bottom of a line
263 * of text. (The logical bottom may be above or below the bottom of the
264 * actual drawn ink. It is necessary to lay out the text to figure
265 * where the ink will be.)
267 * a PangoFontMetrics structure
269 * the descent, in Pango units. (1 point == PANGO_SCALE Pango units.)
271 public int getDescent()
273 // int pango_font_metrics_get_descent (PangoFontMetrics *metrics);
274 return pango_font_metrics_get_descent(pangoFontMetrics
);
278 * Gets the approximate character width for a font metrics structure.
279 * This is merely a representative value useful, for example, for
280 * determining the initial size for a window. Actual characters in
281 * text will be wider and narrower than this.
283 * a PangoFontMetrics structure
285 * the character width, in Pango units. (1 point == PANGO_SCALE Pango units.)
287 public int getApproximateCharWidth()
289 // int pango_font_metrics_get_approximate_char_width (PangoFontMetrics *metrics);
290 return pango_font_metrics_get_approximate_char_width(pangoFontMetrics
);
294 * Gets the approximate digit width for a font metrics structure.
295 * This is merely a representative value useful, for example, for
296 * determining the initial size for a window. Actual digits in
297 * text can be wider or narrower than this, though this value
298 * is generally somewhat more accurate than the result of
299 * pango_font_metrics_get_approximate_char_width() for digits.
301 * a PangoFontMetrics structure
303 * the digit width, in Pango units. (1 point == PANGO_SCALE Pango units.)
305 public int getApproximateDigitWidth()
307 // int pango_font_metrics_get_approximate_digit_width (PangoFontMetrics *metrics);
308 return pango_font_metrics_get_approximate_digit_width(pangoFontMetrics
);
312 * Gets the suggested thickness to draw for the underline.
314 * a PangoFontMetrics structure
316 * the suggested underline thickness, in Pango units.
319 public int getUnderlineThickness()
321 // int pango_font_metrics_get_underline_thickness (PangoFontMetrics *metrics);
322 return pango_font_metrics_get_underline_thickness(pangoFontMetrics
);
326 * Gets the suggested position to draw the underline.
327 * The value returned is the distance above the
328 * baseline of the top of the underline. Since most fonts have
329 * underline positions beneath the baseline, this value is typically
332 * a PangoFontMetrics structure
334 * the suggested underline position, in Pango units.
337 public int getUnderlinePosition()
339 // int pango_font_metrics_get_underline_position (PangoFontMetrics *metrics);
340 return pango_font_metrics_get_underline_position(pangoFontMetrics
);
344 * Gets the suggested thickness to draw for the strikethrough.
346 * a PangoFontMetrics structure
348 * the suggested strikethrough thickness, in Pango units.
351 public int getStrikethroughThickness()
353 // int pango_font_metrics_get_strikethrough_thickness (PangoFontMetrics *metrics);
354 return pango_font_metrics_get_strikethrough_thickness(pangoFontMetrics
);
358 * Gets the suggested position to draw the strikethrough.
359 * The value returned is the distance above the
360 * baseline of the top of the strikethrough.
362 * a PangoFontMetrics structure
364 * the suggested strikethrough position, in Pango units.
367 public int getStrikethroughPosition()
369 // int pango_font_metrics_get_strikethrough_position (PangoFontMetrics *metrics);
370 return pango_font_metrics_get_strikethrough_position(pangoFontMetrics
);