Remove "Written by Ben Pfaff <blp@gnu.org>" lines everywhere.
[pspp-builds.git] / src / output / afm.h
1 /* PSPP - computes sample statistics.
2    Copyright (C) 2006 Free Software Foundation, Inc.
3
4    This program is free software; you can redistribute it and/or
5    modify it under the terms of the GNU General Public License as
6    published by the Free Software Foundation; either version 2 of the
7    License, or (at your option) any later version.
8
9    This program is distributed in the hope that it will be useful, but
10    WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12    General Public License for more details.
13
14    You should have received a copy of the GNU General Public License
15    along with this program; if not, write to the Free Software
16    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17    02110-1301, USA. */
18
19 #ifndef AFM_H
20 #define AFM_H 1
21
22 #include <stddef.h>
23 #include <libpspp/str.h>
24
25 /* Metrics for a single character.  */
26 struct afm_character
27   {
28     int code;                   /* Non-negative character code, -1 if none. */
29     const char *name;           /* Character name, if any. */
30     int width;                  /* Width. */
31     int ascent;                 /* Height above baseline, never negative. */
32     int descent;                /* Depth below baseline, never negative. */
33
34     /* Pairwise kerning data for this character in the first
35        position, other characters in the second position. */
36     struct afm_kern_pair *kern_pairs;
37     size_t kern_pair_cnt;
38     
39     /* Ligature data for this character in the first position,
40        other characters in the second position. */
41     struct afm_ligature *ligatures;
42     size_t ligature_cnt;
43   };
44
45 struct afm *afm_open (const char *file_name);
46 void afm_close (struct afm *);
47
48 int afm_get_ascent (const struct afm *);
49 int afm_get_descent (const struct afm *);
50 const char *afm_get_findfont_name (const struct afm *);
51
52 const struct afm_character *afm_get_character (const struct afm *,
53                                                int code);
54 const struct afm_character *afm_get_ligature (const struct afm_character *,
55                                               const struct afm_character *);
56 int afm_get_kern_adjustment (const struct afm_character *,
57                              const struct afm_character *);
58
59 size_t afm_encode_string (const struct afm *,
60                           const struct afm_character **, size_t,
61                           struct string *);
62
63 #endif /* afm.h */