sdl_ttf.pas 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443
  1. unit sdl_ttf;
  2. {
  3. $Id: sdl_ttf.pas,v 1.10 2005/01/02 19:07:32 savage Exp $
  4. }
  5. {******************************************************************************}
  6. { }
  7. { JEDI-SDL : Pascal units for SDL - Simple DirectMedia Layer }
  8. { Conversion of the Simple DirectMedia Layer Headers }
  9. { }
  10. { Portions created by Sam Lantinga <[email protected]> are }
  11. { Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga }
  12. { 5635-34 Springhouse Dr. }
  13. { Pleasanton, CA 94588 (USA) }
  14. { }
  15. { All Rights Reserved. }
  16. { }
  17. { The original files are : SDL_ttf.h }
  18. { }
  19. { The initial developer of this Pascal code was : }
  20. { Dominqiue Louis <[email protected]> }
  21. { }
  22. { Portions created by Dominqiue Louis are }
  23. { Copyright (C) 2000 - 2001 Dominqiue Louis. }
  24. { }
  25. { }
  26. { Contributor(s) }
  27. { -------------- }
  28. { Tom Jones <[email protected]> His Project inspired this conversion }
  29. { }
  30. { Obtained through: }
  31. { Joint Endeavour of Delphi Innovators ( Project JEDI ) }
  32. { }
  33. { You may retrieve the latest version of this file at the Project }
  34. { JEDI home page, located at http://delphi-jedi.org }
  35. { }
  36. { The contents of this file are used with permission, subject to }
  37. { the Mozilla Public License Version 1.1 (the "License"); you may }
  38. { not use this file except in compliance with the License. You may }
  39. { obtain a copy of the License at }
  40. { http://www.mozilla.org/MPL/MPL-1.1.html }
  41. { }
  42. { Software distributed under the License is distributed on an }
  43. { "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or }
  44. { implied. See the License for the specific language governing }
  45. { rights and limitations under the License. }
  46. { }
  47. { Description }
  48. { ----------- }
  49. { }
  50. { }
  51. { }
  52. { }
  53. { }
  54. { }
  55. { }
  56. { Requires }
  57. { -------- }
  58. { The SDL Runtime libraris on Win32 : SDL.dll on Linux : libSDL.so }
  59. { They are available from... }
  60. { http://www.libsdl.org . }
  61. { }
  62. { Programming Notes }
  63. { ----------------- }
  64. { }
  65. { }
  66. { }
  67. { }
  68. { Revision History }
  69. { ---------------- }
  70. { December 08 2002 - DL : Fixed definition of TTF_RenderUnicode_Solid }
  71. { }
  72. { April 03 2003 - DL : Added jedi-sdl.inc include file to support more }
  73. { Pascal compilers. Initial support is now included }
  74. { for GnuPascal, VirtualPascal, TMT and obviously }
  75. { continue support for Delphi Kylix and FreePascal. }
  76. { }
  77. { April 24 2003 - DL : under instruction from Alexey Barkovoy, I have added}
  78. { better TMT Pascal support and under instruction }
  79. { from Prof. Abimbola Olowofoyeku (The African Chief),}
  80. { I have added better Gnu Pascal support }
  81. { }
  82. { April 30 2003 - DL : under instruction from David Mears AKA }
  83. { Jason Siletto, I have added FPC Linux support. }
  84. { This was compiled with fpc 1.1, so remember to set }
  85. { include file path. ie. -Fi/usr/share/fpcsrc/rtl/* }
  86. { }
  87. {
  88. $Log: sdl_ttf.pas,v $
  89. Revision 1.10 2005/01/02 19:07:32 savage
  90. Slight bug fix to use LongInt instead of Long ( Thanks Michalis Kamburelis )
  91. Revision 1.9 2005/01/01 02:15:20 savage
  92. Updated to v2.0.7
  93. Revision 1.8 2004/10/07 21:02:32 savage
  94. Fix for FPC
  95. Revision 1.7 2004/09/30 22:39:50 savage
  96. Added a true type font class which contains a wrap text function.
  97. Changed the sdl_ttf.pas header to reflect the future of jedi-sdl.
  98. Revision 1.6 2004/08/14 22:54:30 savage
  99. Updated so that Library name defines are correctly defined for MacOS X.
  100. Revision 1.5 2004/05/10 14:10:04 savage
  101. Initial MacOS X support. Fixed defines for MACOS ( Classic ) and DARWIN ( MacOS X ).
  102. Revision 1.4 2004/04/13 09:32:08 savage
  103. Changed Shared object names back to just the .so extension to avoid conflicts on various Linux/Unix distros. Therefore developers will need to create Symbolic links to the actual Share Objects if necessary.
  104. Revision 1.3 2004/04/01 20:53:24 savage
  105. Changed Linux Shared Object names so they reflect the Symbolic Links that are created when installing the RPMs from the SDL site.
  106. Revision 1.2 2004/03/30 20:23:28 savage
  107. Tidied up use of UNIX compiler directive.
  108. Revision 1.1 2004/02/16 22:16:40 savage
  109. v1.0 changes
  110. }
  111. {******************************************************************************}
  112. {$I jedi-sdl.inc}
  113. interface
  114. uses
  115. {$IFDEF WIN32}
  116. Windows,
  117. {$ENDIF}
  118. sdl;
  119. const
  120. {$IFDEF WIN32}
  121. SDLttfLibName = 'SDL_ttf.dll';
  122. {$ENDIF}
  123. {$IFDEF UNIX}
  124. {$IFDEF DARWIN}
  125. SDLttfLibName = 'libSDL_ttf.dylib';
  126. {$ELSE}
  127. SDLttfLibName = 'libSDL_ttf.so';
  128. {$ENDIF}
  129. {$ENDIF}
  130. {$IFDEF MACOS}
  131. SDLttfLibName = 'SDL_ttf';
  132. {$ENDIF}
  133. {* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL *}
  134. SDL_TTF_MAJOR_VERSION = 2;
  135. {$EXTERNALSYM SDL_TTF_MAJOR_VERSION}
  136. SDL_TTF_MINOR_VERSION = 0;
  137. {$EXTERNALSYM SDL_TTF_MINOR_VERSION}
  138. SDL_TTF_PATCHLEVEL = 7;
  139. {$EXTERNALSYM SDL_TTF_PATCHLEVEL}
  140. // Backwards compatibility
  141. TTF_MAJOR_VERSION = SDL_TTF_MAJOR_VERSION;
  142. TTF_MINOR_VERSION = SDL_TTF_MINOR_VERSION;
  143. TTF_PATCHLEVEL = SDL_TTF_PATCHLEVEL;
  144. {*
  145. Set and retrieve the font style
  146. This font style is implemented by modifying the font glyphs, and
  147. doesn't reflect any inherent properties of the truetype font file.
  148. *}
  149. TTF_STYLE_NORMAL = $00;
  150. TTF_STYLE_BOLD = $01;
  151. TTF_STYLE_ITALIC = $02;
  152. TTF_STYLE_UNDERLINE = $04;
  153. // ZERO WIDTH NO-BREAKSPACE (Unicode byte order mark)
  154. UNICODE_BOM_NATIVE = $FEFF;
  155. UNICODE_BOM_SWAPPED = $FFFE;
  156. type
  157. PTTF_Font = ^TTTF_font;
  158. TTTF_Font = record
  159. end;
  160. { This macro can be used to fill a version structure with the compile-time
  161. version of the SDL_ttf library. }
  162. procedure SDL_TTF_VERSION( var X : TSDL_version );
  163. {$EXTERNALSYM SDL_TTF_VERSION}
  164. { This function gets the version of the dynamically linked SDL_ttf library.
  165. It should NOT be used to fill a version structure, instead you should use the
  166. SDL_TTF_VERSION() macro. }
  167. function TTF_Linked_Version : PSDL_version;
  168. cdecl; external {$IFDEF __GPC__}name 'TTF_Linked_Version'{$ELSE} SDLttfLibName{$ENDIF __GPC__};
  169. {$EXTERNALSYM TTF_Linked_Version}
  170. { This function tells the library whether UNICODE text is generally
  171. byteswapped. A UNICODE BOM character in a string will override
  172. this setting for the remainder of that string.
  173. }
  174. procedure TTF_ByteSwappedUNICODE( swapped : integer );
  175. cdecl; external {$IFDEF __GPC__}name 'TTF_ByteSwappedUNICODE'{$ELSE} SDLttfLibName{$ENDIF __GPC__};
  176. {$EXTERNALSYM TTF_ByteSwappedUNICODE}
  177. //returns 0 on succes, -1 if error occurs
  178. function TTF_Init : integer;
  179. cdecl; external {$IFDEF __GPC__}name 'TTF_Init'{$ELSE} SDLttfLibName{$ENDIF __GPC__};
  180. {$EXTERNALSYM TTF_Init}
  181. {
  182. Open a font file and create a font of the specified point size.
  183. Some .fon fonts will have several sizes embedded in the file, so the
  184. point size becomes the index of choosing which size. If the value
  185. is too high, the last indexed size will be the default.
  186. }
  187. function TTF_OpenFont( const filename : Pchar; ptsize : integer ) : PTTF_Font;
  188. cdecl; external {$IFDEF __GPC__}name 'TTF_OpenFont'{$ELSE} SDLttfLibName{$ENDIF __GPC__};
  189. {$EXTERNALSYM TTF_OpenFont}
  190. function TTF_OpenFontIndex( const filename : Pchar; ptsize : integer; index : Longint ): PTTF_Font;
  191. cdecl; external {$IFDEF __GPC__}name 'TTF_OpenFontIndex'{$ELSE} SDLttfLibName{$ENDIF __GPC__};
  192. {$EXTERNALSYM TTF_OpenFontIndex}
  193. function TTF_OpenFontRW( src : PSDL_RWops; freesrc : integer; ptsize : integer ): PTTF_Font;
  194. cdecl; external {$IFDEF __GPC__}name 'TTF_OpenFontRW'{$ELSE} SDLttfLibName{$ENDIF __GPC__};
  195. {$EXTERNALSYM TTF_OpenFontRW}
  196. function TTF_OpenFontIndexRW( src : PSDL_RWops; freesrc : integer; ptsize : integer; index : Longint ): PTTF_Font;
  197. cdecl; external {$IFDEF __GPC__}name 'TTF_OpenFontIndexRW'{$ELSE} SDLttfLibName{$ENDIF __GPC__};
  198. {$EXTERNALSYM TTF_OpenFontIndexRW}
  199. function TTF_GetFontStyle( font : PTTF_Font) : integer;
  200. cdecl; external {$IFDEF __GPC__}name 'TTF_GetFontStyle'{$ELSE} SDLttfLibName{$ENDIF __GPC__};
  201. {$EXTERNALSYM TTF_GetFontStyle}
  202. procedure TTF_SetFontStyle( font : PTTF_Font; style : integer );
  203. cdecl; external {$IFDEF __GPC__}name 'TTF_SetFontStyle'{$ELSE} SDLttfLibName{$ENDIF __GPC__};
  204. {$EXTERNALSYM TTF_SetFontStyle}
  205. { Get the total height of the font - usually equal to point size }
  206. function TTF_FontHeight( font : PTTF_Font ) : Integer;
  207. cdecl; external {$IFDEF __GPC__}name 'TTF_FontHeight'{$ELSE} SDLttfLibName{$ENDIF __GPC__};
  208. {$EXTERNALSYM TTF_FontHeight}
  209. { Get the offset from the baseline to the top of the font
  210. This is a positive value, relative to the baseline.
  211. }
  212. function TTF_FontAscent( font : PTTF_Font ) : Integer;
  213. cdecl; external {$IFDEF __GPC__}name 'TTF_FontAscent'{$ELSE} SDLttfLibName{$ENDIF __GPC__};
  214. {$EXTERNALSYM TTF_FontAscent}
  215. { Get the offset from the baseline to the bottom of the font
  216. This is a negative value, relative to the baseline.
  217. }
  218. function TTF_FontDescent( font : PTTF_Font ) : Integer;
  219. cdecl; external {$IFDEF __GPC__}name 'TTF_FontDescent'{$ELSE} SDLttfLibName{$ENDIF __GPC__};
  220. {$EXTERNALSYM TTF_FontDescent}
  221. { Get the recommended spacing between lines of text for this font }
  222. function TTF_FontLineSkip( font : PTTF_Font ): Integer;
  223. cdecl; external {$IFDEF __GPC__}name 'TTF_FontLineSkip'{$ELSE} SDLttfLibName{$ENDIF __GPC__};
  224. {$EXTERNALSYM TTF_FontLineSkip}
  225. { Get the number of faces of the font }
  226. function TTF_FontFaces( font : PTTF_Font ) : Longint;
  227. cdecl; external {$IFDEF __GPC__}name 'TTF_FontFaces'{$ELSE} SDLttfLibName{$ENDIF __GPC__};
  228. {$EXTERNALSYM TTF_FontFaces}
  229. { Get the font face attributes, if any }
  230. function TTF_FontFaceIsFixedWidth( font : PTTF_Font ): Integer;
  231. cdecl; external {$IFDEF __GPC__}name 'TTF_FontFaceIsFixedWidth'{$ELSE} SDLttfLibName{$ENDIF __GPC__};
  232. {$EXTERNALSYM TTF_FontFaceIsFixedWidth}
  233. function TTF_FontFaceFamilyName( font : PTTF_Font ): PChar;
  234. cdecl; external {$IFDEF __GPC__}name 'TTF_FontFaceFamilyName'{$ELSE} SDLttfLibName{$ENDIF __GPC__};
  235. {$EXTERNALSYM TTF_FontFaceFamilyName}
  236. function TTF_FontFaceStyleName( font : PTTF_Font ): PChar;
  237. cdecl; external {$IFDEF __GPC__}name 'TTF_FontFaceStyleName'{$ELSE} SDLttfLibName{$ENDIF __GPC__};
  238. {$EXTERNALSYM TTF_FontFaceStyleName}
  239. { Get the metrics (dimensions) of a glyph }
  240. function TTF_GlyphMetrics( font : PTTF_Font; ch : Uint16;
  241. var minx : integer; var maxx : integer;
  242. var miny : integer; var maxy : integer;
  243. var advance : integer ): Integer;
  244. cdecl; external {$IFDEF __GPC__}name 'TTF_GlyphMetrics'{$ELSE} SDLttfLibName{$ENDIF __GPC__};
  245. {$EXTERNALSYM TTF_GlyphMetrics}
  246. { Get the dimensions of a rendered string of text }
  247. function TTF_SizeText( font : PTTF_Font; const text : PChar; var w : integer; var y : integer ): Integer;
  248. cdecl; external {$IFDEF __GPC__}name 'TTF_SizeText'{$ELSE} SDLttfLibName{$ENDIF __GPC__};
  249. {$EXTERNALSYM TTF_SizeText}
  250. function TTF_SizeUTF8( font : PTTF_Font; const text : PChar; var w : integer; var y : integer): Integer;
  251. cdecl; external {$IFDEF __GPC__}name 'TTF_SizeUTF8'{$ELSE} SDLttfLibName{$ENDIF __GPC__};
  252. {$EXTERNALSYM TTF_SizeUTF8}
  253. function TTF_SizeUNICODE( font : PTTF_Font; const text : PUint16; var w : integer; var y : integer): Integer;
  254. cdecl; external {$IFDEF __GPC__}name 'TTF_SizeUNICODE'{$ELSE} SDLttfLibName{$ENDIF __GPC__};
  255. {$EXTERNALSYM TTF_SizeUNICODE}
  256. { Create an 8-bit palettized surface and render the given text at
  257. fast quality with the given font and color. The 0 pixel is the
  258. colorkey, giving a transparent background, and the 1 pixel is set
  259. to the text color.
  260. This function returns the new surface, or NULL if there was an error.
  261. }
  262. function TTF_RenderText_Solid( font : PTTF_Font;
  263. const text : PChar; fg : TSDL_Color ): PSDL_Surface;
  264. cdecl; external {$IFDEF __GPC__}name 'TTF_RenderText_Solid'{$ELSE} SDLttfLibName{$ENDIF __GPC__};
  265. {$EXTERNALSYM TTF_RenderText_Solid}
  266. function TTF_RenderUTF8_Solid( font : PTTF_Font;
  267. const text : PChar; fg : TSDL_Color ): PSDL_Surface;
  268. cdecl; external {$IFDEF __GPC__}name 'TTF_RenderUTF8_Solid'{$ELSE} SDLttfLibName{$ENDIF __GPC__};
  269. {$EXTERNALSYM TTF_RenderUTF8_Solid}
  270. function TTF_RenderUNICODE_Solid( font : PTTF_Font;
  271. const text :PUint16; fg : TSDL_Color ): PSDL_Surface;
  272. cdecl; external {$IFDEF __GPC__}name 'TTF_RenderUNICODE_Solid'{$ELSE} SDLttfLibName{$ENDIF __GPC__};
  273. {$EXTERNALSYM TTF_RenderUNICODE_Solid}
  274. {
  275. Create an 8-bit palettized surface and render the given glyph at
  276. fast quality with the given font and color. The 0 pixel is the
  277. colorkey, giving a transparent background, and the 1 pixel is set
  278. to the text color. The glyph is rendered without any padding or
  279. centering in the X direction, and aligned normally in the Y direction.
  280. This function returns the new surface, or NULL if there was an error.
  281. }
  282. function TTF_RenderGlyph_Solid( font : PTTF_Font;
  283. ch : Uint16; fg : TSDL_Color ): PSDL_Surface;
  284. cdecl; external {$IFDEF __GPC__}name 'TTF_RenderGlyph_Solid'{$ELSE} SDLttfLibName{$ENDIF __GPC__};
  285. {$EXTERNALSYM TTF_RenderGlyph_Solid}
  286. { Create an 8-bit palettized surface and render the given text at
  287. high quality with the given font and colors. The 0 pixel is background,
  288. while other pixels have varying degrees of the foreground color.
  289. This function returns the new surface, or NULL if there was an error.
  290. }
  291. function TTF_RenderText_Shaded( font : PTTF_Font;
  292. const text : PChar; fg : TSDL_Color; bg : TSDL_Color ): PSDL_Surface;
  293. cdecl; external {$IFDEF __GPC__}name 'TTF_RenderText_Shaded'{$ELSE} SDLttfLibName{$ENDIF __GPC__};
  294. {$EXTERNALSYM TTF_RenderText_Shaded}
  295. function TTF_RenderUTF8_Shaded( font : PTTF_Font;
  296. const text : PChar; fg : TSDL_Color; bg : TSDL_Color ): PSDL_Surface;
  297. cdecl; external {$IFDEF __GPC__}name 'TTF_RenderUTF8_Shaded'{$ELSE} SDLttfLibName{$ENDIF __GPC__};
  298. {$EXTERNALSYM TTF_RenderUTF8_Shaded}
  299. function TTF_RenderUNICODE_Shaded( font : PTTF_Font;
  300. const text : PUint16; fg : TSDL_Color; bg : TSDL_Color ): PSDL_Surface;
  301. cdecl; external {$IFDEF __GPC__}name 'TTF_RenderUNICODE_Shaded'{$ELSE} SDLttfLibName{$ENDIF __GPC__};
  302. {$EXTERNALSYM TTF_RenderUNICODE_Shaded}
  303. { Create an 8-bit palettized surface and render the given glyph at
  304. high quality with the given font and colors. The 0 pixel is background,
  305. while other pixels have varying degrees of the foreground color.
  306. The glyph is rendered without any padding or centering in the X
  307. direction, and aligned normally in the Y direction.
  308. This function returns the new surface, or NULL if there was an error.
  309. }
  310. function TTF_RenderGlyph_Shaded( font : PTTF_Font; ch : Uint16; fg : TSDL_Color;
  311. bg : TSDL_Color ): PSDL_Surface;
  312. cdecl; external {$IFDEF __GPC__}name 'TTF_RenderGlyph_Shaded'{$ELSE} SDLttfLibName{$ENDIF __GPC__};
  313. {$EXTERNALSYM TTF_RenderGlyph_Shaded}
  314. { Create a 32-bit ARGB surface and render the given text at high quality,
  315. using alpha blending to dither the font with the given color.
  316. This function returns the new surface, or NULL if there was an error.
  317. }
  318. function TTF_RenderText_Blended( font : PTTF_Font;
  319. const text : PChar; fg : TSDL_Color ): PSDL_Surface;
  320. cdecl; external {$IFDEF __GPC__}name 'TTF_RenderText_Blended'{$ELSE} SDLttfLibName{$ENDIF __GPC__};
  321. {$EXTERNALSYM TTF_RenderText_Blended}
  322. function TTF_RenderUTF8_Blended( font : PTTF_Font;
  323. const text : PChar; fg : TSDL_Color ): PSDL_Surface;
  324. cdecl; external {$IFDEF __GPC__}name 'TTF_RenderUTF8_Blended'{$ELSE} SDLttfLibName{$ENDIF __GPC__};
  325. {$EXTERNALSYM TTF_RenderUTF8_Blended}
  326. function TTF_RenderUNICODE_Blended( font : PTTF_Font;
  327. const text: PUint16; fg : TSDL_Color ): PSDL_Surface;
  328. cdecl; external {$IFDEF __GPC__}name 'TTF_RenderUNICODE_Blended'{$ELSE} SDLttfLibName{$ENDIF __GPC__};
  329. {$EXTERNALSYM TTF_RenderUNICODE_Blended}
  330. { Create a 32-bit ARGB surface and render the given glyph at high quality,
  331. using alpha blending to dither the font with the given color.
  332. The glyph is rendered without any padding or centering in the X
  333. direction, and aligned normally in the Y direction.
  334. This function returns the new surface, or NULL if there was an error.
  335. }
  336. function TTF_RenderGlyph_Blended( font : PTTF_Font; ch : Uint16; fg : TSDL_Color ): PSDL_Surface;
  337. cdecl; external {$IFDEF __GPC__}name 'TTF_RenderGlyph_Blended'{$ELSE} SDLttfLibName{$ENDIF __GPC__};
  338. {$EXTERNALSYM TTF_RenderGlyph_Blended}
  339. { For compatibility with previous versions, here are the old functions }
  340. {#define TTF_RenderText(font, text, fg, bg)
  341. TTF_RenderText_Shaded(font, text, fg, bg)
  342. #define TTF_RenderUTF8(font, text, fg, bg)
  343. TTF_RenderUTF8_Shaded(font, text, fg, bg)
  344. #define TTF_RenderUNICODE(font, text, fg, bg)
  345. TTF_RenderUNICODE_Shaded(font, text, fg, bg)}
  346. { Close an opened font file }
  347. procedure TTF_CloseFont( font : PTTF_Font );
  348. cdecl; external {$IFDEF __GPC__}name 'TTF_CloseFont'{$ELSE} SDLttfLibName{$ENDIF __GPC__};
  349. {$EXTERNALSYM TTF_CloseFont}
  350. //De-initialize TTF engine
  351. procedure TTF_Quit;
  352. cdecl; external {$IFDEF __GPC__}name 'TTF_Quit'{$ELSE} SDLttfLibName{$ENDIF __GPC__};
  353. {$EXTERNALSYM TTF_Quit}
  354. // Check if the TTF engine is initialized
  355. function TTF_WasInit : integer;
  356. cdecl; external {$IFDEF __GPC__}name 'TTF_WasInit'{$ELSE} SDLttfLibName{$ENDIF __GPC__};
  357. {$EXTERNALSYM TTF_WasInit}
  358. // We'll use SDL for reporting errors
  359. procedure TTF_SetError( fmt : PChar );
  360. function TTF_GetError : PChar;
  361. implementation
  362. {$IFDEF __GPC__}
  363. {$L 'sdl_ttf'} { link sdl_ttf.dll.a or libsdl_ttf.so or libsdl_ttf.a }
  364. {$ENDIF}
  365. procedure SDL_TTF_VERSION( var X : TSDL_version );
  366. begin
  367. X.major := SDL_TTF_MAJOR_VERSION;
  368. X.minor := SDL_TTF_MINOR_VERSION;
  369. X.patch := SDL_TTF_PATCHLEVEL;
  370. end;
  371. procedure TTF_SetError( fmt : PChar );
  372. begin
  373. SDL_SetError( fmt );
  374. end;
  375. function TTF_GetError : PChar;
  376. begin
  377. result := SDL_GetError;
  378. end;
  379. end.