%    Copyright (C) 1992, 1994 Aladdin Enterprises.  All rights reserved.
% 
% This file is part of GNU Ghostscript.
% 
% GNU Ghostscript is distributed in the hope that it will be useful, but
% WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility to
% anyone for the consequences of using it or for whether it serves any
% particular purpose or works at all, unless he says so in writing.  Refer
% to the GNU Ghostscript General Public License for full details.
% 

% Initialization file for composite font facilities.
% When this is run, systemdict is still writable.

% Define findencoding.
% (cshow, rootfont, and setcachedevice2 are real operators.)
% .encodingdict is defined and initialized in gs_init.ps.
% .findencoding is defined in gs_init.ps.
/findencoding { .findencoding } odef

% Redefine the setcachedevice step of Type1BuildChar
% so that it takes Metrics2 and CDevProc into account.
/setcache_C		% <charname> <wx> <wy> <llx> <lly> <urx> <ury>
			%   setcache_C -
 { currentdict /Metrics2 .knownget
    { 7 index .knownget
       { aload pop }
       { 5 index 5 index 0 0 }
      ifelse
    }
    { 5 index 5 index 0 0
    }
   ifelse
   currentdict /CDevProc .knownget
    { 12 -1 roll exch exec }
    { 11 -1 roll pop }
   ifelse
   setcachedevice2
 } bind def
