⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gs_type1.ps

📁 遗传算法工具箱 希望高手指点 GATOOLS
💻 PS
字号:
%    Copyright (C) 1994, 1995, 1996 Aladdin Enterprises.  All rights reserved.
% 
% This file is part of Aladdin Ghostscript.
% 
% Aladdin Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author
% or distributor accepts any responsibility for the consequences of using it,
% or for whether it serves any particular purpose or works at all, unless he
% or she says so in writing.  Refer to the Aladdin Ghostscript Free Public
% License (the "License") for full details.
% 
% Every copy of Aladdin Ghostscript must include a copy of the License,
% normally in a plain ASCII text file named PUBLIC.  The License grants you
% the right to copy, modify and redistribute Aladdin Ghostscript, but only
% under certain conditions described in the License.  Among other things, the
% License requires that the copyright notice and this notice be preserved on
% all copies.

% Type 1 font support code.

% The standard representation for PostScript compatible fonts is described
% in the book "Adobe Type 1 Font Format", published by Adobe Systems Inc.

% Define an augmented version of .buildfont1 that inserts UnderlinePosition
% and UnderlineThickness entries in FontInfo if they aren't there already.
% (This works around the incorrect assumption, made by many word processors,
% that these entries are present in the built-in fonts.)
/.buildfont1
 { dup /FontInfo known not
    { .growfontdict dup /FontInfo 2 dict put }
   if
   dup dup /FontInfo get dup dup
   /UnderlinePosition known exch /UnderlineThickness known and
    { pop pop		% entries already present
    }
    { dup length 2 add dict .copydict
      dup /UnderlinePosition known not
       { dup /UnderlinePosition 3 index /FontBBox get
         1 get 2 div put		% 1/2 the font descent
       }
      if
      dup /UnderlineThickness known not
       { dup /UnderlineThickness 3 index /FontBBox get
         dup 3 get exch 1 get sub 20 div put	% 1/20 the font height
       }
      if
      1 index /FontInfo get wcheck not { readonly } if
      /FontInfo exch put
    }
   ifelse //.buildfont1
 } bind def
% If the diskfont feature isn't included, define a dummy .loadfontdict.
/.loadfontdict where
 { pop }
 { /.loadfontdict 0 dict readonly def }
ifelse
/.loadfontfile		% <file> .loadfontfile -
 { mark exch //systemdict begin
   DISKFONTS { .loadfontdict begin } if
   % We really would just like systemdict on the stack,
   % but fonts produced by Fontographer require a writable dictionary....
   userdict begin
	% We can't just use `run', because we want to check for .PFB files.
   currentpacking
    { false setpacking .loadfont1 true setpacking }
    { .loadfont1 }
   ifelse
    { stop } if
   end
   DISKFONTS { end } if
   end cleartomark
 } bind def
/.loadfont1		% <file> .loadfont1 <errorflag>
 {	% We would like to use `false /PFBDecode filter',
	% but this occasionally produces a whitespace character as
	% the first of an eexec section, so we can't do it.
	% Also, since the real input file never reaches EOF if we are using
	% a PFBDecode filter (the filter stops just after reading the last
	% character), we must explicitly close the real file in this case.
	% Since the file might leave garbage on the operand stack,
	% we have to create a procedure to close the file reliably.
    { dup read not { -1 } if
      2 copy unread 16#80 eq
       { [ exch dup true /PFBDecode filter cvx exch cvlit
         //systemdict /closefile get ]
       }
      if cvx exec
    } stopped
   $error /newerror get and dup { .clearerror } if
 } bind def


% The CharStrings are a dictionary in which the key is the character name,
% and the value is a compressed and encrypted representation of a path.
% For detailed information, see the book "Adobe Type 1 Font Format",
% published by Adobe Systems Inc.

% Here are the BuildChar and BuildGlyph implementation for Type 1 fonts.
% The names %Type1BuildChar and %Type1BuildGlyph are known to the interpreter.
% The real work is done in an operator:
%	<font> <code|name> <name> <charstring> .type1execchar -

(%Type1BuildChar) cvn	% <font> <code> %Type1BuildChar -
 { 1 index /Encoding get 1 index get .type1build
 } bind def
(%Type1BuildGlyph) cvn	% <font> <name> %Type1BuildGlyph -
 { dup .type1build
 } bind def
/.type1build		% <font> <code|name> <name> .type1build -
 { 2 index begin
    dup CharStrings exch .knownget not
     { 2 copy eq { exch pop /.notdef exch } if
       QUIET not
	{ (Substituting .notdef for ) print = flush }
	{ pop }
       ifelse
       /.notdef CharStrings /.notdef get
     } if
   end .type1execchar
 } bind def
% CCRun is an undocumented procedure provided for Type 4 fonts.
1183615869 internaldict begin
/CCRun			% <font> <code|name> <charstring> CCRun -
 { 1 index dup type /integertype eq
    { 3 index /Encoding get exch get }
   if exch .type1execchar
 } bind def
end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -