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

« back to all changes in this revision

Viewing changes to Resource/Init/gs_dps1.ps

  • 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) 1997, 1999 Aladdin Enterprises.  All rights reserved.
 
2
 
3
% This software is provided AS-IS with no warranty, either express or
 
4
% implied.
 
5
 
6
% This software is distributed under license and may not be copied,
 
7
% modified or distributed except as expressly authorized under the terms
 
8
% of the license contained in the file LICENSE in this distribution.
 
9
 
10
% For more information about licensing, please refer to
 
11
% http://www.ghostscript.com/licensing/. For information on
 
12
% commercial licensing, go to http://www.artifex.com/licensing/ or
 
13
% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
 
14
% San Rafael, CA  94903, U.S.A., +1(415)492-9861.
 
15
 
 
16
% $Id: gs_dps1.ps 8954 2008-08-08 04:22:38Z ray $
 
17
% Initialization file for most of the Display PostScript functions
 
18
% that are also included in Level 2.
 
19
 
 
20
level2dict begin
 
21
 
 
22
% ------ Virtual memory ------ %
 
23
 
 
24
/currentshared /.currentglobal load def
 
25
/scheck /.gcheck load def
 
26
%****** FOLLOWING IS WRONG ******
 
27
/shareddict currentdict /globaldict .knownget not { 20 dict } if def
 
28
 
 
29
% Global and LocalFontDirectory must remain in systemdict
 
30
% even if we temporarily exit Level 2 mode.
 
31
 
 
32
end                             % level2dict
 
33
systemdict begin
 
34
 
 
35
/SharedFontDirectory .FontDirectory .gcheck
 
36
 { .currentglobal false .setglobal
 
37
   /LocalFontDirectory .FontDirectory dup maxlength dict copy
 
38
   .forcedef    % LocalFontDirectory is local, systemdict is global
 
39
   .setglobal .FontDirectory
 
40
 }
 
41
 { /LocalFontDirectory .FontDirectory
 
42
   .forcedef    % LocalFontDirectory is local, systemdict is global
 
43
   50 dict
 
44
 }
 
45
ifelse def
 
46
 
 
47
end                             % systemdict
 
48
level2dict begin
 
49
 
 
50
% setshared must rebind FontDirectory to the appropriate one of
 
51
% Local or SharedFontDirectory.
 
52
 
 
53
/.setglobal             % <bool> .setglobal -
 
54
 { dup .setglobal
 
55
   //systemdict /FontDirectory .currentglobal
 
56
    { //SharedFontDirectory }
 
57
    { /LocalFontDirectory .systemvar }  % can't embed ref to local VM
 
58
   ifelse .forceput pop % LocalFontDirectory is local, systemdict is global
 
59
 } .bind odef           % must bind .forceput and .setglobal
 
60
                        % even if NOBIND in effect
 
61
% Don't just copy (load) the definition of .setglobal:
 
62
% it gets redefined for LL3.
 
63
/setshared { /.setglobal .systemvar exec } odef
 
64
.currentglobal setshared
 
65
 
 
66
% See below for changes in save and restore.
 
67
 
 
68
% ------ Fonts ------ %
 
69
 
 
70
/selectfont             % <fontname> <size> selectfont -
 
71
 {
 
72
   { 1 .argindex findfont
 
73
     1 index dup type /arraytype eq { makefont } { scalefont } ifelse
 
74
     setfont pop pop
 
75
   } stopped { /selectfont .systemvar $error /errorname get signalerror } if
 
76
 } odef
 
77
% undefinefont has to take local/global VM into account.
 
78
/undefinefont           % <fontname> undefinefont -
 
79
 { .FontDirectory 1 .argindex .forceundef       % FontDirectory is readonly
 
80
   .currentglobal
 
81
    {           % Current mode is global; delete from local directory too.
 
82
      //systemdict /LocalFontDirectory .knownget
 
83
       { 1 index .forceundef }          % LocalFontDirectory is readonly
 
84
      if
 
85
    }
 
86
    {           % Current mode is local; if there was a shadowed global
 
87
                % definition, copy it into the local directory.
 
88
      //systemdict /SharedFontDirectory .knownget
 
89
       { 1 index .knownget
 
90
          { .FontDirectory 2 index 3 -1 roll { put } //superexec } % readonly
 
91
         if
 
92
       }
 
93
      if
 
94
    }
 
95
   ifelse pop
 
96
 } odef
 
97
 
 
98
% If we load a font into global VM within an inner save, the restore
 
99
% will delete it from FontDirectory but not from SharedFontDirectory.
 
100
% We have to handle this by making restore copy missing entries from
 
101
% SharedFontDirectory to FontDirectory.  Since this could slow down restore
 
102
% considerably, we define a new operator .forcecopynew for this purpose.
 
103
% Furthermore, if FAKEFONTS is in effect, we want global real fonts to
 
104
% override fake local ones.  We handle this by brute force.
 
105
/restore                % <save> restore -
 
106
 { dup //restore        % bind even if NOBIND
 
107
   /LocalFontDirectory .systemvar
 
108
   FAKEFONTS
 
109
    { mark
 
110
                % We want to delete a fake font from the local directory
 
111
                % iff the global directory now has no definition for it,
 
112
                % or a non-fake definition.
 
113
      1 index dup
 
114
       {                % Stack: lfd mark lfd key ... lfd key value
 
115
         length 1 gt
 
116
          {             % This is a real local definition; don't do anything.
 
117
            pop
 
118
          }
 
119
          {             % This is a fake local definition, check for global.
 
120
            //SharedFontDirectory 1 index .knownget
 
121
             {          % A global definition exists, check for fake.
 
122
               length 1 eq { pop } { 1 index } ifelse
 
123
             }
 
124
             {          % No global definition, delete the local one.
 
125
               1 index
 
126
             }
 
127
            ifelse
 
128
          }
 
129
         ifelse
 
130
       } forall
 
131
      pop counttomark 2 idiv { .forceundef } repeat pop         % readonly
 
132
    }
 
133
   if
 
134
   //SharedFontDirectory exch .forcecopynew pop
 
135
   .currentglobal .setglobal    % Rebind FontDirectory according to current VM.
 
136
   pop
 
137
 } .bind odef
 
138
 
 
139
end                             % level2dict