Documente Academic
Documente Profesional
Documente Cultură
%
% This software is provided AS-IS with no warranty, either express or
% implied.
%
% This software is distributed under license and may not be copied,
% modified or distributed except as expressly authorized under the terms
% of the license contained in the file LICENSE in this distribution.
%
% For more information about licensing, please refer to
% http://www.ghostscript.com/licensing/. For information on
% commercial licensing, go to http://www.artifex.com/licensing/ or
% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
% San Rafael, CA 94903, U.S.A., +1(415)492-9861.
% We assume that names starting with '.prs' do not appear in resource files.
% If this causes any problem, this prefix should be systematically changed
% in this file. ('prs' is an abbreviation for 'prescan'.)
25 dict begin
/DummyCIDInit 15 dict
begin
/begincmap {} def
/usecmap {pop} bind def
{stop} bind
[ /begincodespacerange /endcodespacerange /beginnotdefchar /endnotdefchar
/beginnotdefrange /endnotdefrange /begincidchar /endcidchar /begincidrange
/endcidrange /endcmap /usefont /StartData
] {
1 index def
} bind forall
pop
/StopIfCSIDefined { % - StopIfCSIDefined -
/PrescanFile { % - PrescanFile -
{ //.prs_dict /.prsFile get token {
dup type % token type
dup /nametype eq exch /operatortype eq or {
dup xcheck {
exec
//StopIfCSIDefined exec
} if
} if
} {
stop
} ifelse
} loop
} bind odef
% Check if the given font name may be decomposed into CIDFont.CMap, CIDFont-CMap
% or into CIDFont--CMap, such that CIDFont and CMap have compatible CSIs.
% FontName
dup type /stringtype ne {
//name_buffer cvs
} if % (FontName)
{ dup length 2 sub -1 1 {
% (FontName) i
2 copy get dup //minus eq exch //period eq or {
2 copy 2 copy % (FontName) i (FontName) i (FontName) i
2 copy get //minus eq {
2 copy 1 sub get //minus eq {
1 sub
} if
} if % (FontName) i (FontName) i (FontName) i0
0 exch getinterval cvn % (FontName) i (FontName) i /CIDFontName
3 1 roll % (FontName) i /CIDFontName (FontName) i
1 add dup % (FontName) i /CIDFontName (FontName) i1
i1
5 index length % (FontName) i /CIDFontName (FontName) i1
i1 l
exch sub getinterval cvn % (FontName) i /CIDFontName /CMapName
2 copy //IsWellComposed exec { % (FontName) i /CIDFontName /CMapName
4 2 roll pop pop % /CIDFontName /CMapName
stop
} if
pop pop pop
} {
pop
} ifelse % (FontName)
} for
pop
} stopped
} bind def
% The following code supposes that the following names are not
% defined in the old /Font category dictionary :
% /IsComposedFont, /IsWellComposed .
5 index [ 2 index {exch //null put} aload pop ] cvx bind 5 index
//ResourceForAll exec
(*) [ 3 index {exch dup type /stringtype eq { cvn dup put } { pop pop }
ifelse } aload pop
] cvx bind 5 index /CMap resourceforall
(*) [ 4 index {exch dup type /stringtype eq { cvn dup put } { pop pop }
ifelse } aload pop
] cvx bind 5 index /CIDFont resourceforall
exit
} loop % This loop is a pattern for execstack_lookup - don't remove !
3 2 roll {
3 index {
3 1 roll % (templ) proc (scr) <<CMap>> <<Font>>
/CIDFont /CMap /CIDFont /CMap
6 index //ComposeName exec % (templ) proc (scr) <<CMap>> <<Font>>
/CIDFont /CMap (Font)
dup 8 index .stringmatch {
cvn % (templ) proc (scr) <<CMap>> <<Font>>
/CIDFont /CMap /Font
dup 4 index exch known {
pop pop
} {
2 index % (templ) proc (scr) <<CMap>> <<Font>>
/CIDFont /CMap /Font /CIDFont
4 2 roll % (templ) proc (scr) <<CMap>> <<Font>>
/Font /CIDFont /CIDFont /CMap
//IsWellComposed exec {
exch 2 index exch 2 put % (templ) proc (scr) <<CMap>> <<Font>>
/CIDFont
} {
exch pop
} ifelse
} ifelse
} {
pop pop
} ifelse
dup % (templ) proc (scr) <<CMap>> <<Font>>
/CIDFont /CIDFont
} forall
pop pop % (templ) proc (scr) <<CMap>> <<Font>>
} forall % (templ) proc (scr) <<CMap>> <<Font>>
exch pop % (templ) proc (scr) <<Font>>
4 3 roll pop % proc (scr) <<Font>>
} bind def