ftpfr.h 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. /***************************************************************************/
  2. /* */
  3. /* ftpfr.h */
  4. /* */
  5. /* FreeType API for accessing PFR-specific data (specification only). */
  6. /* */
  7. /* Copyright 2002, 2003, 2004, 2006, 2008, 2009 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 __FTPFR_H__
  18. #define __FTPFR_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. /* pfr_fonts */
  31. /* */
  32. /* <Title> */
  33. /* PFR Fonts */
  34. /* */
  35. /* <Abstract> */
  36. /* PFR/TrueDoc specific API. */
  37. /* */
  38. /* <Description> */
  39. /* This section contains the declaration of PFR-specific functions. */
  40. /* */
  41. /*************************************************************************/
  42. /**********************************************************************
  43. *
  44. * @function:
  45. * FT_Get_PFR_Metrics
  46. *
  47. * @description:
  48. * Return the outline and metrics resolutions of a given PFR face.
  49. *
  50. * @input:
  51. * face :: Handle to the input face. It can be a non-PFR face.
  52. *
  53. * @output:
  54. * aoutline_resolution ::
  55. * Outline resolution. This is equivalent to `face->units_per_EM'
  56. * for non-PFR fonts. Optional (parameter can be NULL).
  57. *
  58. * ametrics_resolution ::
  59. * Metrics resolution. This is equivalent to `outline_resolution'
  60. * for non-PFR fonts. Optional (parameter can be NULL).
  61. *
  62. * ametrics_x_scale ::
  63. * A 16.16 fixed-point number used to scale distance expressed
  64. * in metrics units to device sub-pixels. This is equivalent to
  65. * `face->size->x_scale', but for metrics only. Optional (parameter
  66. * can be NULL).
  67. *
  68. * ametrics_y_scale ::
  69. * Same as `ametrics_x_scale' but for the vertical direction.
  70. * optional (parameter can be NULL).
  71. *
  72. * @return:
  73. * FreeType error code. 0~means success.
  74. *
  75. * @note:
  76. * If the input face is not a PFR, this function will return an error.
  77. * However, in all cases, it will return valid values.
  78. */
  79. FT_EXPORT( FT_Error )
  80. FT_Get_PFR_Metrics( FT_Face face,
  81. FT_UInt *aoutline_resolution,
  82. FT_UInt *ametrics_resolution,
  83. FT_Fixed *ametrics_x_scale,
  84. FT_Fixed *ametrics_y_scale );
  85. /**********************************************************************
  86. *
  87. * @function:
  88. * FT_Get_PFR_Kerning
  89. *
  90. * @description:
  91. * Return the kerning pair corresponding to two glyphs in a PFR face.
  92. * The distance is expressed in metrics units, unlike the result of
  93. * @FT_Get_Kerning.
  94. *
  95. * @input:
  96. * face :: A handle to the input face.
  97. *
  98. * left :: Index of the left glyph.
  99. *
  100. * right :: Index of the right glyph.
  101. *
  102. * @output:
  103. * avector :: A kerning vector.
  104. *
  105. * @return:
  106. * FreeType error code. 0~means success.
  107. *
  108. * @note:
  109. * This function always return distances in original PFR metrics
  110. * units. This is unlike @FT_Get_Kerning with the @FT_KERNING_UNSCALED
  111. * mode, which always returns distances converted to outline units.
  112. *
  113. * You can use the value of the `x_scale' and `y_scale' parameters
  114. * returned by @FT_Get_PFR_Metrics to scale these to device sub-pixels.
  115. */
  116. FT_EXPORT( FT_Error )
  117. FT_Get_PFR_Kerning( FT_Face face,
  118. FT_UInt left,
  119. FT_UInt right,
  120. FT_Vector *avector );
  121. /**********************************************************************
  122. *
  123. * @function:
  124. * FT_Get_PFR_Advance
  125. *
  126. * @description:
  127. * Return a given glyph advance, expressed in original metrics units,
  128. * from a PFR font.
  129. *
  130. * @input:
  131. * face :: A handle to the input face.
  132. *
  133. * gindex :: The glyph index.
  134. *
  135. * @output:
  136. * aadvance :: The glyph advance in metrics units.
  137. *
  138. * @return:
  139. * FreeType error code. 0~means success.
  140. *
  141. * @note:
  142. * You can use the `x_scale' or `y_scale' results of @FT_Get_PFR_Metrics
  143. * to convert the advance to device sub-pixels (i.e., 1/64th of pixels).
  144. */
  145. FT_EXPORT( FT_Error )
  146. FT_Get_PFR_Advance( FT_Face face,
  147. FT_UInt gindex,
  148. FT_Pos *aadvance );
  149. /* */
  150. FT_END_HEADER
  151. #endif /* __FTPFR_H__ */
  152. /* END */