/src/freetype/include/freetype/ftadvanc.h

https://bitbucket.org/cabalistic/ogredeps/ · C++ Header · 179 lines · 24 code · 21 blank · 134 comment · 0 complexity · 559bba84b0728345116a4f954165149f MD5 · raw file

  1. /***************************************************************************/
  2. /* */
  3. /* ftadvanc.h */
  4. /* */
  5. /* Quick computation of advance widths (specification only). */
  6. /* */
  7. /* Copyright 2008 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 __FTADVANC_H__
  18. #define __FTADVANC_H__
  19. #include <ft2build.h>
  20. #include FT_FREETYPE_H
  21. #ifdef FREETYPE_H
  22. #error "freetype.h of FreeType 1 has been loaded!"
  23. #error "Please fix the directory search order for header files"
  24. #error "so that freetype.h of FreeType 2 is found first."
  25. #endif
  26. FT_BEGIN_HEADER
  27. /**************************************************************************
  28. *
  29. * @section:
  30. * quick_advance
  31. *
  32. * @title:
  33. * Quick retrieval of advance values
  34. *
  35. * @abstract:
  36. * Retrieve horizontal and vertical advance values without processing
  37. * glyph outlines, if possible.
  38. *
  39. * @description:
  40. * This section contains functions to quickly extract advance values
  41. * without handling glyph outlines, if possible.
  42. */
  43. /*************************************************************************/
  44. /* */
  45. /* <Const> */
  46. /* FT_ADVANCE_FLAG_FAST_ONLY */
  47. /* */
  48. /* <Description> */
  49. /* A bit-flag to be OR-ed with the `flags' parameter of the */
  50. /* @FT_Get_Advance and @FT_Get_Advances functions. */
  51. /* */
  52. /* If set, it indicates that you want these functions to fail if the */
  53. /* corresponding hinting mode or font driver doesn't allow for very */
  54. /* quick advance computation. */
  55. /* */
  56. /* Typically, glyphs which are either unscaled, unhinted, bitmapped, */
  57. /* or light-hinted can have their advance width computed very */
  58. /* quickly. */
  59. /* */
  60. /* Normal and bytecode hinted modes, which require loading, scaling, */
  61. /* and hinting of the glyph outline, are extremely slow by */
  62. /* comparison. */
  63. /* */
  64. #define FT_ADVANCE_FLAG_FAST_ONLY 0x20000000UL
  65. /*************************************************************************/
  66. /* */
  67. /* <Function> */
  68. /* FT_Get_Advance */
  69. /* */
  70. /* <Description> */
  71. /* Retrieve the advance value of a given glyph outline in an */
  72. /* @FT_Face. By default, the unhinted advance is returned in font */
  73. /* units. */
  74. /* */
  75. /* <Input> */
  76. /* face :: The source @FT_Face handle. */
  77. /* */
  78. /* gindex :: The glyph index. */
  79. /* */
  80. /* load_flags :: A set of bit flags similar to those used when */
  81. /* calling @FT_Load_Glyph, used to determine what kind */
  82. /* of advances you need. */
  83. /* <Output> */
  84. /* padvance :: The advance value, in either font units or 16.16 */
  85. /* format. */
  86. /* */
  87. /* If @FT_LOAD_VERTICAL_LAYOUT is set, this is the */
  88. /* vertical advance corresponding to a vertical layout. */
  89. /* Otherwise, it is the horizontal advance in a */
  90. /* horizontal layout. */
  91. /* */
  92. /* <Return> */
  93. /* FreeType error code. 0 means success. */
  94. /* */
  95. /* <Note> */
  96. /* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and */
  97. /* if the corresponding font backend doesn't have a quick way to */
  98. /* retrieve the advances. */
  99. /* */
  100. /* A scaled advance is returned in 16.16 format but isn't transformed */
  101. /* by the affine transformation specified by @FT_Set_Transform. */
  102. /* */
  103. FT_EXPORT( FT_Error )
  104. FT_Get_Advance( FT_Face face,
  105. FT_UInt gindex,
  106. FT_Int32 load_flags,
  107. FT_Fixed *padvance );
  108. /*************************************************************************/
  109. /* */
  110. /* <Function> */
  111. /* FT_Get_Advances */
  112. /* */
  113. /* <Description> */
  114. /* Retrieve the advance values of several glyph outlines in an */
  115. /* @FT_Face. By default, the unhinted advances are returned in font */
  116. /* units. */
  117. /* */
  118. /* <Input> */
  119. /* face :: The source @FT_Face handle. */
  120. /* */
  121. /* start :: The first glyph index. */
  122. /* */
  123. /* count :: The number of advance values you want to retrieve. */
  124. /* */
  125. /* load_flags :: A set of bit flags similar to those used when */
  126. /* calling @FT_Load_Glyph. */
  127. /* */
  128. /* <Output> */
  129. /* padvance :: The advances, in either font units or 16.16 format. */
  130. /* This array must contain at least `count' elements. */
  131. /* */
  132. /* If @FT_LOAD_VERTICAL_LAYOUT is set, these are the */
  133. /* vertical advances corresponding to a vertical layout. */
  134. /* Otherwise, they are the horizontal advances in a */
  135. /* horizontal layout. */
  136. /* */
  137. /* <Return> */
  138. /* FreeType error code. 0 means success. */
  139. /* */
  140. /* <Note> */
  141. /* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and */
  142. /* if the corresponding font backend doesn't have a quick way to */
  143. /* retrieve the advances. */
  144. /* */
  145. /* Scaled advances are returned in 16.16 format but aren't */
  146. /* transformed by the affine transformation specified by */
  147. /* @FT_Set_Transform. */
  148. /* */
  149. FT_EXPORT( FT_Error )
  150. FT_Get_Advances( FT_Face face,
  151. FT_UInt start,
  152. FT_UInt count,
  153. FT_Int32 load_flags,
  154. FT_Fixed *padvances );
  155. /* */
  156. FT_END_HEADER
  157. #endif /* __FTADVANC_H__ */
  158. /* END */