pango-fontset.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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. GType pango_fontset_get_type (void) G_GNUC_CONST;
  39. typedef struct _PangoFontset PangoFontset;
  40. /**
  41. * PangoFontsetForeachFunc:
  42. * @fontset: a #PangoFontset
  43. * @font: a font from @fontset
  44. * @user_data: callback data
  45. *
  46. * A callback function used by pango_fontset_foreach() when enumerating
  47. * the fonts in a fontset.
  48. *
  49. * Returns: if %TRUE, stop iteration and return immediately.
  50. *
  51. * Since: 1.4
  52. **/
  53. typedef gboolean (*PangoFontsetForeachFunc) (PangoFontset *fontset,
  54. PangoFont *font,
  55. gpointer user_data);
  56. PangoFont * pango_fontset_get_font (PangoFontset *fontset,
  57. guint wc);
  58. PangoFontMetrics *pango_fontset_get_metrics (PangoFontset *fontset);
  59. void pango_fontset_foreach (PangoFontset *fontset,
  60. PangoFontsetForeachFunc func,
  61. gpointer data);
  62. #ifdef PANGO_ENABLE_BACKEND
  63. typedef struct _PangoFontsetClass PangoFontsetClass;
  64. #define PANGO_FONTSET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_FONTSET, PangoFontsetClass))
  65. #define PANGO_IS_FONTSET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_FONTSET))
  66. #define PANGO_FONTSET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_FONTSET, PangoFontsetClass))
  67. /**
  68. * PangoFontset:
  69. *
  70. * A #PangoFontset represents a set of #PangoFont to use
  71. * when rendering text. It is the result of resolving a
  72. * #PangoFontDescription against a particular #PangoContext.
  73. * It has operations for finding the component font for
  74. * a particular Unicode character, and for finding a composite
  75. * set of metrics for the entire fontset.
  76. */
  77. struct _PangoFontset
  78. {
  79. GObject parent_instance;
  80. };
  81. /**
  82. * PangoFontsetClass:
  83. * @parent_class: parent #GObjectClass.
  84. * @get_font: a function to get the font in the fontset that contains the
  85. * best glyph for the given Unicode character; see pango_fontset_get_font().
  86. * @get_metrics: a function to get overall metric information for the fonts
  87. * in the fontset; see pango_fontset_get_metrics().
  88. * @get_language: a function to get the language of the fontset.
  89. * @foreach: a function to loop over the fonts in the fontset. See
  90. * pango_fontset_foreach().
  91. *
  92. * The #PangoFontsetClass structure holds the virtual functions for
  93. * a particular #PangoFontset implementation.
  94. */
  95. struct _PangoFontsetClass
  96. {
  97. GObjectClass parent_class;
  98. /*< public >*/
  99. PangoFont * (*get_font) (PangoFontset *fontset,
  100. guint wc);
  101. PangoFontMetrics *(*get_metrics) (PangoFontset *fontset);
  102. PangoLanguage * (*get_language) (PangoFontset *fontset);
  103. void (*foreach) (PangoFontset *fontset,
  104. PangoFontsetForeachFunc func,
  105. gpointer data);
  106. /*< private >*/
  107. /* Padding for future expansion */
  108. void (*_pango_reserved1) (void);
  109. void (*_pango_reserved2) (void);
  110. void (*_pango_reserved3) (void);
  111. void (*_pango_reserved4) (void);
  112. };
  113. /*
  114. * PangoFontsetSimple
  115. */
  116. /**
  117. * PANGO_TYPE_FONTSET_SIMPLE:
  118. *
  119. * The #GObject type for #PangoFontsetSimple.
  120. */
  121. /**
  122. * PangoFontsetSimple:
  123. *
  124. * #PangoFontsetSimple is a implementation of the abstract
  125. * #PangoFontset base class in terms of an array of fonts,
  126. * which the creator provides when constructing the
  127. * #PangoFontsetSimple.
  128. */
  129. #define PANGO_TYPE_FONTSET_SIMPLE (pango_fontset_simple_get_type ())
  130. #define PANGO_FONTSET_SIMPLE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FONTSET_SIMPLE, PangoFontsetSimple))
  131. #define PANGO_IS_FONTSET_SIMPLE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FONTSET_SIMPLE))
  132. typedef struct _PangoFontsetSimple PangoFontsetSimple;
  133. typedef struct _PangoFontsetSimpleClass PangoFontsetSimpleClass;
  134. GType pango_fontset_simple_get_type (void) G_GNUC_CONST;
  135. PangoFontsetSimple * pango_fontset_simple_new (PangoLanguage *language);
  136. void pango_fontset_simple_append (PangoFontsetSimple *fontset,
  137. PangoFont *font);
  138. int pango_fontset_simple_size (PangoFontsetSimple *fontset);
  139. #endif /* PANGO_ENABLE_BACKEND */
  140. G_END_DECLS
  141. #endif /* __PANGO_FONTSET_H__ */