1 /* Definitions and header for handling BDF fonts on the Microsoft W32 API.
2 Copyright (C) 1999 Free Software Foundation, Inc.
4 This file is part of GNU Emacs.
6 GNU Emacs is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 GNU Emacs is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Emacs; see the file COPYING. If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
21 /* Based heavily on code by H. Miyashita for Meadow (a descendant of
24 #ifndef EMACS_W32BDF_H
25 #define EMACS_W32BDF_H
27 #define BDF_FIRST_OFFSET_TABLE 0x200
28 #define BDF_SECOND_OFFSET_TABLE 0x80
29 #define BDF_SECOND_OFFSET(x) ((x) & 0x7f)
30 #define BDF_FIRST_OFFSET(x) (((x) >> 8) | (((x) & 0x80) << 1))
32 #define BDF_FONT_CACHE_SIZE 5000
33 #define BDF_FONT_CLEAR_SIZE 1000
35 /* Structure of glyph information of one character. */
38 int dwidth
; /* width in pixels */
39 int bbw
, bbh
, bbox
, bboy
; /* bounding box in pixels */
45 int bitmap_size
; /* byte lengh of the following slots */
46 unsigned char *bitmap
; /* */
49 typedef struct fchar
*pfont_char
;
60 unsigned char *offset
;
70 unsigned char *seeked
;
73 font_char
*chtbl
[BDF_FIRST_OFFSET_TABLE
];
74 int llx
, lly
, urx
, ury
; /* Font bounding box */
80 unsigned char *registry
;
81 unsigned char *encoding
;
83 /* unsigned char *width; */
91 #define BDF_FILE_SIZE_MAX 256*1024*1024 /* 256Mb */
92 #define BDF_FONT_FILE(font) (((bdffont*)(font))->filename)
93 #define MAKELENDSHORT(c1, c2) (unsigned short)((c1) | ((c2) << 8))
95 bdffont
*w32_init_bdf_font (char *filename
);
96 void w32_free_bdf_font (bdffont
*fontp
);
97 int w32_get_bdf_glyph (bdffont
*fontp
, int index
, int size
,
99 int w32_BDF_TextOut (bdffont
*fontp
, HDC hdc
, int left
,
100 int top
, unsigned char *text
, int dim
,
101 int bytelen
, int fixed_pitch_size
);
102 int w32_BDF_to_x_font (char *file
, char* xstr
, int len
);
104 #endif /* EMACS_W32BDF_H */