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:
25 * inFile = cairo-Scaled-Fonts.html
27 * outFile = ScaledFont
28 * strct = cairo_scaled_font_t
39 * - cairo_scaled_font_
50 module cairoLib
.ScaledFont
;
56 import tango
.io
.Stdout
; // use the tango loging?
60 private import gtkc
.cairoLibtypes
;
62 private import gtkc
.cairoLib
;
65 private import glib
.Str
;
73 public class ScaledFont
76 /** the main Gtk struct */
77 protected cairo_scaled_font_t
* cairo_scaled_font
;
80 public cairo_scaled_font_t
* getScaledFontStruct()
82 return cairo_scaled_font
;
86 /** the main Gtk struct as a void* */
87 protected void* getStruct()
89 return cast(void*)cairo_scaled_font
;
93 * Sets our main struct and passes it to the parent class
95 public this (cairo_scaled_font_t
* cairo_scaled_font
)
99 if ( cairo_scaled_font
is null )
104 Stdout("struct cairo_scaled_font is null on constructor").newline
;
108 printf("struct cairo_scaled_font is null on constructor");
115 assert(cairo_scaled_font
!is null, "struct cairo_scaled_font is null on constructor");
117 this.cairo_scaled_font
= cairo_scaled_font
;
125 * Creates a cairo_scaled_font_t object from a font face and matrices that
126 * describe the size of the font and the environment in which it will
129 * a cairo_font_face_t
131 * font space to user space transformation matrix for the
132 * font. In the simplest case of a N point font, this matrix is
133 * just a scale by N, but it can also be used to shear the font
134 * or stretch it unequally along the two axes. See
135 * cairo_set_font_matrix().
137 * user to device transformation matrix with which the font will
140 * options to use when getting metrics for the font and
143 * a newly created cairo_scaled_font_t. Destroy with
144 * cairo_scaled_font_destroy()
146 public static cairo_scaled_font_t
* create(cairo_font_face_t
* fontFace
, cairo_matrix_t
* fontMatrix
, cairo_matrix_t
* ctm
, cairo_font_options_t
* options
)
148 // cairo_scaled_font_t* cairo_scaled_font_create (cairo_font_face_t *font_face, const cairo_matrix_t *font_matrix, const cairo_matrix_t *ctm, const cairo_font_options_t *options);
149 return cairo_scaled_font_create(fontFace
, fontMatrix
, ctm
, options
);
153 * Increases the reference count on scaled_font by one. This prevents
154 * scaled_font from being destroyed until a matching call to
155 * cairo_scaled_font_destroy() is made.
157 * a cairo_scaled_font_t, (may be NULL in which case
158 * this function does nothing)
160 * the referenced cairo_scaled_font_t
162 public cairo_scaled_font_t
* reference()
164 // cairo_scaled_font_t* cairo_scaled_font_reference (cairo_scaled_font_t *scaled_font);
165 return cairo_scaled_font_reference(cairo_scaled_font
);
169 * Decreases the reference count on font by one. If the result
170 * is zero, then font and all associated resources are freed.
171 * See cairo_scaled_font_reference().
173 * a cairo_scaled_font_t
175 public void destroy()
177 // void cairo_scaled_font_destroy (cairo_scaled_font_t *scaled_font);
178 cairo_scaled_font_destroy(cairo_scaled_font
);
182 * Checks whether an error has previously occurred for this
185 * a cairo_scaled_font_t
187 * CAIRO_STATUS_SUCCESS or another error such as
188 * CAIRO_STATUS_NO_MEMORY.
190 public cairo_status_t
status()
192 // cairo_status_t cairo_scaled_font_status (cairo_scaled_font_t *scaled_font);
193 return cairo_scaled_font_status(cairo_scaled_font
);
198 * Gets the metrics for a cairo_scaled_font_t.
200 * a cairo_scaled_font_t
202 * a cairo_font_extents_t which to store the retrieved extents.
204 public void extents(cairo_font_extents_t
* extents
)
206 // void cairo_scaled_font_extents (cairo_scaled_font_t *scaled_font, cairo_font_extents_t *extents);
207 cairo_scaled_font_extents(cairo_scaled_font
, extents
);
212 * Gets the extents for a string of text. The extents describe a
213 * user-space rectangle that encloses the "inked" portion of the text
214 * drawn at the origin (0,0) (as it would be drawn by cairo_show_text()
215 * if the cairo graphics state were set to the same font_face,
216 * font_matrix, ctm, and font_options as scaled_font). Additionally,
217 * the x_advance and y_advance values indicate the amount by which the
218 * current point would be advanced by cairo_show_text().
219 * Note that whitespace characters do not directly contribute to the
220 * size of the rectangle (extents.width and extents.height). They do
221 * contribute indirectly by changing the position of non-whitespace
222 * characters. In particular, trailing whitespace characters are
223 * likely to not affect the size of the rectangle, though they will
224 * affect the x_advance and y_advance values.
226 * a cairo_scaled_font_t
228 * a string of text, encoded in UTF-8
230 * a cairo_text_extents_t which to store the retrieved extents.
233 public void textExtents(char[] utf8
, cairo_text_extents_t
* extents
)
235 // void cairo_scaled_font_text_extents (cairo_scaled_font_t *scaled_font, const char *utf8, cairo_text_extents_t *extents);
236 cairo_scaled_font_text_extents(cairo_scaled_font
, Str
.toStringz(utf8
), extents
);
240 * Gets the extents for an array of glyphs. The extents describe a
241 * user-space rectangle that encloses the "inked" portion of the
242 * glyphs, (as they would be drawn by cairo_show_glyphs() if the cairo
243 * graphics state were set to the same font_face, font_matrix, ctm,
244 * and font_options as scaled_font). Additionally, the x_advance and
245 * y_advance values indicate the amount by which the current point
246 * would be advanced by cairo_show_glyphs.
247 * Note that whitespace glyphs do not contribute to the size of the
248 * rectangle (extents.width and extents.height).
250 * a cairo_scaled_font_t
252 * an array of glyph IDs with X and Y offsets.
254 * the number of glyphs in the glyphs array
256 * a cairo_text_extents_t which to store the retrieved extents.
258 public void glyphExtents(cairo_glyph_t
* glyphs
, int numGlyphs
, cairo_text_extents_t
* extents
)
260 // void cairo_scaled_font_glyph_extents (cairo_scaled_font_t *scaled_font, cairo_glyph_t *glyphs, int num_glyphs, cairo_text_extents_t *extents);
261 cairo_scaled_font_glyph_extents(cairo_scaled_font
, glyphs
, numGlyphs
, extents
);
265 * Gets the font face that this scaled font was created for.
267 * a cairo_scaled_font_t
269 * The cairo_font_face_t with which scaled_font was
273 public cairo_font_face_t
* getFontFace()
275 // cairo_font_face_t* cairo_scaled_font_get_font_face (cairo_scaled_font_t *scaled_font);
276 return cairo_scaled_font_get_font_face(cairo_scaled_font
);
280 * Stores the font options with which scaled_font was created into
283 * a cairo_scaled_font_t
285 * return value for the font options
288 public void getFontOptions(cairo_font_options_t
* options
)
290 // void cairo_scaled_font_get_font_options (cairo_scaled_font_t *scaled_font, cairo_font_options_t *options);
291 cairo_scaled_font_get_font_options(cairo_scaled_font
, options
);
295 * Stores the font matrix with which scaled_font was created into
298 * a cairo_scaled_font_t
300 * return value for the matrix
303 public void getFontMatrix(cairo_matrix_t
* fontMatrix
)
305 // void cairo_scaled_font_get_font_matrix (cairo_scaled_font_t *scaled_font, cairo_matrix_t *font_matrix);
306 cairo_scaled_font_get_font_matrix(cairo_scaled_font
, fontMatrix
);
310 * Stores the CTM with which scaled_font was created into ctm.
312 * a cairo_scaled_font_t
314 * return value for the CTM
317 public void getCtm(cairo_matrix_t
* ctm
)
319 // void cairo_scaled_font_get_ctm (cairo_scaled_font_t *scaled_font, cairo_matrix_t *ctm);
320 cairo_scaled_font_get_ctm(cairo_scaled_font
, ctm
);
324 * This function returns the type of the backend used to create
325 * a scaled font. See cairo_font_type_t for available types.
327 * a cairo_scaled_font_t
329 * The type of scaled_font.
332 public cairo_font_type_t
getType()
334 // cairo_font_type_t cairo_scaled_font_get_type (cairo_scaled_font_t *scaled_font);
335 return cairo_scaled_font_get_type(cairo_scaled_font
);