~ubuntu-branches/ubuntu/jaunty/ghostscript/jaunty-updates

« back to all changes in this revision

Viewing changes to src/gxxfont.h

  • Committer: Bazaar Package Importer
  • Author(s): Till Kamppeter
  • Date: 2009-01-20 16:40:45 UTC
  • mfrom: (1.1.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20090120164045-lnfhi0n30o5lwhwa
Tags: 8.64.dfsg.1~svn9377-0ubuntu1
* New upstream release (SVN rev 9377)
   o Fixes many bugs concerning PDF rendering, to make the PDF printing
     workflow correctly working.
   o Fixes long-standing bugs in many drivers, like input paper tray and
     duplex options not working for the built-in PCL 4, 5, 5c, 5e, and
     6/XL drivers, PDF input not working for bjc600, bjc800, and cups
     output devices, several options not working and uninitialized
     memory with cups output device.
   o Merged nearly all patches of the Ubuntu and Debian packages upstream.
   o Fixes LP: #317810, LP: #314439, LP: #314018.
* debian/patches/03_libpaper_support.dpatch,
  debian/patches/11_gs-cjk_font_glyph_handling_fix.dpatch,
  debian/patches/12_gs-cjk_vertical_writing_metrics_fix.dpatch,
  debian/patches/13_gs-cjk_cjkps_examples.dpatch,
  debian/patches/20_bbox_segv_fix.dpatch,
  debian/patches/21_brother_7x0_gdi_fix.dpatch,
  debian/patches/22_epsn_margin_workaround.dpatch,
  debian/patches/24_gs_man_fix.dpatch,
  debian/patches/25_toolbin_insecure_tmp_usage_fix.dpatch,
  debian/patches/26_assorted_script_fixes.dpatch,
  debian/patches/29_gs_css_fix.dpatch,
  debian/patches/30_ps2pdf_man_improvement.dpatch,
  debian/patches/31_fix-gc-sigbus.dpatch,
  debian/patches/34_ftbfs-on-hurd-fix.dpatch,
  debian/patches/35_disable_libcairo.dpatch,
  debian/patches/38_pxl-duplex.dpatch,
  debian/patches/39_pxl-resolution.dpatch,
  debian/patches/42_gs-init-ps-delaybind-fix.dpatch,
  debian/patches/45_bjc600-bjc800-pdf-input.dpatch,
  debian/patches/48_cups-output-device-pdf-duplex-uninitialized-memory-fix.dpatch,
  debian/patches/50_lips4-floating-point-exception.dpatch,
  debian/patches/52_cups-device-logging.dpatch,
  debian/patches/55_pcl-input-slot-fix.dpatch,
  debian/patches/57_pxl-input-slot-fix.dpatch,
  debian/patches/60_pxl-cups-driver-pdf.dpatch,
  debian/patches/62_onebitcmyk-pdf.dpatch,
  debian/patches/65_too-big-temp-files-1.dpatch,
  debian/patches/67_too-big-temp-files-2.dpatch,
  debian/patches/70_take-into-account-data-in-stream-buffer-before-refill.dpatch:
  Removed, applied upstream.
* debian/patches/01_docdir_fix_for_debian.dpatch,
  debian/patches/02_gs_man_fix_debian.dpatch,
  debian/patches/01_docdir-fix-for-debian.dpatch,
  debian/patches/02_docdir-fix-for-debian.dpatch: Renamed patches to
  make merging with Debian easier.
* debian/patches/32_improve-handling-of-media-size-changes-from-gv.dpatch, 
  debian/patches/33_bad-params-to-xinitimage-on-large-bitmaps.dpatch:
  regenerated for new source directory structure.
* debian/rules: Corrected paths to remove cidfmap (it is in Resource/Init/
  in GS 8.64) and to install headers (source paths are psi/ and base/ now).
* debian/rules: Remove all fontmaps, as DeFoMa replaces them.
* debian/local/pdftoraster/pdftoraster.c,
  debian/local/pdftoraster/pdftoraster.convs, debian/rules: Removed
  added pdftoraster filter and use the one which comes with Ghostscript.
* debian/ghostscript.links: s/8.63/8.64/

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (C) 2001-2006 Artifex Software, Inc.
2
 
   All Rights Reserved.
3
 
  
4
 
   This software is provided AS-IS with no warranty, either express or
5
 
   implied.
6
 
 
7
 
   This software is distributed under license and may not be copied, modified
8
 
   or distributed except as expressly authorized under the terms of that
9
 
   license.  Refer to licensing information at http://www.artifex.com/
10
 
   or contact Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134,
11
 
   San Rafael, CA  94903, U.S.A., +1(415)492-9861, for further information.
12
 
*/
13
 
 
14
 
/* $Id: gxxfont.h 8250 2007-09-25 13:31:24Z giles $ */
15
 
/* External font interface for Ghostscript library */
16
 
 
17
 
#ifndef gxxfont_INCLUDED
18
 
#  define gxxfont_INCLUDED
19
 
 
20
 
#include "gsccode.h"
21
 
#include "gsmatrix.h"
22
 
#include "gsuid.h"
23
 
#include "gsxfont.h"
24
 
 
25
 
/*
26
 
 *                    Design issues for external fonts
27
 
 *
28
 
 * 1. Where do xfonts come from: a device or a font service?
29
 
 *
30
 
 * 2. Is a given xfont associated with a particular device, or with a
31
 
 *    class of devices, which may have different output media?
32
 
 *    (Specifically, Windows displays vs. printers.)
33
 
 *
34
 
 * 3. Is an xfont a handle that must be interpreted by its originator,
35
 
 *    or an object with its own set of operations?
36
 
 *
37
 
 * 4. Are xfonts always transformation-specific, or is there such a thing
38
 
 *    as a scalable xfont?
39
 
 *
40
 
 * 5. What is the meaning of the transformation matrix supplied when
41
 
 *    asking for an xfont?
42
 
 *
43
 
 *                      Answers (for the current design)
44
 
 *
45
 
 * 1. Devices supply xfonts.  Internal devices (image, null, clipping,
46
 
 *    command list, tracing) forward font requests to a real underlying
47
 
 *    device.  File format devices should do the same, but right now
48
 
 *    they don't.
49
 
 *
50
 
 * 2. An xfont is not associated with anything: it just provides bitmaps.
51
 
 *    Since xfonts are only used at small sizes and low resolutions,
52
 
 *    tuning differences for different output media aren't likely to be
53
 
 *    an issue.
54
 
 *
55
 
 * 3. Xfonts are objects.  They are allocated by their originator, and
56
 
 *    (currently) only freed by `restore'.
57
 
 *
58
 
 * 4. Xfonts are always transformation-specific.  This may lead to some
59
 
 *    clutter, but it's very unlikely that a document will have enough
60
 
 *    different transformed versions of a single font for this to be a
61
 
 *    problem in practice.
62
 
 *
63
 
 * 5. The transformation matrix is the CTM within the BuildChar or BuildGlyph
64
 
 *    procedure.  This maps a 1000x1000 square to the intended character size
65
 
 *    (assuming the base font uses the usual 1000-unit scaling).
66
 
 */
67
 
 
68
 
/* The definitions for xfonts are very similar to those for devices. */
69
 
 
70
 
/* Structure for generic xfonts. */
71
 
typedef struct gx_xfont_common_s {
72
 
    const gx_xfont_procs *procs;
73
 
} gx_xfont_common;
74
 
 
75
 
/* A generic xfont. */
76
 
struct gx_xfont_s {
77
 
    gx_xfont_common common;
78
 
};
79
 
 
80
 
/* Definition of xfont procedures. */
81
 
 
82
 
struct gx_xfont_procs_s {
83
 
 
84
 
    /* Look up a font name, UniqueID, and matrix, and return */
85
 
    /* an xfont. */
86
 
 
87
 
    /* NOTE: even though this is defined as an xfont_proc, */
88
 
    /* it is actually a `factory' procedure, the only one that */
89
 
    /* does not take an xfont * as its first argument. */
90
 
 
91
 
#define xfont_proc_lookup_font(proc)\
92
 
  gx_xfont *proc(gx_device *dev, const byte *fname, uint len,\
93
 
    int encoding_index, const gs_uid *puid, const gs_matrix *pmat,\
94
 
    gs_memory_t *mem)
95
 
    xfont_proc_lookup_font((*lookup_font));
96
 
 
97
 
    /*
98
 
     * Convert a character name to an xglyph code.  encoding_index is
99
 
     * actually a gs_encoding_index_t.  Either chr or glyph may be absent
100
 
     * (gs_no_char/glyph), but not both.  glyph_name is the glyph's
101
 
     * (string) name if the glyph is not GS_NO_GLYPH and is not a CID.
102
 
     */
103
 
    /*
104
 
     * This procedure was deprecated as of release 3.43, but still
105
 
     * supported.  In release 7.21, the argument list was changed, and the
106
 
     * procedure is no longer deprecated.
107
 
     */
108
 
 
109
 
#define xfont_proc_char_xglyph(proc)\
110
 
  gx_xglyph proc(gx_xfont *xf, gs_char chr, int encoding_index,\
111
 
    gs_glyph glyph, const gs_const_string *glyph_name)
112
 
    xfont_proc_char_xglyph((*char_xglyph));
113
 
 
114
 
    /* Get the metrics for a character. */
115
 
    /* Note: pwidth changed in release 2.9.7. */
116
 
 
117
 
#define xfont_proc_char_metrics(proc)\
118
 
  int proc(gx_xfont *xf, gx_xglyph xg, int wmode,\
119
 
    gs_point *pwidth, gs_int_rect *pbbox)
120
 
    xfont_proc_char_metrics((*char_metrics));
121
 
 
122
 
    /* Render a character. */
123
 
    /* (x,y) corresponds to the character origin. */
124
 
    /* The target may be any Ghostscript device. */
125
 
 
126
 
#define xfont_proc_render_char(proc)\
127
 
  int proc(gx_xfont *xf, gx_xglyph xg, gx_device *target,\
128
 
    int x, int y, gx_color_index color, int required)
129
 
    xfont_proc_render_char((*render_char));
130
 
 
131
 
    /* Release any external resources associated with an xfont. */
132
 
    /* If mprocs is not NULL, also free any storage */
133
 
    /* allocated by lookup_font (including the xfont itself). */
134
 
 
135
 
#define xfont_proc_release(proc)\
136
 
  int proc(gx_xfont *xf, gs_memory_t *mem)
137
 
    xfont_proc_release((*release));
138
 
 
139
 
    /* (There was a char_xglyph2 procedure here, added in release 3.43, */
140
 
    /* removed in 7.21.) */
141
 
 
142
 
};
143
 
 
144
 
/*
145
 
 * Since xfonts are garbage-collectable, they need structure descriptors.
146
 
 * Fortunately, the common part of an xfont contains no pointers to
147
 
 * GC-managed space, so simple xfonts can use gs_private_st_simple.
148
 
 * The following macro will serve for an xfont with only one pointer,
149
 
 * to its device:
150
 
 */
151
 
#define gs__st_dev_ptrs1(scope_st, stname, stype, sname, penum, preloc, de)\
152
 
  static ENUM_PTRS_WITH(penum, stype *xfptr) return 0;\
153
 
    case 0: ENUM_RETURN(gx_device_enum_ptr((gx_device *)(xfptr->de)));\
154
 
  ENUM_PTRS_END\
155
 
  static RELOC_PTRS_WITH(preloc, stype *xfptr) ;\
156
 
    xfptr->de = (void *)gx_device_reloc_ptr((gx_device *)(xfptr->de), gcst);\
157
 
  RELOC_PTRS_END\
158
 
  gs__st_composite_only(scope_st, stname, stype, sname, penum, preloc)
159
 
/*
160
 
 * We probably don't ever want xfont descriptors to be public....
161
 
#define gs_public_st_dev_ptrs1(stname, stype, sname, penum, preloc, de)\
162
 
  gs__st_dev_ptrs1(public_st, stname, stype, sname, penum, preloc, de)
163
 
 */
164
 
#define gs_private_st_dev_ptrs1(stname, stype, sname, penum, preloc, de)\
165
 
  gs__st_dev_ptrs1(private_st, stname, stype, sname, penum, preloc, de)
166
 
 
167
 
#endif /* gxxfont_INCLUDED */