From 0cbd1912cced9158dfb97a18d98565463b6997b8 Mon Sep 17 00:00:00 2001 From: Björn Stenberg Date: Sun, 11 Aug 2002 09:36:25 +0000 Subject: Forgot to add new files git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1669 a1c6a512-1295-4272-9138-f99709370657 --- tools/bdf2ajf.h | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 tools/bdf2ajf.h 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 @@ +/** +* Copyright (C) 2002 Alex Gitelman +* +*/ +#ifndef __BDF2AJF__ +#define __BDF2AJF__ + +#include "../firmware/ajf.h" + + +#define STARTFONT "STARTFONT" +#define ENDFONT "ENDFONT" +#define COMMENT "COMMENT" +#define FONT "FONT" +#define SIZE "SIZE" +#define FONTBOUNDINGBOX "FONTBOUNDINGBOX" +#define STARTPROPERTIES "STARTPROPERTIES" +#define ENDPROPERTIES "ENDPROPERTIES" +#define CHARS "CHARS" +#define STARTCHAR "STARTCHAR" +#define ENDCHAR "ENDCHAR" +#define ENCODING "ENCODING" +#define SWIDTH "SWIDTH" +#define DWIDTH "DWIDTH" +#define BBX "BBX" +#define BITMAP "BITMAP" + +typedef struct +{ + char *glyph_name; + int encoding; + int swidth_x; + int swidth_y; + int dwidth_x; + int dwidth_y; + int bbx_width; + int bbx_height; + int bbx_disp_x; + int bbx_disp_y; + unsigned char *bitmap; + short bitmap_len; +} BDF_GLYPH; + +typedef struct +{ + char *bdf_ver; + char *name; + int point_size; + int x_res; + int y_res; + int bound_width; + int bound_height; + int bound_disp_x; + int bound_disp_y; + int prop_count; + char **prop_name; + char **prop_value; + int char_count; + BDF_GLYPH** glyph; + BDF_GLYPH* enc_table[256]; +} BDF; + +typedef union +{ + unsigned char db[2]; + unsigned short sval; +} DOUBLE_BYTE; + +BDF* readFont(const char *name); +BDF_GLYPH* getGlyph(unsigned char c, BDF* bdf, short* enc_map); +void getBitmap(BDF_GLYPH* g, unsigned char* src); + +void test_print(unsigned char c, BDF* font, short *map); +void test_print2(unsigned char *src, int height, int len); + + +extern short win_koi_map[]; + +extern int _font_error_code; +extern char _font_error_msg[]; +void report_error(int code, const char *msg); +void writeAJF(BDF* bdf, const char* fname); + + + + + + +#endif + -- cgit v1.2.3