1 /* PSPP - a program for statistical analysis.
2 Copyright (C) 2006 Free Software Foundation, Inc.
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
21 #include <libpspp/str.h>
23 /* Metrics for a single character. */
26 int code; /* Non-negative character code, -1 if none. */
27 const char *name; /* Character name, if any. */
28 int width; /* Width. */
29 int ascent; /* Height above baseline, never negative. */
30 int descent; /* Depth below baseline, never negative. */
32 /* Pairwise kerning data for this character in the first
33 position, other characters in the second position. */
34 struct afm_kern_pair *kern_pairs;
37 /* Ligature data for this character in the first position,
38 other characters in the second position. */
39 struct afm_ligature *ligatures;
43 struct afm *afm_open (const char *file_name);
44 void afm_close (struct afm *);
46 int afm_get_ascent (const struct afm *);
47 int afm_get_descent (const struct afm *);
48 const char *afm_get_findfont_name (const struct afm *);
50 const struct afm_character *afm_get_character (const struct afm *,
52 const struct afm_character *afm_get_ligature (const struct afm_character *,
53 const struct afm_character *);
54 int afm_get_kern_adjustment (const struct afm_character *,
55 const struct afm_character *);
57 size_t afm_encode_string (const struct afm *,
58 const struct afm_character **, size_t,