1 /* PSPP - computes sample statistics.
2 Copyright (C) 2006 Free Software Foundation, Inc.
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.
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.
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
23 #include <libpspp/str.h>
25 /* Metrics for a single character. */
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. */
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;
39 /* Ligature data for this character in the first position,
40 other characters in the second position. */
41 struct afm_ligature *ligatures;
45 struct afm *afm_open (const char *file_name);
46 void afm_close (struct afm *);
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 *);
52 const struct afm_character *afm_get_character (const struct afm *,
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 *);
59 size_t afm_encode_string (const struct afm *,
60 const struct afm_character **, size_t,