PageRenderTime 55ms CodeModel.GetById 28ms RepoModel.GetById 0ms app.codeStats 1ms

/gfx/harfbuzz/src/hb-ot-layout.h

https://bitbucket.org/MeeGoAdmin/mozilla-central/
C Header | 196 lines | 119 code | 35 blank | 42 comment | 0 complexity | babddc2163016663ea772c657ccce3af MD5 | raw file
Possible License(s): AGPL-1.0, MIT, BSD-3-Clause, Apache-2.0, LGPL-2.1, 0BSD, LGPL-3.0, MPL-2.0-no-copyleft-exception, GPL-2.0, JSON
  1. /*
  2. * Copyright (C) 2007,2008,2009 Red Hat, 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. * Red Hat Author(s): Behdad Esfahbod
  25. */
  26. #ifndef HB_OT_LAYOUT_H
  27. #define HB_OT_LAYOUT_H
  28. #include "hb-common.h"
  29. #include "hb-buffer.h"
  30. #include "hb-font.h"
  31. #include "hb-ot-tag.h"
  32. HB_BEGIN_DECLS
  33. #define HB_OT_TAG_GDEF HB_TAG('G','D','E','F')
  34. #define HB_OT_TAG_GSUB HB_TAG('G','S','U','B')
  35. #define HB_OT_TAG_GPOS HB_TAG('G','P','O','S')
  36. /*
  37. * GDEF
  38. */
  39. hb_bool_t
  40. hb_ot_layout_has_glyph_classes (hb_face_t *face);
  41. /* Not that useful. Provides list of attach points for a glyph that a
  42. * client may want to cache */
  43. unsigned int
  44. hb_ot_layout_get_attach_points (hb_face_t *face,
  45. hb_codepoint_t glyph,
  46. unsigned int start_offset,
  47. unsigned int *point_count /* IN/OUT */,
  48. unsigned int *point_array /* OUT */);
  49. /* Ligature caret positions */
  50. unsigned int
  51. hb_ot_layout_get_ligature_carets (hb_font_t *font,
  52. hb_face_t *face,
  53. hb_direction_t direction,
  54. hb_codepoint_t glyph,
  55. unsigned int start_offset,
  56. unsigned int *caret_count /* IN/OUT */,
  57. int *caret_array /* OUT */);
  58. /*
  59. * GSUB/GPOS feature query and enumeration interface
  60. */
  61. #define HB_OT_LAYOUT_NO_SCRIPT_INDEX ((unsigned int) 0xFFFF)
  62. #define HB_OT_LAYOUT_NO_FEATURE_INDEX ((unsigned int) 0xFFFF)
  63. #define HB_OT_LAYOUT_DEFAULT_LANGUAGE_INDEX ((unsigned int) 0xFFFF)
  64. unsigned int
  65. hb_ot_layout_table_get_script_tags (hb_face_t *face,
  66. hb_tag_t table_tag,
  67. unsigned int start_offset,
  68. unsigned int *script_count /* IN/OUT */,
  69. hb_tag_t *script_tags /* OUT */);
  70. hb_bool_t
  71. hb_ot_layout_table_find_script (hb_face_t *face,
  72. hb_tag_t table_tag,
  73. hb_tag_t script_tag,
  74. unsigned int *script_index);
  75. /* Like find_script, but takes zero-terminated array of scripts to test */
  76. hb_bool_t
  77. hb_ot_layout_table_choose_script (hb_face_t *face,
  78. hb_tag_t table_tag,
  79. const hb_tag_t *script_tags,
  80. unsigned int *script_index);
  81. unsigned int
  82. hb_ot_layout_table_get_feature_tags (hb_face_t *face,
  83. hb_tag_t table_tag,
  84. unsigned int start_offset,
  85. unsigned int *feature_count /* IN/OUT */,
  86. hb_tag_t *feature_tags /* OUT */);
  87. unsigned int
  88. hb_ot_layout_script_get_language_tags (hb_face_t *face,
  89. hb_tag_t table_tag,
  90. unsigned int script_index,
  91. unsigned int start_offset,
  92. unsigned int *language_count /* IN/OUT */,
  93. hb_tag_t *language_tags /* OUT */);
  94. hb_bool_t
  95. hb_ot_layout_script_find_language (hb_face_t *face,
  96. hb_tag_t table_tag,
  97. unsigned int script_index,
  98. hb_tag_t language_tag,
  99. unsigned int *language_index);
  100. hb_bool_t
  101. hb_ot_layout_language_get_required_feature_index (hb_face_t *face,
  102. hb_tag_t table_tag,
  103. unsigned int script_index,
  104. unsigned int language_index,
  105. unsigned int *feature_index);
  106. unsigned int
  107. hb_ot_layout_language_get_feature_indexes (hb_face_t *face,
  108. hb_tag_t table_tag,
  109. unsigned int script_index,
  110. unsigned int language_index,
  111. unsigned int start_offset,
  112. unsigned int *feature_count /* IN/OUT */,
  113. unsigned int *feature_indexes /* OUT */);
  114. unsigned int
  115. hb_ot_layout_language_get_feature_tags (hb_face_t *face,
  116. hb_tag_t table_tag,
  117. unsigned int script_index,
  118. unsigned int language_index,
  119. unsigned int start_offset,
  120. unsigned int *feature_count /* IN/OUT */,
  121. hb_tag_t *feature_tags /* OUT */);
  122. hb_bool_t
  123. hb_ot_layout_language_find_feature (hb_face_t *face,
  124. hb_tag_t table_tag,
  125. unsigned int script_index,
  126. unsigned int language_index,
  127. hb_tag_t feature_tag,
  128. unsigned int *feature_index);
  129. unsigned int
  130. hb_ot_layout_feature_get_lookup_indexes (hb_face_t *face,
  131. hb_tag_t table_tag,
  132. unsigned int feature_index,
  133. unsigned int start_offset,
  134. unsigned int *lookup_count /* IN/OUT */,
  135. unsigned int *lookup_indexes /* OUT */);
  136. /*
  137. * GSUB
  138. */
  139. hb_bool_t
  140. hb_ot_layout_has_substitution (hb_face_t *face);
  141. hb_bool_t
  142. hb_ot_layout_substitute_lookup (hb_face_t *face,
  143. hb_buffer_t *buffer,
  144. unsigned int lookup_index,
  145. hb_mask_t mask);
  146. /*
  147. * GPOS
  148. */
  149. hb_bool_t
  150. hb_ot_layout_has_positioning (hb_face_t *face);
  151. hb_bool_t
  152. hb_ot_layout_position_lookup (hb_font_t *font,
  153. hb_face_t *face,
  154. hb_buffer_t *buffer,
  155. unsigned int lookup_index,
  156. hb_mask_t mask);
  157. /* Should be called after all the position_lookup's are done */
  158. void
  159. hb_ot_layout_position_finish (hb_face_t *face, hb_buffer_t *buffer);
  160. HB_END_DECLS
  161. #endif /* HB_OT_LAYOUT_H */