ftmm.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. /***************************************************************************/
  2. /* */
  3. /* ftmm.h */
  4. /* */
  5. /* FreeType Multiple Master font interface (specification). */
  6. /* */
  7. /* Copyright 1996-2001 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 __FTMM_H__
  18. #define __FTMM_H__
  19. #include <ft2build.h>
  20. #include FT_TYPE1_TABLES_H
  21. FT_BEGIN_HEADER
  22. /*************************************************************************/
  23. /* */
  24. /* <Section> */
  25. /* multiple_masters */
  26. /* */
  27. /* <Title> */
  28. /* Multiple Masters */
  29. /* */
  30. /* <Abstract> */
  31. /* How to manage Multiple Masters fonts. */
  32. /* */
  33. /* <Description> */
  34. /* The following types and functions are used to manage Multiple */
  35. /* Master fonts, i.e. the selection of specific design instances by */
  36. /* setting design axis coordinates. */
  37. /* */
  38. /*************************************************************************/
  39. /*************************************************************************/
  40. /* */
  41. /* <Struct> */
  42. /* FT_MM_Axis */
  43. /* */
  44. /* <Description> */
  45. /* A simple structure used to model a given axis in design space for */
  46. /* Multiple Masters fonts. */
  47. /* */
  48. /* <Fields> */
  49. /* name :: The axis's name. */
  50. /* */
  51. /* minimum :: The axis's minimum design coordinate. */
  52. /* */
  53. /* maximum :: The axis's maximum design coordinate. */
  54. /* */
  55. typedef struct FT_MM_Axis_
  56. {
  57. FT_String* name;
  58. FT_Long minimum;
  59. FT_Long maximum;
  60. } FT_MM_Axis;
  61. /*************************************************************************/
  62. /* */
  63. /* <Struct> */
  64. /* FT_Multi_Master */
  65. /* */
  66. /* <Description> */
  67. /* A structure used to model the axes and space of a Multiple Masters */
  68. /* font. */
  69. /* */
  70. /* <Fields> */
  71. /* num_axis :: Number of axes. Cannot exceed 4. */
  72. /* */
  73. /* num_designs :: Number of designs; should ne normally 2^num_axis */
  74. /* even though the Type 1 specification strangely */
  75. /* allows for intermediate designs to be present. This */
  76. /* number cannot exceed 16. */
  77. /* */
  78. /* axis :: A table of axis descriptors. */
  79. /* */
  80. typedef struct FT_Multi_Master_
  81. {
  82. FT_UInt num_axis;
  83. FT_UInt num_designs;
  84. FT_MM_Axis axis[T1_MAX_MM_AXIS];
  85. } FT_Multi_Master;
  86. /* */
  87. typedef FT_Error
  88. (*FT_Get_MM_Func)( FT_Face face,
  89. FT_Multi_Master* master );
  90. typedef FT_Error
  91. (*FT_Set_MM_Design_Func)( FT_Face face,
  92. FT_UInt num_coords,
  93. FT_Long* coords );
  94. typedef FT_Error
  95. (*FT_Set_MM_Blend_Func)( FT_Face face,
  96. FT_UInt num_coords,
  97. FT_Long* coords );
  98. /*************************************************************************/
  99. /* */
  100. /* <Function> */
  101. /* FT_Get_Multi_Master */
  102. /* */
  103. /* <Description> */
  104. /* Retrieves the Multiple Master descriptor of a given font. */
  105. /* */
  106. /* <Input> */
  107. /* face :: A handle to the source face. */
  108. /* */
  109. /* <Output> */
  110. /* amaster :: The Multiple Masters descriptor. */
  111. /* */
  112. /* <Return> */
  113. /* FreeType error code. 0 means success. */
  114. /* */
  115. FT_EXPORT( FT_Error )
  116. FT_Get_Multi_Master( FT_Face face,
  117. FT_Multi_Master *amaster );
  118. /*************************************************************************/
  119. /* */
  120. /* <Function> */
  121. /* FT_Set_MM_Design_Coordinates */
  122. /* */
  123. /* <Description> */
  124. /* For Multiple Masters fonts, choose an interpolated font design */
  125. /* through design coordinates. */
  126. /* */
  127. /* <InOut> */
  128. /* face :: A handle to the source face. */
  129. /* */
  130. /* <Input> */
  131. /* num_coords :: The number of design coordinates (must be equal to */
  132. /* the number of axes in the font). */
  133. /* */
  134. /* coords :: An array of design coordinates. */
  135. /* */
  136. /* <Return> */
  137. /* FreeType error code. 0 means success. */
  138. /* */
  139. FT_EXPORT( FT_Error )
  140. FT_Set_MM_Design_Coordinates( FT_Face face,
  141. FT_UInt num_coords,
  142. FT_Long* coords );
  143. /*************************************************************************/
  144. /* */
  145. /* <Function> */
  146. /* FT_Set_MM_Blend_Coordinates */
  147. /* */
  148. /* <Description> */
  149. /* For Multiple Masters fonts, choose an interpolated font design */
  150. /* through normalized blend coordinates. */
  151. /* */
  152. /* <InOut> */
  153. /* face :: A handle to the source face. */
  154. /* */
  155. /* <Input> */
  156. /* num_coords :: The number of design coordinates (must be equal to */
  157. /* the number of axes in the font). */
  158. /* */
  159. /* coords :: The design coordinates array (each element must be */
  160. /* between 0 and 1.0). */
  161. /* */
  162. /* <Return> */
  163. /* FreeType error code. 0 means success. */
  164. /* */
  165. FT_EXPORT( FT_Error )
  166. FT_Set_MM_Blend_Coordinates( FT_Face face,
  167. FT_UInt num_coords,
  168. FT_Fixed* coords );
  169. /* */
  170. FT_END_HEADER
  171. #endif /* __FTMM_H__ */
  172. /* END */