summaryrefslogtreecommitdiff
path: root/firmware/ajf.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/ajf.h')
-rw-r--r--firmware/ajf.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/firmware/ajf.h b/firmware/ajf.h
new file mode 100644
index 0000000000..70d94fb3e0
--- /dev/null
+++ b/firmware/ajf.h
@@ -0,0 +1,52 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Alex Gitelman
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19#ifndef __AJF__
20#define __AJF__
21
22/* defined here because they are used by tools/bdf2ajz */
23#define MAGIC1 0xBD
24#define MAGIC2 0xFC
25#define MAX_FONT_BUFLEN 4096
26
27#define CODE_PAGE_OFFSET 2 /* 1 byte TODO: unused now */
28#define FONT_NAME_OFFSET 3
29#define FONT_NAME_LEN 32
30#define MAX_WIDTH_OFFSET (FONT_NAME_OFFSET + FONT_NAME_LEN) /* 2 byte */
31#define HEIGHT_OFFSET (MAX_WIDTH_OFFSET + 2) /* 2 byte */
32#define ASCENT_OFFSET (HEIGHT_OFFSET+2) /* 2 byte ascent (baseline) height*/
33#define FIRST_CHAR_OFFSET (HEIGHT_OFFSET+2) /* 2 bytes first character of font*/
34#define SIZE_OFFSET (FIRST_CHAR_OFFSET+2) /* 2 bytes size of font (# encodings)*/
35#define LOOKUP_MAP_OFFSET SIZE_OFFSET+2 /* Map to lookup char positions */
36
37
38#define WRITE_SHORT(s,buf) { (buf)[0] = (s & 0xff00) >> 8 ; \
39 (buf)[1] = s & 0x00ff; }
40#define READ_SHORT(buf) (((buf)[0]<<8) + (buf)[1])
41
42unsigned char* ajf_read_font(char* fname);
43unsigned char* ajf_get_charbuf(unsigned char c, unsigned char* font,
44 int *width, int *height);
45void ajf_get_charsize(unsigned char c, unsigned char* font,
46 int *width, int *height);
47int ajf_get_fontheight(unsigned char* font);
48
49extern char _font_error_msg[];
50
51
52#endif