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