I've no idea here...
[gtkD.git] / src / pango / PgFontMetrics.d
blobdf4ba5cdd0e951bae8a51bbe34f3669558b22c0a
1 /*
2 * This file is part of duit.
4 * duit 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 * duit 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 duit; 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:
25 * inFile =
26 * outPack = pango
27 * outFile = PgFontMetrics
28 * strct = PangoFontMetrics
29 * realStrct=
30 * ctorStrct=
31 * clss = PgFontMetrics
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - pango_font_metrics_
40 * omit structs:
41 * omit prefixes:
42 * omit code:
43 * imports:
44 * - pango.PgContext
45 * - pango.PgItem
46 * - pango.PgLayout
47 * - pango.PgFontDescription
48 * - pango.PgFontFamily
49 * - pango.PgFontFace
50 * - pango.PgFontMap
51 * - pango.PgFontsetSimple
52 * - pango.PgAttribute
53 * - pango.PgAttributeList
54 * - pango.PgLanguage
55 * - pango.PgTabArray
56 * - pango.PgLayout
57 * - pango.PgLayoutIter
58 * - pango.PgScriptIter
59 * structWrap:
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
74 * local aliases:
77 module pango.PgFontMetrics;
79 private import pango.pangotypes;
81 private import lib.pango;
83 private import pango.PgContext;
84 private import pango.PgItem;
85 private import pango.PgLayout;
86 private import pango.PgFontDescription;
87 private import pango.PgFontFamily;
88 private import pango.PgFontFace;
89 private import pango.PgFontMap;
90 private import pango.PgFontsetSimple;
91 private import pango.PgAttribute;
92 private import pango.PgAttributeList;
93 private import pango.PgLanguage;
94 private import pango.PgTabArray;
95 private import pango.PgLayout;
96 private import pango.PgLayoutIter;
97 private import pango.PgScriptIter;
99 /**
100 * Description
101 * Pango supports a flexible architecture where a
102 * particular rendering architecture can supply an
103 * implementation of fonts. The PangoFont structure
104 * represents an abstract rendering-system-indepent font.
105 * Pango provides routines to list available fonts, and
106 * to load a font of a given description.
108 public class PgFontMetrics
111 /** the main Gtk struct */
112 protected PangoFontMetrics* pangoFontMetrics;
115 public PangoFontMetrics* getPgFontMetricsStruct()
117 return pangoFontMetrics;
121 /** the main Gtk struct as a void* */
122 protected void* getStruct()
124 return cast(void*)pangoFontMetrics;
128 * Sets our main struct and passes it to the parent class
130 public this (PangoFontMetrics* pangoFontMetrics)
132 this.pangoFontMetrics = pangoFontMetrics;
185 * Increase the reference count of a font metrics structure by one.
186 * metrics:
187 * a PangoFontMetrics structure
188 * Returns:
189 * metrics
191 public PangoFontMetrics* ref()
193 // PangoFontMetrics* pango_font_metrics_ref (PangoFontMetrics *metrics);
194 return pango_font_metrics_ref(pangoFontMetrics);
198 * Decrease the reference count of a font metrics structure by one. If
199 * the result is zero, frees the structure and any associated
200 * memory.
201 * metrics:
202 * a PangoFontMetrics structure
204 public void unref()
206 // void pango_font_metrics_unref (PangoFontMetrics *metrics);
207 pango_font_metrics_unref(pangoFontMetrics);
211 * Gets the ascent from a font metrics structure. The ascent is
212 * the distance from the baseline to the logical top of a line
213 * of text. (The logical top may be above or below the top of the
214 * actual drawn ink. It is necessary to lay out the text to figure
215 * where the ink will be.)
216 * metrics:
217 * a PangoFontMetrics structure
218 * Returns:
219 * the ascent, in Pango units. (1 point == PANGO_SCALE Pango units.)
221 public int getAscent()
223 // int pango_font_metrics_get_ascent (PangoFontMetrics *metrics);
224 return pango_font_metrics_get_ascent(pangoFontMetrics);
228 * Gets the descent from a font metrics structure. The descent is
229 * the distance from the baseline to the logical bottom of a line
230 * of text. (The logical bottom may be above or below the bottom of the
231 * actual drawn ink. It is necessary to lay out the text to figure
232 * where the ink will be.)
233 * metrics:
234 * a PangoFontMetrics structure
235 * Returns:
236 * the descent, in Pango units. (1 point == PANGO_SCALE Pango units.)
238 public int getDescent()
240 // int pango_font_metrics_get_descent (PangoFontMetrics *metrics);
241 return pango_font_metrics_get_descent(pangoFontMetrics);
245 * Gets the approximate character width for a font metrics structure.
246 * This is merely a representative value useful, for example, for
247 * determining the initial size for a window. Actual characters in
248 * text will be wider and narrower than this.
249 * metrics:
250 * a PangoFontMetrics structure
251 * Returns:
252 * the character width, in Pango units. (1 point == PANGO_SCALE Pango units.)
254 public int getApproximateCharWidth()
256 // int pango_font_metrics_get_approximate_char_width (PangoFontMetrics *metrics);
257 return pango_font_metrics_get_approximate_char_width(pangoFontMetrics);
261 * Gets the approximate digit width for a font metrics structure.
262 * This is merely a representative value useful, for example, for
263 * determining the initial size for a window. Actual digits in
264 * text can be wider or narrower than this, though this value
265 * is generally somewhat more accurate than the result of
266 * pango_font_metrics_get_approximate_char_width() for digits.
267 * metrics:
268 * a PangoFontMetrics structure
269 * Returns:
270 * the digit width, in Pango units. (1 point == PANGO_SCALE Pango units.)
272 public int getApproximateDigitWidth()
274 // int pango_font_metrics_get_approximate_digit_width (PangoFontMetrics *metrics);
275 return pango_font_metrics_get_approximate_digit_width(pangoFontMetrics);
279 * Gets the suggested thickness to draw for the underline.
280 * metrics:
281 * a PangoFontMetrics structure
282 * Returns:
283 * the suggested underline thickness, in Pango units.
284 * Since 1.6
286 public int getUnderlineThickness()
288 // int pango_font_metrics_get_underline_thickness (PangoFontMetrics *metrics);
289 return pango_font_metrics_get_underline_thickness(pangoFontMetrics);
293 * Gets the suggested position to draw the underline.
294 * The value returned is the distance above the
295 * baseline of the top of the underline. Since most fonts have
296 * underline positions beneath the baseline, this value is typically
297 * negative.
298 * metrics:
299 * a PangoFontMetrics structure
300 * Returns:
301 * the suggested underline position, in Pango units.
302 * Since 1.6
304 public int getUnderlinePosition()
306 // int pango_font_metrics_get_underline_position (PangoFontMetrics *metrics);
307 return pango_font_metrics_get_underline_position(pangoFontMetrics);
311 * Gets the suggested thickness to draw for the strikethrough.
312 * metrics:
313 * a PangoFontMetrics structure
314 * Returns:
315 * the suggested strikethrough thickness, in Pango units.
316 * Since 1.6
318 public int getStrikethroughThickness()
320 // int pango_font_metrics_get_strikethrough_thickness (PangoFontMetrics *metrics);
321 return pango_font_metrics_get_strikethrough_thickness(pangoFontMetrics);
325 * Gets the suggested position to draw the strikethrough.
326 * The value returned is the distance above the
327 * baseline of the top of the strikethrough.
328 * metrics:
329 * a PangoFontMetrics structure
330 * Returns:
331 * the suggested strikethrough position, in Pango units.
332 * Since 1.6
334 public int getStrikethroughPosition()
336 // int pango_font_metrics_get_strikethrough_position (PangoFontMetrics *metrics);
337 return pango_font_metrics_get_strikethrough_position(pangoFontMetrics);