pango-fontset.h 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. /* Pango
  2. * pango-fontset.h: Font set handling
  3. *
  4. * Copyright (C) 2001 Red Hat Software
  5. *
  6. * This library is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Library General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2 of the License, or (at your option) any later version.
  10. *
  11. * This library is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Library General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Library General Public
  17. * License along with this library; if not, write to the
  18. * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  19. * Boston, MA 02111-1307, USA.
  20. */
  21. #ifndef __PANGO_FONTSET_H__
  22. #define __PANGO_FONTSET_H__
  23. #include <pango/pango-coverage.h>
  24. #include <pango/pango-types.h>
  25. #include <glib-object.h>
  26. G_BEGIN_DECLS
  27. /*
  28. * PangoFontset
  29. */
  30. /**
  31. * PANGO_TYPE_FONTSET:
  32. *
  33. * The #GObject type for #PangoFontset.
  34. */
  35. #define PANGO_TYPE_FONTSET (pango_fontset_get_type ())
  36. #define PANGO_FONTSET(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FONTSET, PangoFontset))
  37. #define PANGO_IS_FONTSET(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FONTSET))
  38. PANGO_AVAILABLE_IN_ALL
  39. GType pango_fontset_get_type (void) G_GNUC_CONST;
  40. typedef struct _PangoFontset PangoFontset;
  41. /**
  42. * PangoFontsetForeachFunc:
  43. * @fontset: a #PangoFontset
  44. * @font: a font from @fontset
  45. * @user_data: callback data
  46. *
  47. * A callback function used by pango_fontset_foreach() when enumerating
  48. * the fonts in a fontset.
  49. *
  50. * Returns: if %TRUE, stop iteration and return immediately.
  51. *
  52. * Since: 1.4
  53. **/
  54. typedef gboolean (*PangoFontsetForeachFunc) (PangoFontset *fontset,
  55. PangoFont *font,
  56. gpointer user_data);
  57. PANGO_AVAILABLE_IN_ALL
  58. PangoFont * pango_fontset_get_font (PangoFontset *fontset,
  59. guint wc);
  60. PANGO_AVAILABLE_IN_ALL
  61. PangoFontMetrics *pango_fontset_get_metrics (PangoFontset *fontset);
  62. PANGO_AVAILABLE_IN_1_4
  63. void pango_fontset_foreach (PangoFontset *fontset,
  64. PangoFontsetForeachFunc func,
  65. gpointer data);
  66. #ifdef PANGO_ENABLE_BACKEND
  67. typedef struct _PangoFontsetClass PangoFontsetClass;
  68. #define PANGO_FONTSET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_FONTSET, PangoFontsetClass))
  69. #define PANGO_IS_FONTSET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_FONTSET))
  70. #define PANGO_FONTSET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_FONTSET, PangoFontsetClass))
  71. /**
  72. * PangoFontset:
  73. *
  74. * A #PangoFontset represents a set of #PangoFont to use
  75. * when rendering text. It is the result of resolving a
  76. * #PangoFontDescription against a particular #PangoContext.
  77. * It has operations for finding the component font for
  78. * a particular Unicode character, and for finding a composite
  79. * set of metrics for the entire fontset.
  80. */
  81. struct _PangoFontset
  82. {
  83. GObject parent_instance;
  84. };
  85. /**
  86. * PangoFontsetClass:
  87. * @parent_class: parent #GObjectClass.
  88. * @get_font: a function to get the font in the fontset that contains the
  89. * best glyph for the given Unicode character; see pango_fontset_get_font().
  90. * @get_metrics: a function to get overall metric information for the fonts
  91. * in the fontset; see pango_fontset_get_metrics().
  92. * @get_language: a function to get the language of the fontset.
  93. * @foreach: a function to loop over the fonts in the fontset. See
  94. * pango_fontset_foreach().
  95. *
  96. * The #PangoFontsetClass structure holds the virtual functions for
  97. * a particular #PangoFontset implementation.
  98. */
  99. struct _PangoFontsetClass
  100. {
  101. GObjectClass parent_class;
  102. /*< public >*/
  103. PangoFont * (*get_font) (PangoFontset *fontset,
  104. guint wc);
  105. PangoFontMetrics *(*get_metrics) (PangoFontset *fontset);
  106. PangoLanguage * (*get_language) (PangoFontset *fontset);
  107. void (*foreach) (PangoFontset *fontset,
  108. PangoFontsetForeachFunc func,
  109. gpointer data);
  110. /*< private >*/
  111. /* Padding for future expansion */
  112. void (*_pango_reserved1) (void);
  113. void (*_pango_reserved2) (void);
  114. void (*_pango_reserved3) (void);
  115. void (*_pango_reserved4) (void);
  116. };
  117. /*
  118. * PangoFontsetSimple
  119. */
  120. /**
  121. * PANGO_TYPE_FONTSET_SIMPLE:
  122. *
  123. * The #GObject type for #PangoFontsetSimple.
  124. */
  125. /**
  126. * PangoFontsetSimple:
  127. *
  128. * #PangoFontsetSimple is a implementation of the abstract
  129. * #PangoFontset base class in terms of an array of fonts,
  130. * which the creator provides when constructing the
  131. * #PangoFontsetSimple.
  132. */
  133. #define PANGO_TYPE_FONTSET_SIMPLE (pango_fontset_simple_get_type ())
  134. #define PANGO_FONTSET_SIMPLE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FONTSET_SIMPLE, PangoFontsetSimple))
  135. #define PANGO_IS_FONTSET_SIMPLE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FONTSET_SIMPLE))
  136. typedef struct _PangoFontsetSimple PangoFontsetSimple;
  137. typedef struct _PangoFontsetSimpleClass PangoFontsetSimpleClass;
  138. PANGO_AVAILABLE_IN_ALL
  139. GType pango_fontset_simple_get_type (void) G_GNUC_CONST;
  140. PANGO_AVAILABLE_IN_ALL
  141. PangoFontsetSimple * pango_fontset_simple_new (PangoLanguage *language);
  142. PANGO_AVAILABLE_IN_ALL
  143. void pango_fontset_simple_append (PangoFontsetSimple *fontset,
  144. PangoFont *font);
  145. PANGO_AVAILABLE_IN_ALL
  146. int pango_fontset_simple_size (PangoFontsetSimple *fontset);
  147. #endif /* PANGO_ENABLE_BACKEND */
  148. G_END_DECLS
  149. #endif /* __PANGO_FONTSET_H__ */