pango-fontmap.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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-types.h>
  24. #include <pango/pango-font.h>
  25. #include <pango/pango-fontset.h>
  26. G_BEGIN_DECLS
  27. #define PANGO_TYPE_FONT_MAP (pango_font_map_get_type ())
  28. #define PANGO_FONT_MAP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FONT_MAP, PangoFontMap))
  29. #define PANGO_IS_FONT_MAP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FONT_MAP))
  30. #define PANGO_FONT_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_FONT_MAP, PangoFontMapClass))
  31. #define PANGO_IS_FONT_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_FONT_MAP))
  32. #define PANGO_FONT_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_FONT_MAP, PangoFontMapClass))
  33. typedef struct _PangoFontMapClass PangoFontMapClass;
  34. /**
  35. * PangoFontMap:
  36. *
  37. * A `PangoFontMap` represents the set of fonts available for a
  38. * particular rendering system.
  39. *
  40. * This is a virtual object with implementations being specific to
  41. * particular rendering systems.
  42. */
  43. struct _PangoFontMap
  44. {
  45. GObject parent_instance;
  46. };
  47. /**
  48. * PangoFontMapClass:
  49. * @parent_class: parent `GObjectClass`
  50. * @load_font: a function to load a font with a given description. See
  51. * pango_font_map_load_font().
  52. * @list_families: A function to list available font families. See
  53. * pango_font_map_list_families().
  54. * @load_fontset: a function to load a fontset with a given given description
  55. * suitable for a particular language. See pango_font_map_load_fontset().
  56. * @shape_engine_type: the type of rendering-system-dependent engines that
  57. * can handle fonts of this fonts loaded with this fontmap.
  58. * @get_serial: a function to get the serial number of the fontmap.
  59. * See pango_font_map_get_serial().
  60. * @changed: See pango_font_map_changed()
  61. *
  62. * The `PangoFontMapClass` structure holds the virtual functions for
  63. * a particular `PangoFontMap` implementation.
  64. */
  65. struct _PangoFontMapClass
  66. {
  67. GObjectClass parent_class;
  68. /*< public >*/
  69. PangoFont * (*load_font) (PangoFontMap *fontmap,
  70. PangoContext *context,
  71. const PangoFontDescription *desc);
  72. void (*list_families) (PangoFontMap *fontmap,
  73. PangoFontFamily ***families,
  74. int *n_families);
  75. PangoFontset *(*load_fontset) (PangoFontMap *fontmap,
  76. PangoContext *context,
  77. const PangoFontDescription *desc,
  78. PangoLanguage *language);
  79. const char *shape_engine_type;
  80. guint (*get_serial) (PangoFontMap *fontmap);
  81. void (*changed) (PangoFontMap *fontmap);
  82. PangoFontFamily * (*get_family) (PangoFontMap *fontmap,
  83. const char *name);
  84. PangoFontFace * (*get_face) (PangoFontMap *fontmap,
  85. PangoFont *font);
  86. };
  87. PANGO_AVAILABLE_IN_ALL
  88. GType pango_font_map_get_type (void) G_GNUC_CONST;
  89. PANGO_AVAILABLE_IN_1_22
  90. PangoContext * pango_font_map_create_context (PangoFontMap *fontmap);
  91. PANGO_AVAILABLE_IN_ALL
  92. PangoFont * pango_font_map_load_font (PangoFontMap *fontmap,
  93. PangoContext *context,
  94. const PangoFontDescription *desc);
  95. PANGO_AVAILABLE_IN_ALL
  96. PangoFontset *pango_font_map_load_fontset (PangoFontMap *fontmap,
  97. PangoContext *context,
  98. const PangoFontDescription *desc,
  99. PangoLanguage *language);
  100. PANGO_AVAILABLE_IN_ALL
  101. void pango_font_map_list_families (PangoFontMap *fontmap,
  102. PangoFontFamily ***families,
  103. int *n_families);
  104. PANGO_AVAILABLE_IN_1_32
  105. guint pango_font_map_get_serial (PangoFontMap *fontmap);
  106. PANGO_AVAILABLE_IN_1_34
  107. void pango_font_map_changed (PangoFontMap *fontmap);
  108. PANGO_AVAILABLE_IN_1_46
  109. PangoFontFamily *pango_font_map_get_family (PangoFontMap *fontmap,
  110. const char *name);
  111. PANGO_AVAILABLE_IN_1_52
  112. PangoFont * pango_font_map_reload_font (PangoFontMap *fontmap,
  113. PangoFont *font,
  114. double scale,
  115. PangoContext *context,
  116. const char *variations);
  117. G_DEFINE_AUTOPTR_CLEANUP_FUNC(PangoFontMap, g_object_unref)
  118. G_END_DECLS
  119. #endif /* __PANGO_FONTMAP_H__ */