pango-fontset.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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. #define PANGO_TYPE_FONTSET (pango_fontset_get_type ())
  31. #define PANGO_FONTSET(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FONTSET, PangoFontset))
  32. #define PANGO_IS_FONTSET(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FONTSET))
  33. #define PANGO_FONTSET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_FONTSET, PangoFontsetClass))
  34. #define PANGO_IS_FONTSET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_FONTSET))
  35. #define PANGO_FONTSET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_FONTSET, PangoFontsetClass))
  36. PANGO_AVAILABLE_IN_ALL
  37. GType pango_fontset_get_type (void) G_GNUC_CONST;
  38. typedef struct _PangoFontset PangoFontset;
  39. typedef struct _PangoFontsetClass PangoFontsetClass;
  40. /**
  41. * PangoFontsetForeachFunc:
  42. * @fontset: a `PangoFontset`
  43. * @font: a font from @fontset
  44. * @user_data: callback data
  45. *
  46. * Callback used when enumerating fonts in a fontset.
  47. *
  48. * See [method@Pango.Fontset.foreach].
  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. /**
  58. * PangoFontset:
  59. *
  60. * A `PangoFontset` represents a set of `PangoFont` to use when rendering text.
  61. *
  62. * A `PangoFontset` is the result of resolving a `PangoFontDescription`
  63. * against a particular `PangoContext`. It has operations for finding the
  64. * component font for a particular Unicode character, and for finding a
  65. * composite set of metrics for the entire fontset.
  66. */
  67. struct _PangoFontset
  68. {
  69. GObject parent_instance;
  70. };
  71. /**
  72. * PangoFontsetClass:
  73. * @parent_class: parent `GObjectClass`
  74. * @get_font: a function to get the font in the fontset that contains the
  75. * best glyph for the given Unicode character; see [method@Pango.Fontset.get_font]
  76. * @get_metrics: a function to get overall metric information for the fonts
  77. * in the fontset; see [method@Pango.Fontset.get_metrics]
  78. * @get_language: a function to get the language of the fontset.
  79. * @foreach: a function to loop over the fonts in the fontset. See
  80. * [method@Pango.Fontset.foreach]
  81. *
  82. * The `PangoFontsetClass` structure holds the virtual functions for
  83. * a particular `PangoFontset` implementation.
  84. */
  85. struct _PangoFontsetClass
  86. {
  87. GObjectClass parent_class;
  88. /*< public >*/
  89. PangoFont * (*get_font) (PangoFontset *fontset,
  90. guint wc);
  91. PangoFontMetrics *(*get_metrics) (PangoFontset *fontset);
  92. PangoLanguage * (*get_language) (PangoFontset *fontset);
  93. void (*foreach) (PangoFontset *fontset,
  94. PangoFontsetForeachFunc func,
  95. gpointer data);
  96. /*< private >*/
  97. /* Padding for future expansion */
  98. void (*_pango_reserved1) (void);
  99. void (*_pango_reserved2) (void);
  100. void (*_pango_reserved3) (void);
  101. void (*_pango_reserved4) (void);
  102. };
  103. PANGO_AVAILABLE_IN_ALL
  104. PangoFont * pango_fontset_get_font (PangoFontset *fontset,
  105. guint wc);
  106. PANGO_AVAILABLE_IN_ALL
  107. PangoFontMetrics * pango_fontset_get_metrics (PangoFontset *fontset);
  108. PANGO_AVAILABLE_IN_1_4
  109. void pango_fontset_foreach (PangoFontset *fontset,
  110. PangoFontsetForeachFunc func,
  111. gpointer data);
  112. G_END_DECLS
  113. #endif /* __PANGO_FONTSET_H__ */