2
* pcf.h - a header file for pcf.c
3
* by Hirotsugu Kakugawa
7
* Copyright (C) 1996-1998 Hirotsugu Kakugawa.
10
* This file is part of the VFlib Library. This library is free
11
* software; you can redistribute it and/or modify it under the terms of
12
* the GNU Library General Public License as published by the Free
13
* Software Foundation; either version 2 of the License, or (at your
14
* option) any later version. This library is distributed in the hope
15
* that it will be useful, but WITHOUT ANY WARRANTY; without even the
16
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
17
* PURPOSE. See the GNU Library General Public License for more details.
18
* You should have received a copy of the GNU Library General Public
19
* License along with this library; if not, write to the Free Software
20
* Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23
#ifndef __VFLIB_PCF_H__
24
#define __VFLIB_PCF_H__
26
#define FONTCLASS_NAME "pcf"
28
#ifndef PCF_DEFAULT_EXTENSIONS
29
# define PCF_DEFAULT_EXTENSIONS ".pcf"
32
#define PCF_ENV_FONT_DIR "VFLIB_PCF_FONTS"
46
typedef struct s_pcf_table *PCF_TABLE;
48
#define PCF_MSB_FIRST 0
49
#define PCF_LSB_FIRST 1
51
#define PCF_FILE_VERSION 0x70636601 /* `p', `c', `f', 1 */
52
#define PCF_FORMAT_MASK 0xffffff00
53
#define PCF_FORMAT_MATCH(x,y) (((x)&PCF_FORMAT_MASK)==((y)&PCF_FORMAT_MASK))
55
#define PCF_DEFAULT_FORMAT 0x00000000
56
#define PCF_INKBOUNDS 0x00000200
57
#define PCF_ACCEL_W_INKBOUNDS 0x00000100
58
#define PCF_COMPRESSED_METRICS 0x00000100
60
#define PCF_GLYPH_PAD_MASK (3<<0)
61
#define PCF_BYTE_MASK (1<<2)
62
#define PCF_BIT_MASK (1<<3)
63
#define PCF_SCAN_UNIT_MASK (3<<4)
64
#define PCF_GLYPH_PAD_INDEX(f) ((f) & PCF_GLYPH_PAD_MASK)
65
#define PCF_GLYPH_PAD(f) (1 << PCF_GLYPH_PAD_INDEX(f))
66
#define PCF_SCAN_UNIT_INDEX(f) (((f)&PCF_SCAN_UNIT_MASK) >> 4)
67
#define PCF_SCAN_UNIT(f) (1 << PCF_SCAN_UNIT_INDEX(f))
69
#define PCF_BYTE_ORDER(f) (((f)&PCF_BYTE_MASK) ? PCF_MSB_FIRST:PCF_LSB_FIRST)
70
#define PCF_BIT_ORDER(f) (((f)&PCF_BIT_MASK) ? PCF_MSB_FIRST:PCF_LSB_FIRST)
71
#define PCF_FORMAT_BITS(f) ((f) & (PCF_GLYPH_PAD_MASK | PCF_BYTE_MASK \
72
| PCF_BIT_MASK | PCF_SCAN_UNIT_MASK))
73
#define PCF_SIZE_TO_INDEX(s) (((s)==4) ? 2 : (((s)==2) ? 1 : 0))
74
#define PCF_INDEX_TO_SIZE(b) (1<<b)
76
#define PCF_PROPERTIES (1<<0)
77
#define PCF_ACCELERATORS (1<<1)
78
#define PCF_METRICS (1<<2)
79
#define PCF_BITMAPS (1<<3)
80
#define PCF_INK_METRICS (1<<4)
81
#define PCF_BDF_ENCODINGS (1<<5)
82
#define PCF_SWIDTHS (1<<6)
83
#define PCF_GLYPH_NAMES (1<<7)
84
#define PCF_BDF_ACCELERATORS (1<<8)
86
#define PCF_GLYPHPADOPTIONS 4
96
int bbx_width, bbx_height;
99
unsigned char *bitmap;
102
typedef struct s_pcf_char *PCF_CHAR;
113
int firstCol, lastCol, firstRow, lastRow;
116
int fontAscent, fontDescent;
117
int font_bbx_width, font_bbx_height;
118
int font_bbx_xoff, font_bbx_yoff;
121
unsigned char*bitmap_block;
126
typedef struct s_pcf *PCF;
130
#endif /*__VFLIB_PCF_H__*/