~ubuntu-branches/ubuntu/oneiric/ghostscript/oneiric

« back to all changes in this revision

Viewing changes to base/gdevpsf.h

  • Committer: Bazaar Package Importer
  • Author(s): Till Kamppeter
  • Date: 2011-07-15 16:49:55 UTC
  • mfrom: (1.1.23 upstream)
  • Revision ID: james.westby@ubuntu.com-20110715164955-uga6qibao6kez05c
Tags: 9.04~dfsg~20110715-0ubuntu1
* New upstream release
   - GIT snapshot from Jult, 12 2011.
* debian/patches/020110406~a54df2d.patch,
  debian/patches/020110408~0791cc8.patch,
  debian/patches/020110408~507cbee.patch,
  debian/patches/020110411~4509a49.patch,
  debian/patches/020110412~78bb9a6.patch,
  debian/patches/020110418~a05ab8a.patch,
  debian/patches/020110420~20b6c78.patch,
  debian/patches/020110420~4ddefa2.patch: Removed upstream patches.
* debian/rules: Generate ABI version number (variable "abi") correctly,
  cutting off repackaging and pre-release parts.
* debian/rules: Added ./lcms2/ directory to DEB_UPSTREAM_REPACKAGE_EXCLUDES.
* debian/copyright: Added lcms2/* to the list of excluded files.
* debian/symbols.common: Updated for new upstream source. Applied patch
  which dpkg-gensymbols generated for debian/libgs9.symbols to this file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* Copyright (C) 2001-2006 Artifex Software, Inc.
2
2
   All Rights Reserved.
3
 
  
 
3
 
4
4
   This software is provided AS-IS with no warranty, either express or
5
5
   implied.
6
6
 
11
11
   San Rafael, CA  94903, U.S.A., +1(415)492-9861, for further information.
12
12
*/
13
13
 
14
 
/* $Id: gdevpsf.h 8622 2008-04-04 08:53:57Z ken $ */
 
14
/* $Id$ */
15
15
/* PostScript/PDF font writing interface */
16
16
 
17
17
#ifndef gdevpsf_INCLUDED
44
44
struct psf_glyph_enum_s {
45
45
    gs_font *font;
46
46
    struct su_ {
47
 
        union sus_ {
48
 
            const gs_glyph *list;       /* if subset given by a list */
49
 
            const byte *bits;   /* if CID or TT subset given by a bitmap */
50
 
        } selected;
51
 
        uint size;
 
47
        union sus_ {
 
48
            const gs_glyph *list;       /* if subset given by a list */
 
49
            const byte *bits;   /* if CID or TT subset given by a bitmap */
 
50
        } selected;
 
51
        uint size;
52
52
    } subset;
53
53
    gs_glyph_space_t glyph_space;
54
54
    ulong index;
61
61
 * (as integer glyphs, i.e., offset by gs_min_cid_glyph).
62
62
 */
63
63
void psf_enumerate_list_begin(psf_glyph_enum_t *ppge, gs_font *font,
64
 
                              const gs_glyph *subset_list,
65
 
                              uint subset_size,
66
 
                              gs_glyph_space_t glyph_space);
 
64
                              const gs_glyph *subset_list,
 
65
                              uint subset_size,
 
66
                              gs_glyph_space_t glyph_space);
67
67
/* Backward compatibility */
68
68
#define psf_enumerate_glyphs_begin psf_enumerate_list_begin
69
69
 
70
70
/* Begin enumerating CID or TT glyphs in a subset given by a bit vector. */
71
71
/* Note that subset_size is given in bits, not in bytes. */
72
72
void psf_enumerate_bits_begin(psf_glyph_enum_t *ppge, gs_font *font,
73
 
                              const byte *subset_bits, uint subset_size,
74
 
                              gs_glyph_space_t glyph_space);
 
73
                              const byte *subset_bits, uint subset_size,
 
74
                              gs_glyph_space_t glyph_space);
75
75
/* Backward compatibility */
76
76
#define psf_enumerate_cids_begin(ppge, font, bits, size)\
77
77
   psf_enumerate_bits_begin(ppge, font, bits, size, GLYPH_SPACE_NAME)
