File: pcf.h

package info (click to toggle)
vflib3 3.6.14.dfsg-3+nmu3
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 11,536 kB
  • ctags: 3,710
  • sloc: ansic: 35,811; sh: 10,357; asm: 3,290; makefile: 962; lisp: 123; perl: 109; awk: 43
file content (132 lines) | stat: -rw-r--r-- 3,914 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
/*
 * pcf.h - a header file for pcf.c
 * by Hirotsugu Kakugawa
 *
 */
/*
 * Copyright (C) 1996-1998 Hirotsugu Kakugawa. 
 * All rights reserved.
 *
 * This file is part of the VFlib Library.  This library is free
 * software; you can redistribute it and/or modify it under the terms of
 * the GNU Library General Public License as published by the Free
 * Software Foundation; either version 2 of the License, or (at your
 * option) any later version.  This library is distributed in the hope
 * that it will be useful, but WITHOUT ANY WARRANTY; without even the
 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
 * PURPOSE.  See the GNU Library General Public License for more details.
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

#ifndef __VFLIB_PCF_H__
#define __VFLIB_PCF_H__

#define FONTCLASS_NAME            "pcf"

#ifndef  PCF_DEFAULT_EXTENSIONS
#  define   PCF_DEFAULT_EXTENSIONS  ".pcf"
#endif

#define PCF_ENV_FONT_DIR          "VFLIB_PCF_FONTS"


typedef char  INT1;
typedef int   INT2;
typedef long  INT4;
typedef long  CARD4;

struct s_pcf_table {
  CARD4  type;
  CARD4  format;
  CARD4  size;
  CARD4  offset;
};
typedef struct s_pcf_table  *PCF_TABLE;

#define PCF_MSB_FIRST  0
#define PCF_LSB_FIRST  1

#define PCF_FILE_VERSION       0x70636601     /* `p', `c', `f', 1 */
#define PCF_FORMAT_MASK        0xffffff00
#define PCF_FORMAT_MATCH(x,y)  (((x)&PCF_FORMAT_MASK)==((y)&PCF_FORMAT_MASK))

#define PCF_DEFAULT_FORMAT     0x00000000
#define PCF_INKBOUNDS          0x00000200
#define PCF_ACCEL_W_INKBOUNDS  0x00000100
#define PCF_COMPRESSED_METRICS 0x00000100

#define PCF_GLYPH_PAD_MASK     (3<<0)
#define PCF_BYTE_MASK          (1<<2)
#define PCF_BIT_MASK           (1<<3)
#define PCF_SCAN_UNIT_MASK     (3<<4)
#define PCF_GLYPH_PAD_INDEX(f) ((f) & PCF_GLYPH_PAD_MASK)
#define PCF_GLYPH_PAD(f)       (1 << PCF_GLYPH_PAD_INDEX(f))
#define PCF_SCAN_UNIT_INDEX(f) (((f)&PCF_SCAN_UNIT_MASK) >> 4)
#define PCF_SCAN_UNIT(f)       (1 << PCF_SCAN_UNIT_INDEX(f))

#define PCF_BYTE_ORDER(f)  (((f)&PCF_BYTE_MASK) ? PCF_MSB_FIRST:PCF_LSB_FIRST)
#define PCF_BIT_ORDER(f)   (((f)&PCF_BIT_MASK)  ? PCF_MSB_FIRST:PCF_LSB_FIRST)
#define PCF_FORMAT_BITS(f) ((f) & (PCF_GLYPH_PAD_MASK | PCF_BYTE_MASK \
                                   | PCF_BIT_MASK | PCF_SCAN_UNIT_MASK))
#define PCF_SIZE_TO_INDEX(s)   (((s)==4) ? 2 : (((s)==2) ? 1 : 0))
#define PCF_INDEX_TO_SIZE(b)   (1<<b)

#define PCF_PROPERTIES		    (1<<0)
#define PCF_ACCELERATORS	    (1<<1)
#define PCF_METRICS		    (1<<2)
#define PCF_BITMAPS		    (1<<3)
#define PCF_INK_METRICS		    (1<<4)
#define	PCF_BDF_ENCODINGS	    (1<<5)
#define PCF_SWIDTHS		    (1<<6)
#define PCF_GLYPH_NAMES		    (1<<7)
#define PCF_BDF_ACCELERATORS	    (1<<8)

#define PCF_GLYPHPADOPTIONS         4


struct s_pcf_char {
  int    leftSideBearing;
  int    rightSideBearing;
  int    characterWidth;
  int    ascent;
  int    descent;
  int    attributes;
  int           bbx_width, bbx_height;
  int           off_x, off_y;
  int           mv_x, mv_y;
  unsigned char *bitmap;
  int           raster;
};
typedef struct s_pcf_char  *PCF_CHAR; 

struct s_pcf {
  char    *path_name;
  char    *uncompress;
  double  point_size;
  int     pixel_size;
  int     size;
  double  dpi_x, dpi_y;
  double  slant;
  int     charset;
  int     firstCol, lastCol, firstRow, lastRow;
  int     defaultCh;
  int     ascent, descent;
  int     fontAscent, fontDescent;
  int     font_bbx_width, font_bbx_height;
  int     font_bbx_xoff, font_bbx_yoff;
  int           nchars;
  PCF_CHAR      char_table;
  unsigned char*bitmap_block;
  int           nencodings;
  INT2         *encoding;
  SEXP_ALIST    props;
};
typedef struct s_pcf  *PCF;

#include "sexp.h"

#endif /*__VFLIB_PCF_H__*/

/*EOF*/