File: SDL_kanji.h

package info (click to toggle)
ruby-sdl 2.1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 4,344 kB
  • ctags: 4,200
  • sloc: cpp: 7,598; ansic: 4,475; ruby: 2,258; sh: 102; makefile: 97
file content (48 lines) | stat: -rw-r--r-- 1,283 bytes parent folder | download | duplicates (7)
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
48
#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;
	/* 邢ǁA܂ɂ͂ȂȁB */
	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