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