hb-deprecated.h 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. /*
  2. * Copyright © 2013 Google, Inc.
  3. *
  4. * This is part of HarfBuzz, a text shaping library.
  5. *
  6. * Permission is hereby granted, without written agreement and without
  7. * license or royalty fees, to use, copy, modify, and distribute this
  8. * software and its documentation for any purpose, provided that the
  9. * above copyright notice and the following two paragraphs appear in
  10. * all copies of this software.
  11. *
  12. * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
  13. * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
  14. * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
  15. * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
  16. * DAMAGE.
  17. *
  18. * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
  19. * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  20. * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
  21. * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
  22. * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  23. *
  24. * Google Author(s): Behdad Esfahbod
  25. */
  26. #if !defined(HB_H_IN) && !defined(HB_NO_SINGLE_HEADER_ERROR)
  27. #error "Include <hb.h> instead."
  28. #endif
  29. #ifndef HB_DEPRECATED_H
  30. #define HB_DEPRECATED_H
  31. #include "hb-common.h"
  32. #include "hb-unicode.h"
  33. #include "hb-font.h"
  34. #include "hb-set.h"
  35. /**
  36. * SECTION:hb-deprecated
  37. * @title: hb-deprecated
  38. * @short_description: Deprecated API
  39. * @include: hb.h
  40. *
  41. * These API have been deprecated in favor of newer API, or because they
  42. * were deemed unnecessary.
  43. **/
  44. HB_BEGIN_DECLS
  45. #ifndef HB_DISABLE_DEPRECATED
  46. /**
  47. * HB_SCRIPT_CANADIAN_ABORIGINAL:
  48. *
  49. * Use #HB_SCRIPT_CANADIAN_SYLLABICS instead:
  50. *
  51. * Deprecated: 0.9.20
  52. */
  53. #define HB_SCRIPT_CANADIAN_ABORIGINAL HB_SCRIPT_CANADIAN_SYLLABICS
  54. /**
  55. * HB_BUFFER_FLAGS_DEFAULT:
  56. *
  57. * Use #HB_BUFFER_FLAG_DEFAULT instead.
  58. *
  59. * Deprecated: 0.9.20
  60. */
  61. #define HB_BUFFER_FLAGS_DEFAULT HB_BUFFER_FLAG_DEFAULT
  62. /**
  63. * HB_BUFFER_SERIALIZE_FLAGS_DEFAULT:
  64. *
  65. * Use #HB_BUFFER_SERIALIZE_FLAG_DEFAULT instead.
  66. *
  67. * Deprecated: 0.9.20
  68. */
  69. #define HB_BUFFER_SERIALIZE_FLAGS_DEFAULT HB_BUFFER_SERIALIZE_FLAG_DEFAULT
  70. /**
  71. * hb_font_get_glyph_func_t:
  72. * @font: #hb_font_t to work upon
  73. * @font_data: @font user data pointer
  74. * @unicode: The Unicode code point to query
  75. * @variation_selector: The variation-selector code point to query
  76. * @glyph: (out): The glyph ID retrieved
  77. * @user_data: User data pointer passed by the caller
  78. *
  79. * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
  80. *
  81. * This method should retrieve the glyph ID for a specified Unicode code point
  82. * font, with an optional variation selector.
  83. *
  84. * Return value: `true` if data found, `false` otherwise
  85. * Deprecated: 1.2.3
  86. *
  87. **/
  88. typedef hb_bool_t (*hb_font_get_glyph_func_t) (hb_font_t *font, void *font_data,
  89. hb_codepoint_t unicode, hb_codepoint_t variation_selector,
  90. hb_codepoint_t *glyph,
  91. void *user_data);
  92. HB_EXTERN HB_DEPRECATED_FOR(hb_font_funcs_set_nominal_glyph_func and hb_font_funcs_set_variation_glyph_func) void
  93. hb_font_funcs_set_glyph_func (hb_font_funcs_t *ffuncs,
  94. hb_font_get_glyph_func_t func,
  95. void *user_data, hb_destroy_func_t destroy);
  96. /**
  97. * hb_unicode_eastasian_width_func_t:
  98. * @ufuncs: A Unicode-functions structure
  99. * @unicode: The code point to query
  100. * @user_data: User data pointer passed by the caller
  101. *
  102. * A virtual method for the #hb_unicode_funcs_t structure.
  103. *
  104. * Deprecated: 2.0.0
  105. */
  106. typedef unsigned int (*hb_unicode_eastasian_width_func_t) (hb_unicode_funcs_t *ufuncs,
  107. hb_codepoint_t unicode,
  108. void *user_data);
  109. /**
  110. * hb_unicode_funcs_set_eastasian_width_func:
  111. * @ufuncs: a Unicode-function structure
  112. * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
  113. * @user_data: Data to pass to @func
  114. * @destroy: (nullable): The function to call when @user_data is not needed anymore
  115. *
  116. * Sets the implementation function for #hb_unicode_eastasian_width_func_t.
  117. *
  118. * Since: 0.9.2
  119. * Deprecated: 2.0.0
  120. **/
  121. HB_EXTERN HB_DEPRECATED void
  122. hb_unicode_funcs_set_eastasian_width_func (hb_unicode_funcs_t *ufuncs,
  123. hb_unicode_eastasian_width_func_t func,
  124. void *user_data, hb_destroy_func_t destroy);
  125. /**
  126. * hb_unicode_eastasian_width:
  127. * @ufuncs: a Unicode-function structure
  128. * @unicode: The code point to query
  129. *
  130. * Don't use. Not used by HarfBuzz.
  131. *
  132. * Since: 0.9.2
  133. * Deprecated: 2.0.0
  134. **/
  135. HB_EXTERN HB_DEPRECATED unsigned int
  136. hb_unicode_eastasian_width (hb_unicode_funcs_t *ufuncs,
  137. hb_codepoint_t unicode);
  138. /**
  139. * hb_unicode_decompose_compatibility_func_t:
  140. * @ufuncs: a Unicode function structure
  141. * @u: codepoint to decompose
  142. * @decomposed: address of codepoint array (of length #HB_UNICODE_MAX_DECOMPOSITION_LEN) to write decomposition into
  143. * @user_data: user data pointer as passed to hb_unicode_funcs_set_decompose_compatibility_func()
  144. *
  145. * Fully decompose @u to its Unicode compatibility decomposition. The codepoints of the decomposition will be written to @decomposed.
  146. * The complete length of the decomposition will be returned.
  147. *
  148. * If @u has no compatibility decomposition, zero should be returned.
  149. *
  150. * The Unicode standard guarantees that a buffer of length #HB_UNICODE_MAX_DECOMPOSITION_LEN codepoints will always be sufficient for any
  151. * compatibility decomposition plus an terminating value of 0. Consequently, @decompose must be allocated by the caller to be at least this length. Implementations
  152. * of this function type must ensure that they do not write past the provided array.
  153. *
  154. * Return value: number of codepoints in the full compatibility decomposition of @u, or 0 if no decomposition available.
  155. *
  156. * Deprecated: 2.0.0
  157. */
  158. typedef unsigned int (*hb_unicode_decompose_compatibility_func_t) (hb_unicode_funcs_t *ufuncs,
  159. hb_codepoint_t u,
  160. hb_codepoint_t *decomposed,
  161. void *user_data);
  162. /**
  163. * HB_UNICODE_MAX_DECOMPOSITION_LEN:
  164. *
  165. * See Unicode 6.1 for details on the maximum decomposition length.
  166. *
  167. * Deprecated: 2.0.0
  168. */
  169. #define HB_UNICODE_MAX_DECOMPOSITION_LEN (18+1) /* codepoints */
  170. /**
  171. * hb_unicode_funcs_set_decompose_compatibility_func:
  172. * @ufuncs: A Unicode-functions structure
  173. * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
  174. * @user_data: Data to pass to @func
  175. * @destroy: (nullable): The function to call when @user_data is not needed anymore
  176. *
  177. * Sets the implementation function for #hb_unicode_decompose_compatibility_func_t.
  178. *
  179. *
  180. *
  181. * Since: 0.9.2
  182. * Deprecated: 2.0.0
  183. **/
  184. HB_EXTERN HB_DEPRECATED void
  185. hb_unicode_funcs_set_decompose_compatibility_func (hb_unicode_funcs_t *ufuncs,
  186. hb_unicode_decompose_compatibility_func_t func,
  187. void *user_data, hb_destroy_func_t destroy);
  188. HB_EXTERN HB_DEPRECATED unsigned int
  189. hb_unicode_decompose_compatibility (hb_unicode_funcs_t *ufuncs,
  190. hb_codepoint_t u,
  191. hb_codepoint_t *decomposed);
  192. /**
  193. * hb_font_get_glyph_v_kerning_func_t:
  194. *
  195. * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
  196. *
  197. * This method should retrieve the kerning-adjustment value for a glyph-pair in
  198. * the specified font, for vertical text segments.
  199. *
  200. **/
  201. typedef hb_font_get_glyph_kerning_func_t hb_font_get_glyph_v_kerning_func_t;
  202. /**
  203. * hb_font_funcs_set_glyph_v_kerning_func:
  204. * @ffuncs: A font-function structure
  205. * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
  206. * @user_data: Data to pass to @func
  207. * @destroy: (nullable): The function to call when @user_data is not needed anymore
  208. *
  209. * Sets the implementation function for #hb_font_get_glyph_v_kerning_func_t.
  210. *
  211. * Since: 0.9.2
  212. * Deprecated: 2.0.0
  213. **/
  214. HB_EXTERN void
  215. hb_font_funcs_set_glyph_v_kerning_func (hb_font_funcs_t *ffuncs,
  216. hb_font_get_glyph_v_kerning_func_t func,
  217. void *user_data, hb_destroy_func_t destroy);
  218. HB_EXTERN hb_position_t
  219. hb_font_get_glyph_v_kerning (hb_font_t *font,
  220. hb_codepoint_t top_glyph, hb_codepoint_t bottom_glyph);
  221. #endif
  222. HB_END_DECLS
  223. #endif /* HB_DEPRECATED_H */