ftmac.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. /***************************************************************************/
  2. /* */
  3. /* ftmac.h */
  4. /* */
  5. /* Additional Mac-specific API. */
  6. /* */
  7. /* Copyright 1996-2001, 2004, 2006, 2007, 2013 by */
  8. /* Just van Rossum, 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. /***************************************************************************/
  18. /* */
  19. /* NOTE: Include this file after FT_FREETYPE_H and after any */
  20. /* Mac-specific headers (because this header uses Mac types such as */
  21. /* Handle, FSSpec, FSRef, etc.) */
  22. /* */
  23. /***************************************************************************/
  24. #ifndef __FTMAC_H__
  25. #define __FTMAC_H__
  26. #include <ft2build.h>
  27. FT_BEGIN_HEADER
  28. /* gcc-3.4.1 and later can warn about functions tagged as deprecated */
  29. #ifndef FT_DEPRECATED_ATTRIBUTE
  30. #if defined(__GNUC__) && \
  31. ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
  32. #define FT_DEPRECATED_ATTRIBUTE __attribute__((deprecated))
  33. #else
  34. #define FT_DEPRECATED_ATTRIBUTE
  35. #endif
  36. #endif
  37. /*************************************************************************/
  38. /* */
  39. /* <Section> */
  40. /* mac_specific */
  41. /* */
  42. /* <Title> */
  43. /* Mac Specific Interface */
  44. /* */
  45. /* <Abstract> */
  46. /* Only available on the Macintosh. */
  47. /* */
  48. /* <Description> */
  49. /* The following definitions are only available if FreeType is */
  50. /* compiled on a Macintosh. */
  51. /* */
  52. /*************************************************************************/
  53. /*************************************************************************/
  54. /* */
  55. /* <Function> */
  56. /* FT_New_Face_From_FOND */
  57. /* */
  58. /* <Description> */
  59. /* Create a new face object from a FOND resource. */
  60. /* */
  61. /* <InOut> */
  62. /* library :: A handle to the library resource. */
  63. /* */
  64. /* <Input> */
  65. /* fond :: A FOND resource. */
  66. /* */
  67. /* face_index :: Only supported for the -1 `sanity check' special */
  68. /* case. */
  69. /* */
  70. /* <Output> */
  71. /* aface :: A handle to a new face object. */
  72. /* */
  73. /* <Return> */
  74. /* FreeType error code. 0~means success. */
  75. /* */
  76. /* <Notes> */
  77. /* This function can be used to create @FT_Face objects from fonts */
  78. /* that are installed in the system as follows. */
  79. /* */
  80. /* { */
  81. /* fond = GetResource( 'FOND', fontName ); */
  82. /* error = FT_New_Face_From_FOND( library, fond, 0, &face ); */
  83. /* } */
  84. /* */
  85. FT_EXPORT( FT_Error )
  86. FT_New_Face_From_FOND( FT_Library library,
  87. Handle fond,
  88. FT_Long face_index,
  89. FT_Face *aface )
  90. FT_DEPRECATED_ATTRIBUTE;
  91. /*************************************************************************/
  92. /* */
  93. /* <Function> */
  94. /* FT_GetFile_From_Mac_Name */
  95. /* */
  96. /* <Description> */
  97. /* Return an FSSpec for the disk file containing the named font. */
  98. /* */
  99. /* <Input> */
  100. /* fontName :: Mac OS name of the font (e.g., Times New Roman */
  101. /* Bold). */
  102. /* */
  103. /* <Output> */
  104. /* pathSpec :: FSSpec to the file. For passing to */
  105. /* @FT_New_Face_From_FSSpec. */
  106. /* */
  107. /* face_index :: Index of the face. For passing to */
  108. /* @FT_New_Face_From_FSSpec. */
  109. /* */
  110. /* <Return> */
  111. /* FreeType error code. 0~means success. */
  112. /* */
  113. FT_EXPORT( FT_Error )
  114. FT_GetFile_From_Mac_Name( const char* fontName,
  115. FSSpec* pathSpec,
  116. FT_Long* face_index )
  117. FT_DEPRECATED_ATTRIBUTE;
  118. /*************************************************************************/
  119. /* */
  120. /* <Function> */
  121. /* FT_GetFile_From_Mac_ATS_Name */
  122. /* */
  123. /* <Description> */
  124. /* Return an FSSpec for the disk file containing the named font. */
  125. /* */
  126. /* <Input> */
  127. /* fontName :: Mac OS name of the font in ATS framework. */
  128. /* */
  129. /* <Output> */
  130. /* pathSpec :: FSSpec to the file. For passing to */
  131. /* @FT_New_Face_From_FSSpec. */
  132. /* */
  133. /* face_index :: Index of the face. For passing to */
  134. /* @FT_New_Face_From_FSSpec. */
  135. /* */
  136. /* <Return> */
  137. /* FreeType error code. 0~means success. */
  138. /* */
  139. FT_EXPORT( FT_Error )
  140. FT_GetFile_From_Mac_ATS_Name( const char* fontName,
  141. FSSpec* pathSpec,
  142. FT_Long* face_index )
  143. FT_DEPRECATED_ATTRIBUTE;
  144. /*************************************************************************/
  145. /* */
  146. /* <Function> */
  147. /* FT_GetFilePath_From_Mac_ATS_Name */
  148. /* */
  149. /* <Description> */
  150. /* Return a pathname of the disk file and face index for given font */
  151. /* name that is handled by ATS framework. */
  152. /* */
  153. /* <Input> */
  154. /* fontName :: Mac OS name of the font in ATS framework. */
  155. /* */
  156. /* <Output> */
  157. /* path :: Buffer to store pathname of the file. For passing */
  158. /* to @FT_New_Face. The client must allocate this */
  159. /* buffer before calling this function. */
  160. /* */
  161. /* maxPathSize :: Lengths of the buffer `path' that client allocated. */
  162. /* */
  163. /* face_index :: Index of the face. For passing to @FT_New_Face. */
  164. /* */
  165. /* <Return> */
  166. /* FreeType error code. 0~means success. */
  167. /* */
  168. FT_EXPORT( FT_Error )
  169. FT_GetFilePath_From_Mac_ATS_Name( const char* fontName,
  170. UInt8* path,
  171. UInt32 maxPathSize,
  172. FT_Long* face_index )
  173. FT_DEPRECATED_ATTRIBUTE;
  174. /*************************************************************************/
  175. /* */
  176. /* <Function> */
  177. /* FT_New_Face_From_FSSpec */
  178. /* */
  179. /* <Description> */
  180. /* Create a new face object from a given resource and typeface index */
  181. /* using an FSSpec to the font file. */
  182. /* */
  183. /* <InOut> */
  184. /* library :: A handle to the library resource. */
  185. /* */
  186. /* <Input> */
  187. /* spec :: FSSpec to the font file. */
  188. /* */
  189. /* face_index :: The index of the face within the resource. The */
  190. /* first face has index~0. */
  191. /* <Output> */
  192. /* aface :: A handle to a new face object. */
  193. /* */
  194. /* <Return> */
  195. /* FreeType error code. 0~means success. */
  196. /* */
  197. /* <Note> */
  198. /* @FT_New_Face_From_FSSpec is identical to @FT_New_Face except */
  199. /* it accepts an FSSpec instead of a path. */
  200. /* */
  201. FT_EXPORT( FT_Error )
  202. FT_New_Face_From_FSSpec( FT_Library library,
  203. const FSSpec *spec,
  204. FT_Long face_index,
  205. FT_Face *aface )
  206. FT_DEPRECATED_ATTRIBUTE;
  207. /*************************************************************************/
  208. /* */
  209. /* <Function> */
  210. /* FT_New_Face_From_FSRef */
  211. /* */
  212. /* <Description> */
  213. /* Create a new face object from a given resource and typeface index */
  214. /* using an FSRef to the font file. */
  215. /* */
  216. /* <InOut> */
  217. /* library :: A handle to the library resource. */
  218. /* */
  219. /* <Input> */
  220. /* spec :: FSRef to the font file. */
  221. /* */
  222. /* face_index :: The index of the face within the resource. The */
  223. /* first face has index~0. */
  224. /* <Output> */
  225. /* aface :: A handle to a new face object. */
  226. /* */
  227. /* <Return> */
  228. /* FreeType error code. 0~means success. */
  229. /* */
  230. /* <Note> */
  231. /* @FT_New_Face_From_FSRef is identical to @FT_New_Face except */
  232. /* it accepts an FSRef instead of a path. */
  233. /* */
  234. FT_EXPORT( FT_Error )
  235. FT_New_Face_From_FSRef( FT_Library library,
  236. const FSRef *ref,
  237. FT_Long face_index,
  238. FT_Face *aface )
  239. FT_DEPRECATED_ATTRIBUTE;
  240. /* */
  241. FT_END_HEADER
  242. #endif /* __FTMAC_H__ */
  243. /* END */