/usr/share/ghostscript/8.70/lib
NameSizeModeActions
acctest.ps43240644editdlrm
addxchar.ps98480644editdlrm
align.ps23130644editdlrm
bdftops.ps234030644editdlrm
bj8.rpd6390644editdlrm
bj8gc12f.upp15280644editdlrm
bj8hg12f.upp15270644editdlrm
bj8oh06n.upp15130644editdlrm
bj8pa06n.upp15210644editdlrm
bj8pp12f.upp15380644editdlrm
bj8ts06n.upp15260644editdlrm
bjc610a0.upp15230644editdlrm
bjc610a1.upp15120644editdlrm
bjc610a2.upp15130644editdlrm
bjc610a3.upp15180644editdlrm
bjc610a4.upp15260644editdlrm
bjc610a5.upp15130644editdlrm
bjc610a6.upp15130644editdlrm
bjc610a7.upp15160644editdlrm
bjc610a8.upp15220644editdlrm
bjc610b1.upp15120644editdlrm
bjc610b2.upp15130644editdlrm
bjc610b3.upp15180644editdlrm
bjc610b4.upp15260644editdlrm
bjc610b6.upp15130644editdlrm
bjc610b7.upp15170644editdlrm
bjc610b8.upp15220644editdlrm
bjc6000a1.upp16600644editdlrm
bjc6000b1.upp16600644editdlrm
caption.ps17210644editdlrm
cbjc600.ppd110400644editdlrm
cbjc800.ppd113830644editdlrm
cdj550.upp16860644editdlrm
cdj690.upp19950644editdlrm
cdj690ec.upp20560644editdlrm
cid2code.ps44750644editdlrm
decrypt.ps3500644editdlrm
dmp_init.ps72460644editdlrm
dmp_site.ps4590644editdlrm
dnj750c.upp28040644editdlrm
dnj750m.upp19710644editdlrm
docie.ps73730644editdlrm
dumphint.ps200440644editdlrm
escp_24.src3500644editdlrm
font2c.ps195910644editdlrm
font2pcl.ps175680644editdlrm
ghostpdf.ppd256430644editdlrm
gslp.ps196430644editdlrm
gsnup.ps27250644editdlrm
gs_ce_e.ps23640644editdlrm
gs_cmdl.ps48440644editdlrm
gs_fform.ps31620644editdlrm
gs_il2_e.ps27770644editdlrm
gs_kanji.ps39420644editdlrm
gs_ksb_e.ps32910644editdlrm
gs_l.xbm19450644editdlrm
gs_l.xpm27510644editdlrm
gs_lgo_e.ps28860644editdlrm
gs_lgx_e.ps19120644editdlrm
gs_l_m.xbm19550644editdlrm
gs_m.xbm9450644editdlrm
gs_m.xpm14370644editdlrm
gs_m_m.xbm9550644editdlrm
gs_pfile.ps43490644editdlrm
gs_rdlin.ps8620644editdlrm
gs_s.xbm5940644editdlrm
gs_s.xpm9570644editdlrm
gs_s_m.xbm6040644editdlrm
gs_t.xbm3450644editdlrm
gs_t.xpm6050644editdlrm
gs_t_m.xbm3550644editdlrm
gs_wl1_e.ps25300644editdlrm
gs_wl2_e.ps25280644editdlrm
gs_wl5_e.ps25460644editdlrm
ht_ccsto.ps2281940644editdlrm
image-qa.ps733230644editdlrm
impath.ps55380644editdlrm
jispaper.ps9300644editdlrm
landscap.ps15250644editdlrm
level1.ps1100644editdlrm
lines.ps38680644editdlrm
markhint.ps34730644editdlrm
markpath.ps18900644editdlrm
mkcidfm.ps73050644editdlrm
necp2x.upp10410644editdlrm
necp2x6.upp10650644editdlrm
packfile.ps103580644editdlrm
pcharstr.ps35840644editdlrm
pdf2dsc.ps83770644editdlrm
PDFA_def.ps11700644editdlrm
pdfopt.ps365160644editdlrm
pdfwrite.ps116760644editdlrm
PDFX_def.ps18680644editdlrm
pf2afm.ps153510644editdlrm
pfbtopfa.ps11410644editdlrm
PM760p.upp11600644editdlrm
PM760pl.upp11240644editdlrm
PM820p.upp11420644editdlrm
PM820pl.upp11170644editdlrm
ppath.ps19740644editdlrm
pphs3910644editdlrm
pphs.ps69220644editdlrm
prfont.ps64870644editdlrm
printafm.ps37750644editdlrm
ps2ai.ps224850644editdlrm
ps2ascii.ps446180644editdlrm
ps2epsi.ps81870644editdlrm
quit.ps50644editdlrm
ras1.upp2110644editdlrm
ras3.upp2100644editdlrm
ras4.upp2160644editdlrm
ras8m.upp2050644editdlrm
ras24.upp2150644editdlrm
ras32.upp1920644editdlrm
rollconv.ps117650644editdlrm
s400a1.upp14540644editdlrm
s400b1.upp16030644editdlrm
sharp.upp19360644editdlrm
showchar.ps29320644editdlrm
showpage.ps90644editdlrm
sipixa6.upp5290644editdlrm
st640ih.upp22770644editdlrm
st640ihg.upp15040644editdlrm
st640p.upp19100644editdlrm
st640pg.upp11370644editdlrm
st640pl.upp18740644editdlrm
st640plg.upp11010644editdlrm
stc.upp19190644editdlrm
stc2.upp19000644editdlrm
stc2s_h.upp22680644editdlrm
stc2_h.upp18750644editdlrm
stc200_h.upp18440644editdlrm
stc300.upp21320644editdlrm
stc300bl.upp13370644editdlrm
stc300bm.upp14260644editdlrm
stc500p.upp18990644editdlrm
stc500ph.upp18990644editdlrm
stc600ih.upp22770644editdlrm
stc600p.upp11470644editdlrm
stc600pl.upp11110644editdlrm
stc640p.upp10910644editdlrm
Stc670p.upp11590644editdlrm
Stc670pl.upp11240644editdlrm
Stc680p.upp11400644editdlrm
Stc680pl.upp11150644editdlrm
stc740ih.upp21230644editdlrm
Stc740p.upp10390644editdlrm
Stc740pl.upp11150644editdlrm
Stc760p.upp11410644editdlrm
Stc760pl.upp11150644editdlrm
Stc777p.upp11400644editdlrm
Stc777pl.upp11150644editdlrm
stc800ih.upp21540644editdlrm
stc800p.upp11110644editdlrm
stc800pl.upp10930644editdlrm
stc1520h.upp21500644editdlrm
stcany.upp6690644editdlrm
stcany_h.upp6770644editdlrm
stcinfo.ps257330644editdlrm
stcolor.ps52210644editdlrm
stc_h.upp19090644editdlrm
stc_l.upp7300644editdlrm
stocht.ps26460644editdlrm
Stp720p.upp11580644editdlrm
Stp720pl.upp11150644editdlrm
Stp870p.upp11400644editdlrm
Stp870pl.upp11150644editdlrm
traceimg.ps15280644editdlrm
traceop.ps27340644editdlrm
type1enc.ps25360644editdlrm
type1ops.ps75760644editdlrm
uninfo.ps61360644editdlrm
unprot.ps19040644editdlrm
viewcmyk.ps21130644editdlrm
viewgif.ps45730644editdlrm
viewjpeg.ps49490644editdlrm
viewmiff.ps37780644editdlrm
viewpbm.ps53070644editdlrm
viewpcx.ps43450644editdlrm
viewps2a.ps12820644editdlrm
wftopfa.ps89230644editdlrm
winmaps.ps37430644editdlrm
wrfont.ps181680644editdlrm
zeroline.ps24630644editdlrm
Edit: /usr/share/ghostscript/8.70/lib/packfile.ps (10358B)
% Copyright (C) 1994, 1995, 1996 Aladdin Enterprises. All rights reserved. % % 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. % $Id: packfile.ps 6300 2005-12-28 19:56:24Z giles $ % packfile.ps % Pack groups of files together, with compression, for use in % storage-scarce environments. % ****** NOTE: This file must be kept consistent with gs_pfile.ps. % ---------------- Huffman coding utilities ---------------- % % We count runs of zeros, and individual byte frequencies separately % depending on whether they follow or do not follow a run of zeros. /zruns 256 array def /zfreq 256 array def /nzfreq 256 array def /maxcode 13 def % max code length, must be between 10 and 16 /maxzrun 100 def % max length of zero run, must be <= 100 /statbuf 10000 string def % Initialize statistics. /initstats % - initstats - { 0 1 255 { zruns exch 0 put } for 0 1 255 { zfreq exch 0 put } for 0 1 255 { nzfreq exch 0 put } for } bind def % Accumulate statistics from an individual file. /addstats % addstats - { 0 { 1 index //statbuf readstring 3 1 roll % Stack: file eof numzeros data { dup 0 eq { pop 1 add } { 1 index 0 ne { exch 255 .min //zruns exch 2 copy get 1 add put 0 exch //zfreq } { //nzfreq } ifelse exch 2 copy get 1 add put } ifelse } forall exch not { exit } if (.) print flush } loop pop closefile } bind def % Compute the Huffman codes from the statistics. /statcodes % - statcodes { maxcode 1 add 256 add maxzrun 2 sub add 1 add array % full array dup maxcode 1 add dup 2 index length exch sub getinterval % data % Put statistics into array dup 0 1 255 { zfreq 1 index get nzfreq 2 index get add put dup } for 0 zruns 1 get put 256 zruns 2 maxzrun 2 sub getinterval putinterval dup dup length 1 sub 1 put % EOD maxcode .computecodes } bind def % ---------------- File handling ---------------- % % Copy one file to another. % Close the input file, but not the output file. /copyfile % copyfile { 0 mark statbuf { 4 index 1 index readstring exch 5 index 1 index writestring length 5 -1 roll add 4 1 roll not { exit } if (.) print flush } loop cleartomark 3 -1 roll closefile dup == flush } bind def % Represent a Type 1 font in its most compressed format. % Requires -dWRITESYSTEMDICT to run. % Does not close the output file. (wrfont.ps) runlibfile /compressfont % compressfont { exch save systemdict /executeonly /readonly load put systemdict /noaccess /readonly load put systemdict readonly pop wrfont_dict begin /binary_CharStrings true def /binary_tokens true def /encrypt_CharStrings false def /standard_only false def /use_lenIV 0 def /smallest_output true def end exch findfont setfont 1 index writefont restore } bind def % ---------------- Main program ---------------- % % Find the length of a file. /filelength % filelength { status { pop pop exch pop } { -1 } ifelse } bind def % Define the header string for a compressed file. /beginfilestring ({dup token pop exch[/MaxCodeLength 2 index token pop/Tables 4 index token pop /EndOfData true/EncodeZeroRuns 256 .dicttomark /BoundedHuffmanDecode filter/MoveToFrontDecode filter [/BlockSize 4 -1 roll .dicttomark/BWBlockSortDecode filter }) readonly def % Write a 16-bit big-endian non-negative integer on a file. /write16 % write16 - { 2 copy -8 bitshift write 255 and write } bind def % Compress a group of files together. % Return a dictionary in which the keys are the input file names % and the values are [startpos length] in the uncompressed concatenation. % Does not open or close the output file. /tempname (t.em) def /packfiles % packfiles { % Concatenate files to a temporary file. tempname (w) file dup /MoveToFrontEncode filter dup << /BlockSize 1000000 >> /BWBlockSortEncode filter % Stack: filenames outfile tempfile mtfe bwe 5 -1 roll dup length dict 0 6 2 roll { % Stack: outfile posdict pos tempfile mtfe bwe infilename dup ==only dup (r) file 2 index copyfile exch pop dup 7 index 4 2 roll 7 index exch 2 array astore put 5 -1 roll add 4 1 roll } forall closefile closefile closefile pop exch % Stack: posdict outfile % Compute an optimal Huffman code. initstats tempname (r) file addstats % Actually compress the file. % Write the decompression information on the output first. dup tempname filelength write== dup maxcode write== % Write the code table as a homogenous number array. statcodes exch dup 149 write dup 32 write dup 2 index length write16 exch { 2 copy write16 pop } forall dup << /MaxCodeLength maxcode /EndOfData true /EncodeZeroRuns 256 /Tables statcodes >> /BoundedHuffmanEncode filter tempname (r) file exch copyfile pop closefile exch } bind def % Squeeze a font to a .cpf file in anticipation of compression. /squeezefont % squeezefont { dup type /nametype ne { cvn } if dup { dup type /stringtype eq { exit } if Fontmap exch get } loop % Stack: fontname filename dup dup { (.) search not { exit } if exch pop exch 3 -1 roll pop } loop % Stack: fontname filename noextname extension exch { (/) search not { (\\) search not { exit } if } if pop pop } loop % If the font extension is anything other than % .pfa or .pfb, we assume it can't be rewritten % using compressfont. % Stack: fontname filename extension basename (.cpf) concatstrings dup 5 1 roll (w) file % Stack: outfilename fontname filename extension outfile exch dup (pfa) eq exch (pfb) eq or % Stack: outfilename fontname filename outfile bool { exch pop compressfont } { 3 -1 roll pop exch findlibfile pop exch pop exch copyfile pop } ifelse closefile } bind def % ---------------- Production code ---------------- % % The following code constructs a packed version of the commercial-quality % fonts available from Aladdin Enterprises. To use this code: % - If desired, change the output file names below. % - Make sure you have the synthetic font data (fontmap.shs and the % *.ps files for the commercial fonts) in a directory that is on % Ghostscript's search path. % - Construct the packed fonts by running % gs -dNODISPLAY -dWRITESYSTEMDICT packfile.ps % - If desired, move the output files to the directory that will be % used at run time. You no longer need the *.pfb or *.ps files % for the original fonts; however, you do still need the Fontmap % for these fonts, because it defines the font name aliases. % - Add the following line to the end of gs_fonts.ps: % (ALL.cmp) run % (substituting the definition of allmapname if you changed it). % Define the output file names. The extensions are arbitrary; % any legal file name is allowed. /allname (ALL.cff) def % the compressed font file /allmapname (ALL.cmp) def % the Fontmap override file % Load an alternate Fontmap that references the synthetic oblique and % narrow fonts. true .setglobal (fontmap.shs) findlibfile pop exch pop .loadFontmap false .setglobal % Define the packaging of fonts into font groups. % Fewer larger groups compress better, but make decompression slower. /Lists [ [ % The oblique and narrow fonts are synthetic, % and take very little space. /AvantGarde-BookOblique /AvantGarde-DemiOblique /Courier-Oblique /Courier-BoldOblique /Helvetica-Oblique /Helvetica-BoldOblique /Helvetica-Narrow /Helvetica-Narrow-Oblique /Helvetica-Narrow-Bold /Helvetica-Narrow-BoldOblique ] [/AvantGarde-Book /AvantGarde-Demi /Bookman-Light] [/Bookman-LightItalic /Bookman-Demi /Bookman-DemiItalic /Courier] [/Courier-Bold /Helvetica /Helvetica-Bold] [/NewCenturySchlbk-Roman /NewCenturySchlbk-Italic /NewCenturySchlbk-Bold /NewCenturySchlbk-BoldItalic] [/Palatino-Roman /Palatino-Italic /Palatino-Bold /Palatino-BoldItalic] [/Times-Roman /Times-Italic /Times-Bold /Times-BoldItalic] [/Symbol /ZapfChancery-MediumItalic /ZapfDingbats] ] def % We need to register the fonts under their true names, not aliases. /Lists Lists mark exch { mark exch { { Fontmap 1 index get dup type /nametype ne { pop exit } if exch pop } loop } forall ] } forall ] def % Squeeze the fonts to their .cpf format. (Squeezing... ) print flush /fdict mark Lists { { dup squeezefont } forall } forall .dicttomark def (done.\n) print flush % Invert fdict. /f2dict fdict length dict def fdict { exch f2dict 3 1 roll put } forall % Construct the compressed font file. (Creating ) print allname print (... ) print flush /posdict fdict length dict def /all allname (w) file def all beginfilestring writestring Lists { dup == flush /fbegin all fileposition def mark exch { fdict exch get } forall ] all packfiles exch pop /flength all fileposition fbegin sub def { fbegin flength 3 -1 roll aload pop 4 packedarray exch f2dict exch get exch posdict 3 1 roll put } forall } forall all closefile (done.\n) print flush % Write the Fontmap addendum for accessing compressed fonts. (Writing ) print allmapname print (... ) print flush allmapname (w) file dup (%! /.runpackedlibfile where{pop}{(gs_pfile.ps)runlibfile}ifelse .currentglobal true .setglobal ) writestring posdict { exch 2 index exch write==only exch dup ({) writestring dup allname write==only exch { 1 index dup ( ) writestring exch write==only } forall dup ( .runpackedlibfile}bind .definefontmap ) writestring } forall dup (.setglobal ) writestring closefile (done.\n) print flush