summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/bdf2ajf.h90
1 files changed, 90 insertions, 0 deletions
diff --git a/tools/bdf2ajf.h b/tools/bdf2ajf.h
new file mode 100644
index 0000000000..6367fae00b
--- /dev/null
+++ b/tools/bdf2ajf.h
@@ -0,0 +1,90 @@
1/**
2* Copyright (C) 2002 Alex Gitelman
3*
4*/
5#ifndef __BDF2AJF__
6#define __BDF2AJF__
7
8#include "../firmware/ajf.h"
9
10
11#define STARTFONT "STARTFONT"
12#define ENDFONT "ENDFONT"
13#define COMMENT "COMMENT"
14#define FONT "FONT"
15#define SIZE "SIZE"
16#define FONTBOUNDINGBOX "FONTBOUNDINGBOX"
17#define STARTPROPERTIES "STARTPROPERTIES"
18#define ENDPROPERTIES "ENDPROPERTIES"
19#define CHARS "CHARS"
20#define STARTCHAR "STARTCHAR"
21#define ENDCHAR "ENDCHAR"
22#define ENCODING "ENCODING"
23#define SWIDTH "SWIDTH"
24#define DWIDTH "DWIDTH"
25#define BBX "BBX"
26#define BITMAP "BITMAP"
27
28typedef struct
29{
30 char *glyph_name;
31 int encoding;
32 int swidth_x;
33 int swidth_y;
34 int dwidth_x;
35 int dwidth_y;
36 int bbx_width;
37 int bbx_height;
38 int bbx_disp_x;
39 int bbx_disp_y;
40 unsigned char *bitmap;
41 short bitmap_len;
42} BDF_GLYPH;
43
44typedef struct
45{
46 char *bdf_ver;
47 char *name;
48 int point_size;
49 int x_res;
50 int y_res;
51 int bound_width;
52 int bound_height;
53 int bound_disp_x;
54 int bound_disp_y;
55 int prop_count;
56 char **prop_name;
57 char **prop_value;
58 int char_count;
59 BDF_GLYPH** glyph;
60 BDF_GLYPH* enc_table[256];
61} BDF;
62
63typedef union
64{
65 unsigned char db[2];
66 unsigned short sval;
67} DOUBLE_BYTE;
68
69BDF* readFont(const char *name);
70BDF_GLYPH* getGlyph(unsigned char c, BDF* bdf, short* enc_map);
71void getBitmap(BDF_GLYPH* g, unsigned char* src);
72
73void test_print(unsigned char c, BDF* font, short *map);
74void test_print2(unsigned char *src, int height, int len);
75
76
77extern short win_koi_map[];
78
79extern int _font_error_code;
80extern char _font_error_msg[];
81void report_error(int code, const char *msg);
82void writeAJF(BDF* bdf, const char* fname);
83
84
85
86
87
88
89#endif
90