-
Notifications
You must be signed in to change notification settings - Fork 6
/
SDL_kanji.h
48 lines (35 loc) · 1.25 KB
/
SDL_kanji.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef SDLbdf_h_
#define SDLbdf_h_
#include <SDL.h>
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
typedef enum { KANJI_SJIS, KANJI_EUC, KANJI_JIS } Kanji_CodingSystem;
typedef struct {
int k_size;
int a_size;
Kanji_CodingSystem sys;
/* メモリ効率わるいけど、まあ死にはしないわな。 */
Uint32* moji[96*96+256];
} Kanji_Font;
Kanji_Font* Kanji_OpenFont(const char* file, int size);
int Kanji_AddFont(Kanji_Font* font, const char* file);
void Kanji_SetCodingSystem(Kanji_Font* font, Kanji_CodingSystem sys);
int Kanji_FontHeight(Kanji_Font* font);
/* text == 0 なら ASCII 一文字分の幅を返す */
int Kanji_FontWidth(Kanji_Font* font, const char* text);
SDL_Surface* Kanji_CreateSurface(Kanji_Font* font, const char* text,
SDL_Color fg, int bpp);
int Kanji_PutText(Kanji_Font* font, int dx, int dy,
SDL_Surface* dst, const char* text, SDL_Color fg);
SDL_Surface* Kanji_CreateSurfaceTate(Kanji_Font* font, const char* text,
SDL_Color fg, int bpp);
int Kanji_PutTextTate(Kanji_Font* font, int dx, int dy,
SDL_Surface* dst, const char* text, SDL_Color fg);
void Kanji_CloseFont(Kanji_Font* font);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
};
#endif
#endif