hb-deprecated.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  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. #ifndef HB_H_IN
  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. #define HB_SCRIPT_CANADIAN_ABORIGINAL HB_SCRIPT_CANADIAN_SYLLABICS
  47. #define HB_BUFFER_FLAGS_DEFAULT HB_BUFFER_FLAG_DEFAULT
  48. #define HB_BUFFER_SERIALIZE_FLAGS_DEFAULT HB_BUFFER_SERIALIZE_FLAG_DEFAULT
  49. typedef hb_bool_t (*hb_font_get_glyph_func_t) (hb_font_t *font, void *font_data,
  50. hb_codepoint_t unicode, hb_codepoint_t variation_selector,
  51. hb_codepoint_t *glyph,
  52. void *user_data);
  53. HB_EXTERN HB_DEPRECATED_FOR(hb_font_funcs_set_nominal_glyph_func and hb_font_funcs_set_variation_glyph_func) void
  54. hb_font_funcs_set_glyph_func (hb_font_funcs_t *ffuncs,
  55. hb_font_get_glyph_func_t func,
  56. void *user_data, hb_destroy_func_t destroy);
  57. HB_EXTERN HB_DEPRECATED void
  58. hb_set_invert (hb_set_t *set);
  59. /**
  60. * hb_unicode_eastasian_width_func_t:
  61. *
  62. * Deprecated: 2.0.0
  63. */
  64. typedef unsigned int (*hb_unicode_eastasian_width_func_t) (hb_unicode_funcs_t *ufuncs,
  65. hb_codepoint_t unicode,
  66. void *user_data);
  67. /**
  68. * hb_unicode_funcs_set_eastasian_width_func:
  69. * @ufuncs: a Unicode function structure
  70. * @func: (closure user_data) (destroy destroy) (scope notified):
  71. * @user_data:
  72. * @destroy:
  73. *
  74. *
  75. *
  76. * Since: 0.9.2
  77. * Deprecated: 2.0.0
  78. **/
  79. HB_EXTERN HB_DEPRECATED void
  80. hb_unicode_funcs_set_eastasian_width_func (hb_unicode_funcs_t *ufuncs,
  81. hb_unicode_eastasian_width_func_t func,
  82. void *user_data, hb_destroy_func_t destroy);
  83. /**
  84. * hb_unicode_eastasian_width:
  85. *
  86. * Since: 0.9.2
  87. * Deprecated: 2.0.0
  88. **/
  89. HB_EXTERN HB_DEPRECATED unsigned int
  90. hb_unicode_eastasian_width (hb_unicode_funcs_t *ufuncs,
  91. hb_codepoint_t unicode);
  92. /**
  93. * hb_unicode_decompose_compatibility_func_t:
  94. * @ufuncs: a Unicode function structure
  95. * @u: codepoint to decompose
  96. * @decomposed: address of codepoint array (of length %HB_UNICODE_MAX_DECOMPOSITION_LEN) to write decomposition into
  97. * @user_data: user data pointer as passed to hb_unicode_funcs_set_decompose_compatibility_func()
  98. *
  99. * Fully decompose @u to its Unicode compatibility decomposition. The codepoints of the decomposition will be written to @decomposed.
  100. * The complete length of the decomposition will be returned.
  101. *
  102. * If @u has no compatibility decomposition, zero should be returned.
  103. *
  104. * The Unicode standard guarantees that a buffer of length %HB_UNICODE_MAX_DECOMPOSITION_LEN codepoints will always be sufficient for any
  105. * compatibility decomposition plus an terminating value of 0. Consequently, @decompose must be allocated by the caller to be at least this length. Implementations
  106. * of this function type must ensure that they do not write past the provided array.
  107. *
  108. * Return value: number of codepoints in the full compatibility decomposition of @u, or 0 if no decomposition available.
  109. *
  110. * Deprecated: 2.0.0
  111. */
  112. typedef unsigned int (*hb_unicode_decompose_compatibility_func_t) (hb_unicode_funcs_t *ufuncs,
  113. hb_codepoint_t u,
  114. hb_codepoint_t *decomposed,
  115. void *user_data);
  116. /**
  117. * HB_UNICODE_MAX_DECOMPOSITION_LEN:
  118. *
  119. * See Unicode 6.1 for details on the maximum decomposition length.
  120. *
  121. * Deprecated: 2.0.0
  122. */
  123. #define HB_UNICODE_MAX_DECOMPOSITION_LEN (18+1) /* codepoints */
  124. /**
  125. * hb_unicode_funcs_set_decompose_compatibility_func:
  126. * @ufuncs: a Unicode function structure
  127. * @func: (closure user_data) (destroy destroy) (scope notified):
  128. * @user_data:
  129. * @destroy:
  130. *
  131. *
  132. *
  133. * Since: 0.9.2
  134. * Deprecated: 2.0.0
  135. **/
  136. HB_EXTERN HB_DEPRECATED void
  137. hb_unicode_funcs_set_decompose_compatibility_func (hb_unicode_funcs_t *ufuncs,
  138. hb_unicode_decompose_compatibility_func_t func,
  139. void *user_data, hb_destroy_func_t destroy);
  140. HB_EXTERN HB_DEPRECATED unsigned int
  141. hb_unicode_decompose_compatibility (hb_unicode_funcs_t *ufuncs,
  142. hb_codepoint_t u,
  143. hb_codepoint_t *decomposed);
  144. typedef hb_font_get_glyph_kerning_func_t hb_font_get_glyph_v_kerning_func_t;
  145. /**
  146. * hb_font_funcs_set_glyph_v_kerning_func:
  147. * @ffuncs: font functions.
  148. * @func: (closure user_data) (destroy destroy) (scope notified):
  149. * @user_data:
  150. * @destroy:
  151. *
  152. *
  153. *
  154. * Since: 0.9.2
  155. * Deprecated: 2.0.0
  156. **/
  157. HB_EXTERN void
  158. hb_font_funcs_set_glyph_v_kerning_func (hb_font_funcs_t *ffuncs,
  159. hb_font_get_glyph_v_kerning_func_t func,
  160. void *user_data, hb_destroy_func_t destroy);
  161. HB_EXTERN hb_position_t
  162. hb_font_get_glyph_v_kerning (hb_font_t *font,
  163. hb_codepoint_t top_glyph, hb_codepoint_t bottom_glyph);
  164. #endif
  165. HB_END_DECLS
  166. #endif /* HB_DEPRECATED_H */