Gs Fonts
Gs Fonts
%
% 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.
/defaultfontmap_content 50 dict
1 dict begin
/; { 2 index 3 1 roll .growput } bind def
%% Replace 0 (Fontmap)
end def
DISKFONTS {
FontFileDirectory 2 index known {
dup /FontFile FontFileDirectory 4 index get .growput
} if
} if
systemdict /ProvideUnicode .knownget not { false } if {
/FontEmulationProcs /ProcSet findresource
/ProvideUnicodeDecoding get exec
} if
readonly % stack: name fontdict
} stopped { /invalidfont signalerror } if
} bind odef
/definefont
{ .completefont
% If the current allocation mode is global, also enter
% the font in LocalFontDirectory.
.currentglobal
{ //systemdict /LocalFontDirectory .knownget
{ 2 index 2 index .growput }
if
}
if
dup .FontDirectory 4 -2 roll .growput
% If the font originated as a resource, register it.
currentfile .currentresourcefile eq { dup .registerfont } if
} odef
%END FAKEFONTS
% If requested, load all the fonts defined in the Fontmap into FontDirectory
% as "fake" fonts i.e., font dicts with only FontName and FontType defined.
% (We define FontType only for the sake of some questionable code in the
% Apple Printer Utility 2.0 font inquiry code.)
%
% Note that this procedure only creates fake fonts in the FontDirectory
% associated with the current VM. This is because in multi-context systems,
% creating the fake fonts in local VM leads to undesirable complications.
/.definefakefonts
{
}
{
(gs_fonts FAKEFONTS) VMDEBUG
Fontmap {
pop dup type /stringtype eq { cvn } if
.FontDirectory 1 index known not {
2 dict dup /FontName 3 index put
dup /FontType 1 put
.FontDirectory 3 1 roll put
} {
pop
} ifelse
} forall
}
FAKEFONTS { exch } if pop def % don't bind, .current/setglobal get redefined
% Make a modified font and define it. Note that unlike definefont,
% this does not leave the font on the operand stack.