ftmac.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. /***************************************************************************/
  2. /* */
  3. /* ftmac.h */
  4. /* */
  5. /* Additional Mac-specific API. */
  6. /* */
  7. /* Copyright 1996-2001, 2004, 2006, 2007 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 <freetype/freetype.h> and after the */
  20. /* Mac-specific <Types.h> header (or any other Mac header that */
  21. /* includes <Types.h>); we use Handle type. */
  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. /*************************************************************************/
  91. /* */
  92. /* <Function> */
  93. /* FT_GetFile_From_Mac_Name */
  94. /* */
  95. /* <Description> */
  96. /* Return an FSSpec for the disk file containing the named font. */
  97. /* */
  98. /* <Input> */
  99. /* fontName :: Mac OS name of the font (e.g., Times New Roman */
  100. /* Bold). */
  101. /* */
  102. /* <Output> */
  103. /* pathSpec :: FSSpec to the file. For passing to */
  104. /* @FT_New_Face_From_FSSpec. */
  105. /* */
  106. /* face_index :: Index of the face. For passing to */
  107. /* @FT_New_Face_From_FSSpec. */
  108. /* */
  109. /* <Return> */
  110. /* FreeType error code. 0 means success. */
  111. /* */
  112. FT_EXPORT( FT_Error )
  113. FT_GetFile_From_Mac_Name( const char* fontName,
  114. FSSpec* pathSpec,
  115. FT_Long* face_index )
  116. FT_DEPRECATED_ATTRIBUTE;
  117. /*************************************************************************/
  118. /* */
  119. /* <Function> */
  120. /* FT_GetFile_From_Mac_ATS_Name */
  121. /* */
  122. /* <Description> */
  123. /* Return an FSSpec for the disk file containing the named font. */
  124. /* */
  125. /* <Input> */
  126. /* fontName :: Mac OS name of the font in ATS framework. */
  127. /* */
  128. /* <Output> */
  129. /* pathSpec :: FSSpec to the file. For passing to */
  130. /* @FT_New_Face_From_FSSpec. */
  131. /* */
  132. /* face_index :: Index of the face. For passing to */
  133. /* @FT_New_Face_From_FSSpec. */
  134. /* */
  135. /* <Return> */
  136. /* FreeType error code. 0 means success. */
  137. /* */
  138. FT_EXPORT( FT_Error )
  139. FT_GetFile_From_Mac_ATS_Name( const char* fontName,
  140. FSSpec* pathSpec,
  141. FT_Long* face_index )
  142. FT_DEPRECATED_ATTRIBUTE;
  143. /*************************************************************************/
  144. /* */
  145. /* <Function> */
  146. /* FT_GetFilePath_From_Mac_ATS_Name */
  147. /* */
  148. /* <Description> */
  149. /* Return a pathname of the disk file and face index for given font */
  150. /* name which is handled by ATS framework. */
  151. /* */
  152. /* <Input> */
  153. /* fontName :: Mac OS name of the font in ATS framework. */
  154. /* */
  155. /* <Output> */
  156. /* path :: Buffer to store pathname of the file. For passing */
  157. /* to @FT_New_Face. The client must allocate this */
  158. /* buffer before calling this function. */
  159. /* */
  160. /* maxPathSize :: Lengths of the buffer `path' that client allocated. */
  161. /* */
  162. /* face_index :: Index of the face. For passing to @FT_New_Face. */
  163. /* */
  164. /* <Return> */
  165. /* FreeType error code. 0 means success. */
  166. /* */
  167. FT_EXPORT( FT_Error )
  168. FT_GetFilePath_From_Mac_ATS_Name( const char* fontName,
  169. UInt8* path,
  170. UInt32 maxPathSize,
  171. FT_Long* face_index );
  172. /*************************************************************************/
  173. /* */
  174. /* <Function> */
  175. /* FT_New_Face_From_FSSpec */
  176. /* */
  177. /* <Description> */
  178. /* Create a new face object from a given resource and typeface index */
  179. /* using an FSSpec to the font file. */
  180. /* */
  181. /* <InOut> */
  182. /* library :: A handle to the library resource. */
  183. /* */
  184. /* <Input> */
  185. /* spec :: FSSpec to the font file. */
  186. /* */
  187. /* face_index :: The index of the face within the resource. The */
  188. /* first face has index 0. */
  189. /* <Output> */
  190. /* aface :: A handle to a new face object. */
  191. /* */
  192. /* <Return> */
  193. /* FreeType error code. 0 means success. */
  194. /* */
  195. /* <Note> */
  196. /* @FT_New_Face_From_FSSpec is identical to @FT_New_Face except */
  197. /* it accepts an FSSpec instead of a path. */
  198. /* */
  199. FT_EXPORT( FT_Error )
  200. FT_New_Face_From_FSSpec( FT_Library library,
  201. const FSSpec *spec,
  202. FT_Long face_index,
  203. FT_Face *aface )
  204. FT_DEPRECATED_ATTRIBUTE;
  205. /*************************************************************************/
  206. /* */
  207. /* <Function> */
  208. /* FT_New_Face_From_FSRef */
  209. /* */
  210. /* <Description> */
  211. /* Create a new face object from a given resource and typeface index */
  212. /* using an FSRef to the font file. */
  213. /* */
  214. /* <InOut> */
  215. /* library :: A handle to the library resource. */
  216. /* */
  217. /* <Input> */
  218. /* spec :: FSRef to the font file. */
  219. /* */
  220. /* face_index :: The index of the face within the resource. The */
  221. /* first face has index 0. */
  222. /* <Output> */
  223. /* aface :: A handle to a new face object. */
  224. /* */
  225. /* <Return> */
  226. /* FreeType error code. 0 means success. */
  227. /* */
  228. /* <Note> */
  229. /* @FT_New_Face_From_FSRef is identical to @FT_New_Face except */
  230. /* it accepts an FSRef instead of a path. */
  231. /* */
  232. FT_EXPORT( FT_Error )
  233. FT_New_Face_From_FSRef( FT_Library library,
  234. const FSRef *ref,
  235. FT_Long face_index,
  236. FT_Face *aface )
  237. FT_DEPRECATED_ATTRIBUTE;
  238. /* */
  239. FT_END_HEADER
  240. #endif /* __FTMAC_H__ */
  241. /* END */