hb-deprecated.h 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  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_DEPRECATED_FOR (hb_font_funcs_set_nominal_glyph_func and hb_font_funcs_set_variation_glyph_func)
  93. HB_EXTERN void
  94. hb_font_funcs_set_glyph_func (hb_font_funcs_t *ffuncs,
  95. hb_font_get_glyph_func_t func,
  96. void *user_data, hb_destroy_func_t destroy);
  97. /* https://github.com/harfbuzz/harfbuzz/pull/4207 */
  98. /**
  99. * HB_UNICODE_COMBINING_CLASS_CCC133:
  100. *
  101. * [Tibetan]
  102. *
  103. * Deprecated: 7.2.0
  104. **/
  105. #define HB_UNICODE_COMBINING_CLASS_CCC133 133
  106. /**
  107. * hb_unicode_eastasian_width_func_t:
  108. * @ufuncs: A Unicode-functions structure
  109. * @unicode: The code point to query
  110. * @user_data: User data pointer passed by the caller
  111. *
  112. * A virtual method for the #hb_unicode_funcs_t structure.
  113. *
  114. * Deprecated: 2.0.0
  115. */
  116. typedef unsigned int (*hb_unicode_eastasian_width_func_t) (hb_unicode_funcs_t *ufuncs,
  117. hb_codepoint_t unicode,
  118. void *user_data);
  119. /**
  120. * hb_unicode_funcs_set_eastasian_width_func:
  121. * @ufuncs: a Unicode-function structure
  122. * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
  123. * @user_data: Data to pass to @func
  124. * @destroy: (nullable): The function to call when @user_data is not needed anymore
  125. *
  126. * Sets the implementation function for #hb_unicode_eastasian_width_func_t.
  127. *
  128. * Since: 0.9.2
  129. * Deprecated: 2.0.0
  130. **/
  131. HB_EXTERN HB_DEPRECATED void
  132. hb_unicode_funcs_set_eastasian_width_func (hb_unicode_funcs_t *ufuncs,
  133. hb_unicode_eastasian_width_func_t func,
  134. void *user_data, hb_destroy_func_t destroy);
  135. /**
  136. * hb_unicode_eastasian_width:
  137. * @ufuncs: a Unicode-function structure
  138. * @unicode: The code point to query
  139. *
  140. * Don't use. Not used by HarfBuzz.
  141. *
  142. * Since: 0.9.2
  143. * Deprecated: 2.0.0
  144. **/
  145. HB_EXTERN HB_DEPRECATED unsigned int
  146. hb_unicode_eastasian_width (hb_unicode_funcs_t *ufuncs,
  147. hb_codepoint_t unicode);
  148. /**
  149. * hb_unicode_decompose_compatibility_func_t:
  150. * @ufuncs: a Unicode function structure
  151. * @u: codepoint to decompose
  152. * @decomposed: address of codepoint array (of length #HB_UNICODE_MAX_DECOMPOSITION_LEN) to write decomposition into
  153. * @user_data: user data pointer as passed to hb_unicode_funcs_set_decompose_compatibility_func()
  154. *
  155. * Fully decompose @u to its Unicode compatibility decomposition. The codepoints of the decomposition will be written to @decomposed.
  156. * The complete length of the decomposition will be returned.
  157. *
  158. * If @u has no compatibility decomposition, zero should be returned.
  159. *
  160. * The Unicode standard guarantees that a buffer of length #HB_UNICODE_MAX_DECOMPOSITION_LEN codepoints will always be sufficient for any
  161. * compatibility decomposition plus an terminating value of 0. Consequently, @decompose must be allocated by the caller to be at least this length. Implementations
  162. * of this function type must ensure that they do not write past the provided array.
  163. *
  164. * Return value: number of codepoints in the full compatibility decomposition of @u, or 0 if no decomposition available.
  165. *
  166. * Deprecated: 2.0.0
  167. */
  168. typedef unsigned int (*hb_unicode_decompose_compatibility_func_t) (hb_unicode_funcs_t *ufuncs,
  169. hb_codepoint_t u,
  170. hb_codepoint_t *decomposed,
  171. void *user_data);
  172. /**
  173. * HB_UNICODE_MAX_DECOMPOSITION_LEN:
  174. *
  175. * See Unicode 6.1 for details on the maximum decomposition length.
  176. *
  177. * Deprecated: 2.0.0
  178. */
  179. #define HB_UNICODE_MAX_DECOMPOSITION_LEN (18+1) /* codepoints */
  180. /**
  181. * hb_unicode_funcs_set_decompose_compatibility_func:
  182. * @ufuncs: A Unicode-functions structure
  183. * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
  184. * @user_data: Data to pass to @func
  185. * @destroy: (nullable): The function to call when @user_data is not needed anymore
  186. *
  187. * Sets the implementation function for #hb_unicode_decompose_compatibility_func_t.
  188. *
  189. *
  190. *
  191. * Since: 0.9.2
  192. * Deprecated: 2.0.0
  193. **/
  194. HB_EXTERN HB_DEPRECATED void
  195. hb_unicode_funcs_set_decompose_compatibility_func (hb_unicode_funcs_t *ufuncs,
  196. hb_unicode_decompose_compatibility_func_t func,
  197. void *user_data, hb_destroy_func_t destroy);
  198. HB_EXTERN HB_DEPRECATED unsigned int
  199. hb_unicode_decompose_compatibility (hb_unicode_funcs_t *ufuncs,
  200. hb_codepoint_t u,
  201. hb_codepoint_t *decomposed);
  202. /**
  203. * hb_font_get_glyph_v_kerning_func_t:
  204. *
  205. * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
  206. *
  207. * This method should retrieve the kerning-adjustment value for a glyph-pair in
  208. * the specified font, for vertical text segments.
  209. *
  210. **/
  211. typedef hb_font_get_glyph_kerning_func_t hb_font_get_glyph_v_kerning_func_t;
  212. /**
  213. * hb_font_funcs_set_glyph_v_kerning_func:
  214. * @ffuncs: A font-function structure
  215. * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
  216. * @user_data: Data to pass to @func
  217. * @destroy: (nullable): The function to call when @user_data is not needed anymore
  218. *
  219. * Sets the implementation function for #hb_font_get_glyph_v_kerning_func_t.
  220. *
  221. * Since: 0.9.2
  222. * Deprecated: 2.0.0
  223. **/
  224. HB_EXTERN void
  225. hb_font_funcs_set_glyph_v_kerning_func (hb_font_funcs_t *ffuncs,
  226. hb_font_get_glyph_v_kerning_func_t func,
  227. void *user_data, hb_destroy_func_t destroy);
  228. HB_EXTERN hb_position_t
  229. hb_font_get_glyph_v_kerning (hb_font_t *font,
  230. hb_codepoint_t top_glyph, hb_codepoint_t bottom_glyph);
  231. /**
  232. * hb_font_get_glyph_shape_func_t:
  233. * @font: #hb_font_t to work upon
  234. * @font_data: @font user data pointer
  235. * @glyph: The glyph ID to query
  236. * @draw_funcs: The draw functions to send the shape data to
  237. * @draw_data: The data accompanying the draw functions
  238. * @user_data: User data pointer passed by the caller
  239. *
  240. * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
  241. *
  242. * Since: 4.0.0
  243. * Deprecated: 7.0.0: Use #hb_font_draw_glyph_func_t instead
  244. **/
  245. typedef void (*hb_font_get_glyph_shape_func_t) (hb_font_t *font, void *font_data,
  246. hb_codepoint_t glyph,
  247. hb_draw_funcs_t *draw_funcs, void *draw_data,
  248. void *user_data);
  249. /**
  250. * hb_font_funcs_set_glyph_shape_func:
  251. * @ffuncs: A font-function structure
  252. * @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
  253. * @user_data: Data to pass to @func
  254. * @destroy: (nullable): The function to call when @user_data is not needed anymore
  255. *
  256. * Sets the implementation function for #hb_font_get_glyph_shape_func_t,
  257. * which is the same as #hb_font_draw_glyph_func_t.
  258. *
  259. * Since: 4.0.0
  260. * Deprecated: 7.0.0: Use hb_font_funcs_set_draw_glyph_func() instead
  261. **/
  262. HB_DEPRECATED_FOR (hb_font_funcs_set_draw_glyph_func)
  263. HB_EXTERN void
  264. hb_font_funcs_set_glyph_shape_func (hb_font_funcs_t *ffuncs,
  265. hb_font_get_glyph_shape_func_t func,
  266. void *user_data, hb_destroy_func_t destroy);
  267. HB_DEPRECATED_FOR (hb_font_draw_glyph)
  268. HB_EXTERN void
  269. hb_font_get_glyph_shape (hb_font_t *font,
  270. hb_codepoint_t glyph,
  271. hb_draw_funcs_t *dfuncs, void *draw_data);
  272. /**
  273. * HB_AAT_LAYOUT_FEATURE_TYPE_CURISVE_CONNECTION:
  274. *
  275. * Use #HB_AAT_LAYOUT_FEATURE_TYPE_CURSIVE_CONNECTION instead.
  276. *
  277. * Deprecated: 8.3.0
  278. */
  279. #define HB_AAT_LAYOUT_FEATURE_TYPE_CURISVE_CONNECTION HB_AAT_LAYOUT_FEATURE_TYPE_CURSIVE_CONNECTION
  280. #endif
  281. HB_END_DECLS
  282. #endif /* HB_DEPRECATED_H */