2 /* Copyright (C) 1989, 1990 Free Software Foundation, Inc.
3 Written by James Clark (jjc@jclark.uucp)
5 This file is part of groff.
7 groff is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 1, or (at your option) any later
12 groff is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 You should have received a copy of the GNU General Public License along
18 with groff; see the file LICENSE. If not, write to the Free Software
19 Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
22 struct font_kern_list
;
23 struct font_char_metric
;
36 int contains(int index
);
38 int get_width(int index
, int point_size
);
39 int get_height(int index
, int point_size
);
40 int get_depth(int index
, int point_size
);
41 int get_space_width(int point_size
);
42 int get_character_type(int index
);
43 int get_kern(int index1
, int index2
, int point_size
);
44 int get_skew(int index
, int point_size
, int slant
);
45 int has_ligature(int);
46 int get_italic_correction(int index
, int point_size
);
47 int get_left_italic_correction(int index
, int point_size
);
48 int get_subscript_correction(int index
, int point_size
);
49 unsigned char get_code(int i
);
50 const char *get_name();
51 const char *get_internal_name();
53 static font
*load_font(const char *);
54 static void command_line_font_dir(const char *path
);
55 static void forget_command_line_font_dirs();
56 static void set_device_name(const char *);
57 static const char *get_device_name();
58 static FILE *open_file(const char *name
, char **pathp
);
59 static int load_desc();
60 static int name_to_index(const char *);
61 static int number_to_index(unsigned char);
67 static int paperwidth
;
68 static int paperlength
;
69 static int biggestfont
;
74 static const char **font_name_table
;
75 static const char **style_table
;
76 static const char *family
;
80 font_kern_list
**kern_hash_table
;
92 static char *dev_name
;
93 static char *cl_font_dirs
;
95 enum { KERN_HASH_TABLE_SIZE
= 503 };
97 void add_entry(int index
, const font_char_metric
&);
98 void copy_entry(int new_index
, int old_index
);
99 void add_kern(int index1
, int index2
, int amount
);
100 static int hash_kern(int i1
, int i2
);
101 void alloc_ch_index(int);
105 static int scale(int w
, int pointsize
);
106 virtual void handle_unknown_font_command(int argc
, const char **argv
);