pango-fontmap.h 5.7 KB

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