00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef _SDL_TTF_H
00031 #define _SDL_TTF_H
00032
00033 #include "SDL.h"
00034 #include "begin_code.h"
00035 #include "config.h"
00036
00037
00038 #ifdef __cplusplus
00039 extern "C" {
00040 #endif
00041
00042
00043
00044 #define SDL_TTF_MAJOR_VERSION 2
00045 #define SDL_TTF_MINOR_VERSION 0
00046 #define SDL_TTF_PATCHLEVEL 7
00047
00048
00049
00050
00051 #define SDL_TTF_VERSION(X) \
00052 { \
00053 (X)->major = SDL_TTF_MAJOR_VERSION; \
00054 (X)->minor = SDL_TTF_MINOR_VERSION; \
00055 (X)->patch = SDL_TTF_PATCHLEVEL; \
00056 }
00057
00058
00059 #define TTF_MAJOR_VERSION SDL_TTF_MAJOR_VERSION
00060 #define TTF_MINOR_VERSION SDL_TTF_MINOR_VERSION
00061 #define TTF_PATCHLEVEL SDL_TTF_PATCHLEVEL
00062 #define TTF_VERSION(X) SDL_TTF_VERSION(X)
00063
00064
00065
00066
00067
00068 extern DECLSPEC const SDL_version * SDLCALL TTF_Linked_Version(void);
00069
00070
00071 #define UNICODE_BOM_NATIVE 0xFEFF
00072 #define UNICODE_BOM_SWAPPED 0xFFFE
00073
00074
00075
00076
00077
00078 extern DECLSPEC void SDLCALL TTF_ByteSwappedUNICODE(int swapped);
00079
00080
00081 typedef struct _TTF_Font TTF_Font;
00082
00083
00084 extern DECLSPEC int SDLCALL TTF_Init(void);
00085
00086
00087
00088
00089
00090 extern DECLSPEC TTF_Font * SDLCALL TTF_OpenFont(const char *file, int ptsize);
00091 extern DECLSPEC TTF_Font * SDLCALL TTF_OpenFontIndex(const char *file, int ptsize, long index);
00092 extern DECLSPEC TTF_Font * SDLCALL TTF_OpenFontRW(SDL_RWops *src, int freesrc, int ptsize);
00093 extern DECLSPEC TTF_Font * SDLCALL TTF_OpenFontIndexRW(SDL_RWops *src, int freesrc, int ptsize, long index);
00094
00095
00096
00097
00098
00099 #define TTF_STYLE_NORMAL 0x00
00100 #define TTF_STYLE_BOLD 0x01
00101 #define TTF_STYLE_ITALIC 0x02
00102 #define TTF_STYLE_UNDERLINE 0x04
00103 extern DECLSPEC int SDLCALL TTF_GetFontStyle(TTF_Font *font);
00104 extern DECLSPEC void SDLCALL TTF_SetFontStyle(TTF_Font *font, int style);
00105
00106
00107 extern DECLSPEC int SDLCALL TTF_FontHeight(TTF_Font *font);
00108
00109
00110
00111
00112 extern DECLSPEC int SDLCALL TTF_FontAscent(TTF_Font *font);
00113
00114
00115
00116
00117 extern DECLSPEC int SDLCALL TTF_FontDescent(TTF_Font *font);
00118
00119
00120 extern DECLSPEC int SDLCALL TTF_FontLineSkip(TTF_Font *font);
00121
00122
00123 extern DECLSPEC long SDLCALL TTF_FontFaces(TTF_Font *font);
00124
00125
00126 extern DECLSPEC int SDLCALL TTF_FontFaceIsFixedWidth(TTF_Font *font);
00127 extern DECLSPEC char * SDLCALL TTF_FontFaceFamilyName(TTF_Font *font);
00128 extern DECLSPEC char * SDLCALL TTF_FontFaceStyleName(TTF_Font *font);
00129
00130
00131 extern DECLSPEC int SDLCALL TTF_GlyphMetrics(TTF_Font *font, Uint16 ch,
00132 int *minx, int *maxx,
00133 int *miny, int *maxy, int *advance);
00134
00135
00136 extern DECLSPEC int SDLCALL TTF_SizeText(TTF_Font *font, const char *text, int *w, int *h);
00137 extern DECLSPEC int SDLCALL TTF_SizeUTF8(TTF_Font *font, const char *text, int *w, int *h);
00138 extern DECLSPEC int SDLCALL TTF_SizeUNICODE(TTF_Font *font, const Uint16 *text, int *w, int *h);
00139
00140
00141
00142
00143
00144
00145
00146 extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderText_Solid(TTF_Font *font,
00147 const char *text, SDL_Color fg);
00148 extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUTF8_Solid(TTF_Font *font,
00149 const char *text, SDL_Color fg);
00150 extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUNICODE_Solid(TTF_Font *font,
00151 const Uint16 *text, SDL_Color fg);
00152
00153
00154
00155
00156
00157
00158
00159
00160 extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderGlyph_Solid(TTF_Font *font,
00161 Uint16 ch, SDL_Color fg);
00162
00163
00164
00165
00166
00167
00168 extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderText_Shaded(TTF_Font *font,
00169 const char *text, SDL_Color fg, SDL_Color bg);
00170 extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUTF8_Shaded(TTF_Font *font,
00171 const char *text, SDL_Color fg, SDL_Color bg);
00172 extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUNICODE_Shaded(TTF_Font *font,
00173 const Uint16 *text, SDL_Color fg, SDL_Color bg);
00174
00175
00176
00177
00178
00179
00180
00181
00182 extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderGlyph_Shaded(TTF_Font *font,
00183 Uint16 ch, SDL_Color fg, SDL_Color bg);
00184
00185
00186
00187
00188
00189 extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderText_Blended(TTF_Font *font,
00190 const char *text, SDL_Color fg);
00191 extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUTF8_Blended(TTF_Font *font,
00192 const char *text, SDL_Color fg);
00193 extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUNICODE_Blended(TTF_Font *font,
00194 const Uint16 *text, SDL_Color fg);
00195
00196
00197
00198
00199
00200
00201
00202 extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderGlyph_Blended(TTF_Font *font,
00203 Uint16 ch, SDL_Color fg);
00204
00205
00206 #define TTF_RenderText(font, text, fg, bg) \
00207 TTF_RenderText_Shaded(font, text, fg, bg)
00208 #define TTF_RenderUTF8(font, text, fg, bg) \
00209 TTF_RenderUTF8_Shaded(font, text, fg, bg)
00210 #define TTF_RenderUNICODE(font, text, fg, bg) \
00211 TTF_RenderUNICODE_Shaded(font, text, fg, bg)
00212
00213
00214 extern DECLSPEC void SDLCALL TTF_CloseFont(TTF_Font *font);
00215
00216
00217 extern DECLSPEC void SDLCALL TTF_Quit(void);
00218
00219
00220 extern DECLSPEC int SDLCALL TTF_WasInit(void);
00221
00222
00223 #define TTF_SetError SDL_SetError
00224 #define TTF_GetError SDL_GetError
00225
00226
00227 #ifdef __cplusplus
00228 }
00229 #endif
00230 #include "close_code.h"
00231
00232 #endif