1 /* 2 * Distributed under the Boost Software License, Version 1.0. 3 * (See accompanying file LICENSE_1_0.txt or copy at 4 * http://www.boost.org/LICENSE_1_0.txt) 5 */ 6 module pango.c.fontset; 7 8 import pango.c.coverage; 9 import pango.c.types; 10 import pango.c.font; 11 12 import glib; 13 import gobject; 14 15 extern (C): 16 17 /* 18 * PangoFontset 19 */ 20 21 version (Backend) {} 22 else { 23 struct PangoFontset; 24 } 25 26 pure GType pango_fontset_get_type (); 27 28 /** 29 * PangoFontsetForeachFunc: 30 * @fontset: a #PangoFontset 31 * @font: a font from @fontset 32 * @user_data: callback data 33 * 34 * A callback function used by pango_fontset_foreach() when enumerating 35 * the fonts in a fontset. 36 * 37 * Returns: if %TRUE, stop iteration and return immediately. 38 * 39 * Since: 1.4 40 **/ 41 alias PangoFontsetForeachFunc = gboolean function (PangoFontset *fontset, 42 PangoFont *font, 43 gpointer user_data); 44 45 PangoFont * pango_fontset_get_font (PangoFontset *fontset, 46 guint wc); 47 PangoFontMetrics *pango_fontset_get_metrics (PangoFontset *fontset); 48 void pango_fontset_foreach (PangoFontset *fontset, 49 PangoFontsetForeachFunc func, 50 gpointer data); 51 52 53 version (Backend) 54 { 55 /** 56 * PangoFontset: 57 * 58 * A #PangoFontset represents a set of #PangoFont to use 59 * when rendering text. It is the result of resolving a 60 * #PangoFontDescription against a particular #PangoContext. 61 * It has operations for finding the component font for 62 * a particular Unicode character, and for finding a composite 63 * set of metrics for the entire fontset. 64 */ 65 struct PangoFontset 66 { 67 GObject parent_instance; 68 }; 69 70 /** 71 * PangoFontsetClass: 72 * @parent_class: parent #GObjectClass. 73 * @get_font: a function to get the font in the fontset that contains the 74 * best glyph for the given Unicode character; see pango_fontset_get_font(). 75 * @get_metrics: a function to get overall metric information for the fonts 76 * in the fontset; see pango_fontset_get_metrics(). 77 * @get_language: a function to get the language of the fontset. 78 * @foreach: a function to loop over the fonts in the fontset. See 79 * pango_fontset_foreach(). 80 * 81 * The #PangoFontsetClass structure holds the virtual functions for 82 * a particular #PangoFontset implementation. 83 */ 84 struct PangoFontsetClass 85 { 86 GObjectClass parent_class; 87 88 /*< public >*/ 89 90 PangoFont * function (PangoFontset *fontset, 91 guint wc) get_font; 92 93 PangoFontMetrics *function (PangoFontset *fontset) get_metrics; 94 PangoLanguage * function (PangoFontset *fontset) get_language; 95 void function (PangoFontset *fontset, 96 PangoFontsetForeachFunc func, 97 gpointer data) foreach_; 98 99 /*< private >*/ 100 101 /* Padding for future expansion */ 102 void function () _pango_reserved1; 103 void function () _pango_reserved2; 104 void function () _pango_reserved3; 105 void function () _pango_reserved4; 106 }; 107 108 /* 109 * PangoFontsetSimple 110 */ 111 112 struct PangoFontsetSimple; 113 struct PangoFontsetSimpleClass; 114 115 pure GType pango_fontset_simple_get_type (); 116 117 PangoFontsetSimple * pango_fontset_simple_new (PangoLanguage *language); 118 void pango_fontset_simple_append (PangoFontsetSimple *fontset, 119 PangoFont *font); 120 int pango_fontset_simple_size (PangoFontsetSimple *fontset); 121 122 }