pango-fontmap.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. /* Pango
  2. * pango-font.h: Font handling
  3. *
  4. * Copyright (C) 2000 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_FONTMAP_H__
  22. #define __PANGO_FONTMAP_H__
  23. #include <pango/pango-font.h>
  24. #include <pango/pango-fontset.h>
  25. G_BEGIN_DECLS
  26. /**
  27. * PANGO_TYPE_FONT_MAP:
  28. *
  29. * The #GObject type for #PangoFontMap.
  30. */
  31. /**
  32. * PANGO_FONT_MAP:
  33. * @object: a #GObject.
  34. *
  35. * Casts a #GObject to a #PangoFontMap.
  36. */
  37. /**
  38. * PANGO_IS_FONT_MAP:
  39. * @object: a #GObject.
  40. *
  41. * Returns: %TRUE if @object is a #PangoFontMap.
  42. */
  43. #define PANGO_TYPE_FONT_MAP (pango_font_map_get_type ())
  44. #define PANGO_FONT_MAP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FONT_MAP, PangoFontMap))
  45. #define PANGO_IS_FONT_MAP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FONT_MAP))
  46. typedef struct _PangoContext PangoContext;
  47. PANGO_AVAILABLE_IN_ALL
  48. GType pango_font_map_get_type (void) G_GNUC_CONST;
  49. PANGO_AVAILABLE_IN_1_22
  50. PangoContext * pango_font_map_create_context (PangoFontMap *fontmap);
  51. PANGO_AVAILABLE_IN_ALL
  52. PangoFont * pango_font_map_load_font (PangoFontMap *fontmap,
  53. PangoContext *context,
  54. const PangoFontDescription *desc);
  55. PANGO_AVAILABLE_IN_ALL
  56. PangoFontset *pango_font_map_load_fontset (PangoFontMap *fontmap,
  57. PangoContext *context,
  58. const PangoFontDescription *desc,
  59. PangoLanguage *language);
  60. PANGO_AVAILABLE_IN_ALL
  61. void pango_font_map_list_families (PangoFontMap *fontmap,
  62. PangoFontFamily ***families,
  63. int *n_families);
  64. PANGO_AVAILABLE_IN_1_32
  65. guint pango_font_map_get_serial (PangoFontMap *fontmap);
  66. PANGO_AVAILABLE_IN_1_34
  67. void pango_font_map_changed (PangoFontMap *fontmap);
  68. #ifdef PANGO_ENABLE_BACKEND
  69. /**
  70. * PANGO_FONT_MAP_CLASS:
  71. * @klass: a #GObject.
  72. *
  73. * Casts a #GObject to a #PangoFontMapClass.
  74. */
  75. /**
  76. * PANGO_IS_FONT_MAP_CLASS:
  77. * @klass: a #GObject.
  78. *
  79. * Returns: %TRUE if @klass is a subtype of #PangoFontMapClass.
  80. */
  81. /**
  82. * PANGO_FONT_MAP_GET_CLASS:
  83. * @obj: a #PangoFontMap.
  84. *
  85. * Returns: class of @obj
  86. */
  87. #define PANGO_FONT_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_FONT_MAP, PangoFontMapClass))
  88. #define PANGO_IS_FONT_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_FONT_MAP))
  89. #define PANGO_FONT_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_FONT_MAP, PangoFontMapClass))
  90. typedef struct _PangoFontMapClass PangoFontMapClass;
  91. /**
  92. * PangoFontMap:
  93. *
  94. * The #PangoFontMap represents the set of fonts available for a
  95. * particular rendering system. This is a virtual object with
  96. * implementations being specific to particular rendering systems. To
  97. * create an implementation of a #PangoFontMap, the rendering-system
  98. * specific code should allocate a larger structure that contains a nested
  99. * #PangoFontMap, fill in the <structfield>klass</structfield> member of the nested #PangoFontMap with a
  100. * pointer to a appropriate #PangoFontMapClass, then call
  101. * pango_font_map_init() on the structure.
  102. *
  103. * The #PangoFontMap structure contains one member which the implementation
  104. * fills in.
  105. */
  106. struct _PangoFontMap
  107. {
  108. GObject parent_instance;
  109. };
  110. /**
  111. * PangoFontMapClass:
  112. * @parent_class: parent #GObjectClass.
  113. * @load_font: a function to load a font with a given description. See
  114. * pango_font_map_load_font().
  115. * @list_families: A function to list available font families. See
  116. * pango_font_map_list_families().
  117. * @load_fontset: a function to load a fontset with a given given description
  118. * suitable for a particular language. See pango_font_map_load_fontset().
  119. * @shape_engine_type: the type of rendering-system-dependent engines that
  120. * can handle fonts of this fonts loaded with this fontmap.
  121. * @get_serial: a function to get the serial number of the fontmap.
  122. * See pango_font_map_get_serial().
  123. * @changed: See pango_font_map_changed()
  124. *
  125. * The #PangoFontMapClass structure holds the virtual functions for
  126. * a particular #PangoFontMap implementation.
  127. */
  128. struct _PangoFontMapClass
  129. {
  130. GObjectClass parent_class;
  131. /*< public >*/
  132. PangoFont * (*load_font) (PangoFontMap *fontmap,
  133. PangoContext *context,
  134. const PangoFontDescription *desc);
  135. void (*list_families) (PangoFontMap *fontmap,
  136. PangoFontFamily ***families,
  137. int *n_families);
  138. PangoFontset *(*load_fontset) (PangoFontMap *fontmap,
  139. PangoContext *context,
  140. const PangoFontDescription *desc,
  141. PangoLanguage *language);
  142. const char *shape_engine_type;
  143. guint (*get_serial) (PangoFontMap *fontmap);
  144. void (*changed) (PangoFontMap *fontmap);
  145. /*< private >*/
  146. /* Padding for future expansion */
  147. void (*_pango_reserved1) (void);
  148. void (*_pango_reserved2) (void);
  149. };
  150. PANGO_DEPRECATED_IN_1_38
  151. const char *pango_font_map_get_shape_engine_type (PangoFontMap *fontmap);
  152. #endif /* PANGO_ENABLE_BACKEND */
  153. G_END_DECLS
  154. #endif /* __PANGO_FONTMAP_H__ */