94
94
 * use max_count.
95
95
 */
96
96
int psf_add_subset_pieces(gs_glyph *glyphs, uint *pcount, uint max_count,
97
 
                          uint max_pieces, gs_font *font);
 
97
                          uint max_pieces, gs_font *font);
98
98
 
99
99
/*
100
100
 * Sort a list of glyphs and remove duplicates.  Return the number of glyphs
107
107
 * if the glyph is not present.
108
108
 */
109
109
int psf_sorted_glyphs_index_of(const gs_glyph *glyphs, int count,
110
 
                               gs_glyph glyph);
 
110
                               gs_glyph glyph);
111
111
/*
112
112
 * Determine whether a sorted list of glyphs includes a given glyph.
113
113
 */
114
114
bool psf_sorted_glyphs_include(const gs_glyph *glyphs, int count,
115
 
                               gs_glyph glyph);
 
115
                               gs_glyph glyph);
116
116
 
117
117
/*
118
118
 * Define the internal structure that holds glyph information for an
137
137
 
138
138
/* Define the type for the glyph data callback procedure. */
139
139
typedef int (*glyph_data_proc_t)(gs_font_base *, gs_glyph,
140
 
                                 gs_glyph_data_t *, gs_font_type1 **);
 
140
                                 gs_glyph_data_t *, gs_font_type1 **);
141
141
 
142
142
/* Check that all selected glyphs can be written. */
143
143
int psf_check_outline_glyphs(gs_font_base *pfont,
144
 
                             psf_glyph_enum_t *ppge,
145
 
                             glyph_data_proc_t glyph_data);
 
144
                             psf_glyph_enum_t *ppge,
 
145
                             glyph_data_proc_t glyph_data);
146
146
 
147
147
/*
148
148
 * Gather glyph information for a Type 1, Type 2, or CIDFontType 0 font.
153
153
 * undefined glyphs from the list it builds.
154
154
 */
155
155
int psf_get_outline_glyphs(psf_outline_glyphs_t *pglyphs,
156
 
                           gs_font_base *pfont, gs_glyph *subset_glyphs,
157
 
                           uint subset_size, glyph_data_proc_t glyph_data);
 
156
                           gs_font_base *pfont, gs_glyph *subset_glyphs,
 
157
                           uint subset_size, glyph_data_proc_t glyph_data);
158
158
 
159
159
/* ------ Exported by gdevpsf1.c ------ */
160
160
 
161
161
/* Gather glyph information for a Type 1 or Type 2 font. */
162
162
int psf_type1_glyph_data(gs_font_base *, gs_glyph, gs_glyph_data_t *,
163
 
                         gs_font_type1 **);
 
163
                         gs_font_type1 **);
164
164
int psf_get_type1_glyphs(psf_outline_glyphs_t *pglyphs,
165
 
                         gs_font_type1 *pfont,
166
 
                         gs_glyph *subset_glyphs, uint subset_size);
 
165
                         gs_font_type1 *pfont,
 
166
                         gs_glyph *subset_glyphs, uint subset_size);
167
167
 
168
168
/*
169
169
 * Write a Type 1 font definition.  This procedure does not allocate
176
176
#define WRITE_TYPE1_POSTSCRIPT 16  /* don't observe ATM restrictions */
177
177
#define WRITE_TYPE1_WITH_LENIV 32  /* don't allow lenIV = -1 */
178
178
int psf_write_type1_font(stream *s, gs_font_type1 *pfont, int options,
179
 
                         gs_glyph *subset_glyphs, uint subset_size,
180
 
                         const gs_const_string *alt_font_name,
181
 
                         int lengths[3]);
 
179
                         gs_glyph *subset_glyphs, uint subset_size,
 
180
                         const gs_const_string *alt_font_name,
 
181
                         int lengths[3]);
182
182
 
183
183
/* ------ Exported by gdevpsf2.c ------ */
184
184
 
