annotate lib-src/mule/bdf.h @ 165:5a88923fcbfe r20-3b9

Import from CVS: tag r20-3b9
author cvs
date Mon, 13 Aug 2007 09:44:42 +0200
parents 131b0175ea99
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1 /* Header for bdf.c
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2 Copyright (C) 1992 Free Software Foundation, Inc. */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
3
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
4 /* This file is part of Mule (MULtilingual Enhancement of GNU Emacs).
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
5
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
6 Mule is free software distributed in the form of patches to GNU Emacs.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
7 You can redistribute it and/or modify
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
8 it under the terms of the GNU General Public License as published by
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
9 the Free Software Foundation; either version 1, or (at your option)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
10 any later version.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
11
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
12 Mule is distributed in the hope that it will be useful,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
15 GNU General Public License for more details.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
16
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
18 along with GNU Emacs; see the file COPYING. If not, write to
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
19 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
20
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
21 /* 92.10.14 written by K.Handa <handa@etl.go.jp> */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
22 /* 92.11.3 modified for Mule Ver.0.9.7
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
23 by T.Matsuzawa <mzw_t@hpujisa.yhp.co.jp>
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
24 Support NONSPACING characters. */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
25 /* 92.11.24 modified for Mule Ver.0.9.7 by K.Handa <handa@etl.go.jp>
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
26 Modified to reduce memory. */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
27 /* 92.12.14 modified for Mule Ver.0.9.7 by K.Handa <handa@etl.go.jp>
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
28 Support for composite character. */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
29 /* 93.5.7 modified for Mule Ver.0.9.8 by K.Handa <handa@etl.go.jp>
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
30 Support right-to-left character.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
31 Definitions of BDF_xxxx are deleted. */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
32
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
33 #ifndef _BDF_H
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
34 #define _BDF_H
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
35
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
36 /* Structure of glyph information of one character. */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
37 typedef struct {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
38 int dwidth; /* width in pixels */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
39 int bbw, bbh, bbox, bboy; /* bounding box in pixels */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
40 int bitmap_size; /* byte lengh of the following slots */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
41 char *bitmap; /* */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
42 } glyph_struct;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
43
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
44 extern glyph_struct glyph;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
45
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
46 typedef struct {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
47 char *filename;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
48 int bytes, encoding, direction; /* 93.5.7 by K.Handa */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
49 FILE *fp;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
50 int loaded; /* flag */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
51 long last_offset;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
52 long *offset; /* offset to STARTCHAR */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
53 int chars; /* CHARS */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
54 int llx, lly, urx, ury; /* FontBBox */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
55 /* Baseline offset -- value of private property _MULE_BASELINE_OFFSET */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
56 int yoffset;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
57 int relative_compose;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
58 char **extra;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
59 } font_struct;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
60
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
61 typedef struct {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
62 unsigned int *defined; /* if 1, the character is defined. */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
63 int fs; /* PIXEL size */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
64 int code[256]; /* encoding -> character code mapping */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
65 unsigned int count[256]; /* How often the character appeared. */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
66 unsigned char new[256];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
67 } font_extra;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
68
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
69 extern font_struct *font;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
71 #define FONT_LOADED(lc) font[(lc) & 0x7F].loaded
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
72
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
73 #define DEFINED1(lc,idx) \
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
74 (((font_extra *)(font[(lc) & 0x7F].extra))->defined[idx])
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
75 #define DEFINE1(lc,idx) \
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
76 (((font_extra *)(font[(lc) & 0x7F].extra))->defined[idx] = 1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
77
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
78 #define DEFINED2(lc,idx) \
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
79 (((font_extra *)(font[(lc) & 0x7F].extra))->defined[(idx) / 32] & (1 << ((idx) % 32)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
80 #define DEFINE2(lc,idx) \
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
81 (((font_extra *)(font[(lc) & 0x7F].extra))->defined[(idx) / 32] |= (1 << ((idx) % 32)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
82 #define UNDEFINE2(lc,idx) \
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
83 (((font_extra *)(font[(lc) & 0x7F].extra))->defined[(idx) / 32] &= ~(1 << ((idx) % 32)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
84
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
85 extern FILE *bdf_fopen();
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
86
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
87 #ifndef BDF_PATH
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
88 #define BDF_PATH "/usr/share/fonts/X11/ETL,/usr/share/fonts/X11/Chinese,/usr/share/fonts/X11/Japanese,/usr/share/fonts/X11/Korean"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
89 #endif
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
90
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
91 #endif /* _BDF_H */