GadgetSeed  0.9.6
font.h
[詳解]
1 /** @file
2  @brief フォント
3 
4  @date 2007.03.25
5  @author Takashi SHUDO
6 */
7 
8 #ifndef INCLUDE_FONT_H
9 #define INCLUDE_FONT_H
10 
11 #include "str.h"
12 #include "graphics.h"
13 #include "fontdata.h"
14 
15 #define FONT_FIXEDWIDTH 0 ///< 全フォントを固定幅で描画
16 #define FONT_PROPORTIONAL 1 ///< 各フォントの幅で描画
17 
18 #define FONT_HATTR_LEFT 0 ///< 左寄せ
19 #define FONT_HATTR_CENTER 1 ///< 中心
20 #define FONT_HATTR_RIGHT 2 ///< 右寄せ
21 
22 #define FONT_VATTR_TOP 0 ///< 上寄せ
23 #define FONT_VATTR_CENTER 1 ///< 中心
24 #define FONT_VATTR_BOTTOM 2 ///< 下寄せ
25 
26 extern void init_font(void);
27 extern void set_fontset(struct st_fontset *fontset);
28 extern struct st_fontset * get_fontset(void);
29 extern int fontset_count(void);
30 extern const char * fontset_name(int num);
31 extern struct st_fontset * get_fontptr_by_name(char *name);
32 extern struct st_fontset * set_font_by_name(char *name);
33 extern void set_font_drawmode(int mode);
34 extern unsigned short draw_char(short x, short y, ushort ch);
35 extern void draw_str(short x, short y, uchar *str);
36 extern void draw_fixed_width_str(short x, short y, uchar *str, short width);
37 extern void draw_str_in_box(struct st_box *box, int hattr, int vattr, unsigned char *str);
38 extern unsigned short font_width(unsigned short ch);
39 extern unsigned short str_width(uchar *str);
40 extern unsigned short font_height(void);
41 
42 #endif // INCLUDE_FONT_H
struct st_fontset * get_fontptr_by_name(char *name)
フォントセットのポインタを取得する
Definition: font.c:200
unsigned char uchar
GadgetSeedの文字(列)は unsigned char 型となる
Definition: str.h:13
char name[MAX_FONTNAMELEN]
フォントセット名
Definition: fontdata.h:24
const char * fontset_name(int num)
フォント名を取得する
Definition: font.c:188
unsigned short font_height(void)
カレントフォントセットの文字高さを取得する
Definition: font.c:703
フォントデータ構造
int fontset_count(void)
登録されているフォントセットの数を取得する
Definition: font.c:170
文字列処理
void draw_str(short x, short y, uchar *str)
文字列を描画する
Definition: font.c:494
フォントセット
Definition: fontdata.h:23
長(正)方形
Definition: graphics.h:81
void set_font_drawmode(int mode)
フォント描画モードを設定する
Definition: font.c:247
void set_fontset(struct st_fontset *fontset)
描画に使用するフォントセット(カレントフォントセット)を設定する
Definition: font.c:150
struct st_fontset * set_font_by_name(char *name)
カレントフォントセットをフォント名で設定する
Definition: font.c:226
void draw_str_in_box(struct st_box *box, int hattr, int vattr, unsigned char *str)
四角形内に文字列を描画する
Definition: font.c:589
struct st_fontset * get_fontset(void)
描画に使用されているフォントセット(カレントフォントセット)取得する
Definition: font.c:160
unsigned short draw_char(short x, short y, ushort ch)
文字を描画する
Definition: font.c:433
unsigned short font_width(unsigned short ch)
カレントフォントセットの文字幅を取得する
Definition: font.c:648
unsigned short str_width(uchar *str)
カレントフォントセットの文字列幅を取得する
Definition: font.c:677
unsigned short ushort
2バイト(UTF-16)文字
Definition: str.h:14
グラフィックライブラリ
void draw_fixed_width_str(short x, short y, uchar *str, short width)
固定幅で文字列を描画する
Definition: font.c:520