%    Copyright (C) 1992 Aladdin Enterprises.  All rights reserved.
%
% This file is part of Ghostscript.
%
% 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 Ghostscript General Public License for full details.
%
% Everyone is granted permission to copy, modify and redistribute
% Ghostscript, but only under the conditions described in the Ghostscript
% General Public License.  A copy of this license is supposed to have been
% given to you along with Ghostscript so you can know your rights and
% responsibilities.  It should be in a file named COPYING.  Among other
% things, the copyright notice and this notice must be preserved on all
% copies.

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

% Define findencoding.
% (cshow, rootfont, and setcachedevice2 are real operators.)

/.encodingdict 4 dict
	dup /StandardEncoding /StandardEncoding cvx put
	dup /ISOLatin1Encoding /ISOLatin1Encoding cvx put
	dup /SymbolEncoding /SymbolEncoding cvx put
	dup /DingbatsEncoding /DingbatsEncoding cvx put
	def
/findencoding
	{ //.encodingdict exch get exec } odef

% Redefine the setcachedevice step of Type1BuildChar
% so that it takes Metrics2 and CDevProc into account.
/setcachedevice_C	% stack: <charcode> <charname> <..args..>
 { 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
    { 11 index exch exec
    }
   if
   setcachedevice2
 } bind def
