home *** CD-ROM | disk | FTP | other *** search
- %!PS-Adobe-3.0
- %%BeginFile: zsfont1.ps
- %
- % Copyright (c) 1994, 1995 Zenographics, Inc., Irvine, CA. All rights reserved
- %
- %
- % Routines to create stubs for default built-in fonts. This is essentially
- % part of the zsfont.ps package, but it is separate from zsfont.ps because
- % zsfont.ps is run before a device is setup; the calls this module makes
- % require a device to be setup to enable the instructions which assume a
- % current device.
- %
- %
- % Create semi-prepared versions of the built-in Windows fonts for inclusion
- % in FontDirectory. The fonts are normal in all respects except that they
- % have a /PrivateStr (in /Private) containing a 'null' to save most of the
- % space that a font occupies. The font will create a real /PrivateStr on the
- % fly the first time that its BuildChar is executed.
- %
- [ % List of resident fonts
- /Courier /Courier-Bold /Courier-Oblique /Courier-BoldOblique
- /Helvetica /Helvetica-Bold /Helvetica-Oblique /Helvetica-BoldOblique
- /Times-Roman /Times-Bold /Times-Italic /Times-BoldItalic
- /Symbol
- ]
- {
- % The general idea is to pre-allocate max-length strings for the 2 names
- % + the weight of the font, so we can release the VM allocated for
- % the PrivateStr that is allocated by getplatformfontmetrics; bracket
- % getplatformfontmetrics with save/restore.
- 32 string % Max TrueType sizes
- 32 string
- 64 string
- save
- 5 -1 roll %str str str save name
- dup getplatformfontmetrics not
- {stop}
- if
-
- % On stack, get rid of PrivateStr, substitute pre-alloc'd strs for new ones.
- 3 -1 roll pop null 3 1 roll % get rid of PrivateStr
- 5 -1 roll 19 -1 roll copy 5 1 roll % FullName
- 6 -1 roll 19 -1 roll copy 6 1 roll % FamilyName
- 7 -1 roll 19 -1 roll copy 7 1 roll % weight
-
- % Release VM alloc'd by getplatformfontmetrics
- 18 -1 roll restore
-
- % Create a font from modified platformfontmetrics
- __buildfontfromplatformmetrics
- definefont pop
- }
- forall
-