otlcommn.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. /***************************************************************************/
  2. /* */
  3. /* otlcommn.h */
  4. /* */
  5. /* OpenType layout support, common tables (specification). */
  6. /* */
  7. /* Copyright 2002 by */
  8. /* David Turner, Robert Wilhelm, and Werner Lemberg. */
  9. /* */
  10. /* This file is part of the FreeType project, and may only be used, */
  11. /* modified, and distributed under the terms of the FreeType project */
  12. /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
  13. /* this file you indicate that you have read the license and */
  14. /* understand and accept it fully. */
  15. /* */
  16. /***************************************************************************/
  17. #ifndef __OTLCOMMN_H__
  18. #define __OTLCOMMN_H__
  19. #include "otlayout.h"
  20. OTL_BEGIN_HEADER
  21. /*************************************************************************/
  22. /*************************************************************************/
  23. /***** *****/
  24. /***** COVERAGE TABLE *****/
  25. /***** *****/
  26. /*************************************************************************/
  27. /*************************************************************************/
  28. /* validate coverage table */
  29. OTL_LOCALDEF( void )
  30. otl_coverage_validate( OTL_Bytes base,
  31. OTL_Validator valid );
  32. /* return number of covered glyphs */
  33. OTL_LOCALDEF( OTL_UInt )
  34. otl_coverage_get_count( OTL_Bytes base );
  35. /* Return the coverage index corresponding to a glyph glyph index. */
  36. /* Return -1 if the glyph isn't covered. */
  37. OTL_LOCALDEF( OTL_Int )
  38. otl_coverage_get_index( OTL_Bytes base,
  39. OTL_UInt glyph_index );
  40. /*************************************************************************/
  41. /*************************************************************************/
  42. /***** *****/
  43. /***** CLASS DEFINITION TABLE *****/
  44. /***** *****/
  45. /*************************************************************************/
  46. /*************************************************************************/
  47. /* validate class definition table */
  48. OTL_LOCALDEF( void )
  49. otl_class_definition_validate( OTL_Bytes table,
  50. OTL_Validator valid );
  51. /* return class value for a given glyph index */
  52. OTL_LOCALDEF( OTL_UInt )
  53. otl_class_definition_get_value( OTL_Bytes table,
  54. OTL_UInt glyph_index );
  55. /*************************************************************************/
  56. /*************************************************************************/
  57. /***** *****/
  58. /***** DEVICE TABLE *****/
  59. /***** *****/
  60. /*************************************************************************/
  61. /*************************************************************************/
  62. /* validate a device table */
  63. OTL_LOCALDEF( void )
  64. otl_device_table_validate( OTL_Bytes table,
  65. OTL_Validator valid );
  66. /* return a device table's first size */
  67. OTL_LOCALDEF( OTL_UInt )
  68. otl_device_table_get_start( OTL_Bytes table );
  69. /* return a device table's last size */
  70. OTL_LOCALDEF( OTL_UInt )
  71. otl_device_table_get_end( OTL_Bytes table );
  72. /* return pixel adjustment for a given size */
  73. OTL_LOCALDEF( OTL_Int )
  74. otl_device_table_get_delta( OTL_Bytes table,
  75. OTL_UInt size );
  76. /*************************************************************************/
  77. /*************************************************************************/
  78. /***** *****/
  79. /***** LOOKUPS *****/
  80. /***** *****/
  81. /*************************************************************************/
  82. /*************************************************************************/
  83. /* validate lookup table */
  84. OTL_LOCALDEF( void )
  85. otl_lookup_validate( OTL_Bytes table,
  86. OTL_Validator valid );
  87. /* return number of sub-tables in a lookup */
  88. OTL_LOCALDEF( OTL_UInt )
  89. otl_lookup_get_count( OTL_Bytes table );
  90. /* return lookup sub-table */
  91. OTL_LOCALDEF( OTL_Bytes )
  92. otl_lookup_get_table( OTL_Bytes table,
  93. OTL_UInt idx );
  94. /*************************************************************************/
  95. /*************************************************************************/
  96. /***** *****/
  97. /***** LOOKUP LISTS *****/
  98. /***** *****/
  99. /*************************************************************************/
  100. /*************************************************************************/
  101. /* validate lookup list */
  102. OTL_LOCALDEF( void )
  103. otl_lookup_list_validate( OTL_Bytes table,
  104. OTL_Validator valid );
  105. /* return number of lookups in list */
  106. OTL_LOCALDEF( OTL_UInt )
  107. otl_lookup_list_get_count( OTL_Bytes table );
  108. /* return a given lookup from a list */
  109. OTL_LOCALDEF( OTL_Bytes )
  110. otl_lookup_list_get_lookup( OTL_Bytes table,
  111. OTL_UInt idx );
  112. /* return lookup sub-table from a list */
  113. OTL_LOCALDEF( OTL_Bytes )
  114. otl_lookup_list_get_table( OTL_Bytes table,
  115. OTL_UInt lookup_index,
  116. OTL_UInt table_index );
  117. /* iterate over lookup list */
  118. OTL_LOCALDEF( void )
  119. otl_lookup_list_foreach( OTL_Bytes table,
  120. OTL_ForeachFunc func,
  121. OTL_Pointer func_data );
  122. /*************************************************************************/
  123. /*************************************************************************/
  124. /***** *****/
  125. /***** FEATURES *****/
  126. /***** *****/
  127. /*************************************************************************/
  128. /*************************************************************************/
  129. /* validate feature table */
  130. OTL_LOCALDEF( void )
  131. otl_feature_validate( OTL_Bytes table,
  132. OTL_Validator valid );
  133. /* return feature's lookup count */
  134. OTL_LOCALDEF( OTL_UInt )
  135. otl_feature_get_count( OTL_Bytes table );
  136. /* get several lookups indices from a feature. returns the number of */
  137. /* lookups grabbed */
  138. OTL_LOCALDEF( OTL_UInt )
  139. otl_feature_get_lookups( OTL_Bytes table,
  140. OTL_UInt start,
  141. OTL_UInt count,
  142. OTL_UInt *lookups );
  143. /*************************************************************************/
  144. /*************************************************************************/
  145. /***** *****/
  146. /***** FEATURE LIST *****/
  147. /***** *****/
  148. /*************************************************************************/
  149. /*************************************************************************/
  150. /* validate a feature list */
  151. OTL_LOCALDEF( void )
  152. otl_feature_list_validate( OTL_Bytes table,
  153. OTL_Validator valid );
  154. /* return number of features in list */
  155. OTL_LOCALDEF( OTL_UInt )
  156. otl_feature_list_get_count( OTL_Bytes table );
  157. /* return a given feature from a list */
  158. OTL_LOCALDEF( OTL_Bytes )
  159. otl_feature_list_get_feature( OTL_Bytes table,
  160. OTL_UInt idx );
  161. /* iterate over all features in a list */
  162. OTL_LOCALDEF( void )
  163. otl_feature_list_foreach( OTL_Bytes table,
  164. OTL_ForeachFunc func,
  165. OTL_Pointer func_data );
  166. /*************************************************************************/
  167. /*************************************************************************/
  168. /***** *****/
  169. /***** LANGUAGE SYSTEM *****/
  170. /***** *****/
  171. /*************************************************************************/
  172. /*************************************************************************/
  173. OTL_LOCAL( void )
  174. otl_lang_validate( OTL_Bytes table,
  175. OTL_Validator valid );
  176. OTL_LOCAL( OTL_UInt )
  177. otl_lang_get_req_feature( OTL_Bytes table );
  178. OTL_LOCAL( OTL_UInt )
  179. otl_lang_get_count( OTL_Bytes table );
  180. OTL_LOCAL( OTL_UInt )
  181. otl_lang_get_features( OTL_Bytes table,
  182. OTL_UInt start,
  183. OTL_UInt count,
  184. OTL_UInt *features );
  185. /*************************************************************************/
  186. /*************************************************************************/
  187. /***** *****/
  188. /***** SCRIPTS *****/
  189. /***** *****/
  190. /*************************************************************************/
  191. /*************************************************************************/
  192. OTL_LOCAL( void )
  193. otl_script_list_validate( OTL_Bytes list,
  194. OTL_Validator valid );
  195. OTL_LOCAL( OTL_Bytes )
  196. otl_script_list_get_script( OTL_Bytes table );
  197. /*************************************************************************/
  198. /*************************************************************************/
  199. /***** *****/
  200. /***** LOOKUP LISTS *****/
  201. /***** *****/
  202. /*************************************************************************/
  203. /*************************************************************************/
  204. OTL_LOCAL( void )
  205. otl_lookup_list_validate( OTL_Bytes list,
  206. OTL_UInt type_count,
  207. OTL_ValidateFunc* type_funcs,
  208. OTL_Validator valid );
  209. /* */
  210. OTL_END_HEADER
  211. #endif /* __OTLCOMMN_H__ */
  212. /* END */