pangoft2.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. /* Pango
  2. * pangoft2.h:
  3. *
  4. * Copyright (C) 1999 Red Hat Software
  5. * Copyright (C) 2000 Tor Lillqvist
  6. *
  7. * This library is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Library General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2 of the License, or (at your option) any later version.
  11. *
  12. * This library is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Library General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Library General Public
  18. * License along with this library; if not, write to the
  19. * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  20. * Boston, MA 02111-1307, USA.
  21. */
  22. #ifndef __PANGOFT2_H__
  23. #define __PANGOFT2_H__
  24. #include <fontconfig/fontconfig.h>
  25. #include <ft2build.h>
  26. #include FT_FREETYPE_H
  27. #include <pango/pangofc-fontmap.h>
  28. #include <pango/pango-layout.h>
  29. #include <pango/pangofc-font.h>
  30. G_BEGIN_DECLS
  31. #ifndef __GI_SCANNER__
  32. #ifndef PANGO_DISABLE_DEPRECATED
  33. /**
  34. * PANGO_RENDER_TYPE_FT2: (skip)
  35. *
  36. * A string constant that was used to identify shape engines that work
  37. * with the FreeType backend. See %PANGO_RENDER_TYPE_FC for the replacement.
  38. */
  39. #define PANGO_RENDER_TYPE_FT2 "PangoRenderFT2"
  40. #endif
  41. #endif /* __GI_SCANNER__ */
  42. #ifdef __GI_SCANNER__
  43. #define PANGO_FT2_TYPE_FONT_MAP (pango_ft2_font_map_get_type ())
  44. #define PANGO_FT2_FONT_MAP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_FT2_TYPE_FONT_MAP, PangoFT2FontMap))
  45. #define PANGO_FT2_IS_FONT_MAP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_FT2_TYPE_FONT_MAP))
  46. #else
  47. #define PANGO_TYPE_FT2_FONT_MAP (pango_ft2_font_map_get_type ())
  48. #define PANGO_FT2_FONT_MAP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FT2_FONT_MAP, PangoFT2FontMap))
  49. #define PANGO_FT2_IS_FONT_MAP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FT2_FONT_MAP))
  50. #endif
  51. typedef struct _PangoFT2FontMap PangoFT2FontMap;
  52. /**
  53. * PangoFT2SubstituteFunc:
  54. * @pattern: the FcPattern to tweak.
  55. * @data: user data.
  56. *
  57. * Function type for doing final config tweaking on prepared FcPatterns.
  58. */
  59. typedef void (*PangoFT2SubstituteFunc) (FcPattern *pattern,
  60. gpointer data);
  61. /* Calls for applications */
  62. PANGO_AVAILABLE_IN_ALL
  63. void pango_ft2_render (FT_Bitmap *bitmap,
  64. PangoFont *font,
  65. PangoGlyphString *glyphs,
  66. gint x,
  67. gint y);
  68. PANGO_AVAILABLE_IN_1_6
  69. void pango_ft2_render_transformed (FT_Bitmap *bitmap,
  70. const PangoMatrix *matrix,
  71. PangoFont *font,
  72. PangoGlyphString *glyphs,
  73. int x,
  74. int y);
  75. PANGO_AVAILABLE_IN_ALL
  76. void pango_ft2_render_layout_line (FT_Bitmap *bitmap,
  77. PangoLayoutLine *line,
  78. int x,
  79. int y);
  80. PANGO_AVAILABLE_IN_1_6
  81. void pango_ft2_render_layout_line_subpixel (FT_Bitmap *bitmap,
  82. PangoLayoutLine *line,
  83. int x,
  84. int y);
  85. PANGO_AVAILABLE_IN_ALL
  86. void pango_ft2_render_layout (FT_Bitmap *bitmap,
  87. PangoLayout *layout,
  88. int x,
  89. int y);
  90. PANGO_AVAILABLE_IN_1_6
  91. void pango_ft2_render_layout_subpixel (FT_Bitmap *bitmap,
  92. PangoLayout *layout,
  93. int x,
  94. int y);
  95. PANGO_AVAILABLE_IN_ALL
  96. GType pango_ft2_font_map_get_type (void) G_GNUC_CONST;
  97. PANGO_AVAILABLE_IN_1_2
  98. PangoFontMap *pango_ft2_font_map_new (void);
  99. PANGO_AVAILABLE_IN_1_2
  100. void pango_ft2_font_map_set_resolution (PangoFT2FontMap *fontmap,
  101. double dpi_x,
  102. double dpi_y);
  103. #ifndef PANGO_DISABLE_DEPRECATED
  104. PANGO_DEPRECATED_IN_1_48_FOR(pango_fc_font_map_set_default_substitute)
  105. void pango_ft2_font_map_set_default_substitute (PangoFT2FontMap *fontmap,
  106. PangoFT2SubstituteFunc func,
  107. gpointer data,
  108. GDestroyNotify notify);
  109. PANGO_DEPRECATED_IN_1_48_FOR(pango_fc_font_map_substitute_changed)
  110. void pango_ft2_font_map_substitute_changed (PangoFT2FontMap *fontmap);
  111. PANGO_DEPRECATED_IN_1_22_FOR(pango_font_map_create_context)
  112. PangoContext *pango_ft2_font_map_create_context (PangoFT2FontMap *fontmap);
  113. #endif
  114. /* API for rendering modules
  115. */
  116. #ifndef PANGO_DISABLE_DEPRECATED
  117. PANGO_DEPRECATED_FOR(pango_font_map_create_context)
  118. PangoContext *pango_ft2_get_context (double dpi_x,
  119. double dpi_y);
  120. PANGO_DEPRECATED_FOR(pango_ft2_font_map_new)
  121. PangoFontMap *pango_ft2_font_map_for_display (void);
  122. PANGO_DEPRECATED
  123. void pango_ft2_shutdown_display (void);
  124. PANGO_DEPRECATED_FOR(PANGO_GET_UNKNOWN_GLYPH)
  125. PangoGlyph pango_ft2_get_unknown_glyph (PangoFont *font);
  126. PANGO_DEPRECATED_FOR(pango_fc_font_kern_glyphs)
  127. int pango_ft2_font_get_kerning (PangoFont *font,
  128. PangoGlyph left,
  129. PangoGlyph right);
  130. PANGO_DEPRECATED_FOR(pango_fc_font_lock_face)
  131. FT_Face pango_ft2_font_get_face (PangoFont *font);
  132. PANGO_DEPRECATED_FOR(pango_font_get_coverage)
  133. PangoCoverage *pango_ft2_font_get_coverage (PangoFont *font,
  134. PangoLanguage *language);
  135. #endif /* PANGO_DISABLE_DEPRECATED */
  136. G_END_DECLS
  137. #endif /* __PANGOFT2_H__ */