191
191
#define WRITE_TYPE2_AR3 4       /* work around bugs in Acrobat Reader 3 */
192
192
#define WRITE_TYPE2_NO_GSUBRS 8 /* omit GlobalSubrs */
193
193
int psf_write_type2_font(stream *s, gs_font_type1 *pfont, int options,
194
 
                         gs_glyph *subset_glyphs, uint subset_size,
195
 
                         const gs_const_string *alt_font_name,
196
 
                         gs_int_rect *FontBBox);
 
194
                         gs_glyph *subset_glyphs, uint subset_size,
 
195
                         const gs_const_string *alt_font_name,
 
196
                         gs_int_rect *FontBBox);
197
197
 
198
198
#ifndef gs_font_cid0_DEFINED
199
199
#  define gs_font_cid0_DEFINED
207
207
 * This procedure does not allocate or free any data.
208
208
 */
209
209
int psf_write_cid0_font(stream *s, gs_font_cid0 *pfont, int options,
210
 
                        const byte *subset_cids, uint subset_size,
211
 
                        const gs_const_string *alt_font_name);
 
210
                        const byte *subset_cids, uint subset_size,
 
211
                        const gs_const_string *alt_font_name);
212
212
 
213
213
/* ------ Exported by gdevpsfm.c ------ */
214
214
 
222
222
#endif
223
223
typedef int (*psf_put_name_chars_proc_t)(stream *, const byte *, uint);
224
224
int psf_write_cmap(const gs_memory_t *mem, stream *s, const gs_cmap_t *pcmap,
225
 
                   psf_put_name_chars_proc_t put_name_chars,
226
 
                   const gs_const_string *alt_cmap_name, int font_index_only);
 
225
                   psf_put_name_chars_proc_t put_name_chars,
 
226
                   const gs_const_string *alt_cmap_name, int font_index_only);
227
227
/* ------ Exported by gdevpsft.c ------ */
228
228
 
229
229
extern const long default_defaultWidthX;
241
241
#define WRITE_TRUETYPE_POST 4   /* generate post if missing */
242
242
#define WRITE_TRUETYPE_NO_TRIMMED_TABLE 8  /* not OK to use cmap format 6 */
243
243
#define WRITE_TRUETYPE_HVMTX 16 /* generate [hv]mtx from glyph_info */
244
 
#define WRITE_TRUETYPE_UNICODE_CMAP 32 /* For PDF/A or other non-symbolic TT font, 
245
 
                                        * write a 3,1 (Windows Unicode) cmap instead of
246
 
                                        * a 3,0 one.
247
 
                                        */
 
244
#define WRITE_TRUETYPE_UNICODE_CMAP 32 /* For PDF/A or other non-symbolic TT font,
 
245
                                        * write a 3,1 (Windows Unicode) cmap instead of
 
246
                                        * a 3,0 one.
 
247
                                        */
248
248
int psf_write_truetype_font(stream *s, gs_font_type42 *pfont, int options,
249
 
                            gs_glyph *subset_glyphs, uint subset_size,
250
 
                            const gs_const_string *alt_font_name);
 
249
                            gs_glyph *subset_glyphs, uint subset_size,
 
250
                            const gs_const_string *alt_font_name);
251
251
 
252
252
/*
253
253
 * Write a "stripped" TrueType font definition.  All tables are written
285
285
 * This procedure does not allocate or free any data.
286
286
 */
287
287
int psf_write_cid2_font(stream *s, gs_font_cid2 *pfont, int options,
288
 
                        const byte *subset_glyphs, uint subset_size,
289
 
                        const gs_const_string *alt_font_name);
 
288
                        const byte *subset_glyphs, uint subset_size,
 
289
                        const gs_const_string *alt_font_name);
290
290
 
291
291
/*
292
292
 * Write a "stripped" CIDFontType 2 font definition.  This is the same
302
302
 * NOTE: this procedure expands all Subrs in-line.
303
303
 */
304
304
int psf_convert_type1_to_type2(stream *s, const gs_glyph_data_t *pgd,
305
 
                               gs_font_type1 *pfont);
 
305
                               gs_font_type1 *pfont);
306
306
 
307
307
#endif /* gdevpsf_INCLUDED */