123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202 |
- #ifndef __OFONT_H
- #define __OFONT_H
- #ifndef __ALL_H
- #include <ALL.h>
- #endif
- #ifndef __OVGABUF_H
- #include <OVGABUF.h>
- #endif
- #ifndef __OTRANSL_H
- #include <OTRANSL.h>
- #endif
- #define DEFAULT_LINE_SPACE 2
-
-
- #define FIRST_NATION_COLOR_CODE_IN_TEXT 0x80
- #define LAST_NATION_COLOR_CODE_IN_TEXT 0x8f
- #define NATION_COLOR_BAR_WIDTH 13
- #define NATION_COLOR_BAR_HEIGHT 13
- #define MAX_HYPER_FIELD 30
- struct HyperField
- {
- short x1, y1, x2, y2;
- char* text_ptr;
- short text_len;
- };
- struct FontInfo;
- class Font
- {
- public:
- char init_flag;
- char* next_text_ptr;
- short next_text_y;
- short line_count;
- short font_height;
- short std_font_height;
- short max_font_height;
- short max_font_width;
- short space_width;
- short inter_char_space;
- unsigned short first_char;
- unsigned short last_char;
- FontInfo* font_info_array;
- char* font_bitmap_buf;
- public:
- static short hyper_field_count;
- static HyperField hyper_field_array[MAX_HYPER_FIELD];
- public:
- Font(char* =NULL);
- ~Font();
- void init(char* fontName, int interCharSpace=1, int italicShift=0);
- void deinit();
- int height() { return font_height; }
- int width() { return space_width; }
- void use_std_height() { font_height = std_font_height; }
- void use_max_height() { font_height = max_font_height; }
- int text_width(char*, int= -1, int=0);
- int text_height(int=DEFAULT_LINE_SPACE);
- int put(int,int,char*,char=0,int= -1);
- int put(int x, int y, int value, char clearBack=0, int x2= -1)
- { return put( x, y, m.format(value), clearBack, x2 ); }
- void put_char(int,int,unsigned short);
- void right_put(int,int,char*);
- int d3_put(int,int,char*);
- void d3_put(int,int,int,int,char*);
- int center_put(int,int,int,int,char*,char clearBack=0);
- void put_paragraph(int,int,int,int,char*,int=DEFAULT_LINE_SPACE,int=1,char=1);
- void count_line(int x1, int y1, int x2, int y2, char *text,
- int lineSpace, int& totalLines, int& dispLines);
- void put_char_to_buffer(char* dest, int destPitch, int x1, int y1, unsigned short text);
- void put_to_buffer(char* dest, int destPitch, int x1, int y1, char *text);
- void center_put_to_buffer(char* dest, int destPitch, int x1, int y1, int x2, int y2, char *text);
- short translate_german_char(short textChar);
-
- void put_field(int,int,char*,int,int,int=1);
- void update_field(int,int,int,int,int);
- void field(int,int,char*,int,int,int,int,int,char* helpCode=NULL);
- int disp(int,int,int,int,int);
-
- void put_field(int a,int b,char* c,int d,short e,int f=1)
- { put_field(a,b,c,d,(int)e,f); }
- void update_field(int a,int b,short c,int d,int e)
- { update_field(a,b,(int)c,d,e); }
- void field(int a,int b,char* c,int d,short e,int f,int g,int h,char* helpCode=NULL)
- { field(a,b,c,d,(int)e,f,g,h); }
- int disp(int a,int b,short c,int d,int e)
- { return disp(a,b,(int)c,d,e); }
-
- void put_field(int a,int b,char* c,int d,long e,int f=1)
- { put_field(a,b,c,d,(int)e,f); }
- void update_field(int a,int b,long c,int d,int e)
- { update_field(a,b,(int)c,d,e); }
- void field(int a,int b,char* c,int d,long e,int f,int g,int h,char* helpCode=NULL)
- { field(a,b,c,d,(int)e,f,g,h); }
- int disp(int a,int b,long c,int d,int e)
- { return disp(a,b,(int)c,d,e); }
-
- void put_field(int,int,char*,int,double,int=1);
- void update_field(int,int,double,int,int);
- void field(int,int,char*,int,double,int,int,int,char* helpCode=NULL);
- int disp(int,int,double,int,int);
-
- void put_field(int,int,char*,int,char*);
- void update_field(int,int,char*,int);
- void field(int,int,char*,int,char*,int,int,char* helpCode=NULL);
- int disp(int,int,char*,int);
- };
- extern Font font_san, font_std, font_small, font_mid, font_news;
- extern Font font_hitpoint, font_bible, font_bard;
- #if( defined(GERMAN) || defined(FRENCH) || defined(SPANISH) )
- extern Font font_hall;
- #endif
- #endif
|