From dc55d4f5cde421a3704c183bc6ceb3fcdb6b0653 Mon Sep 17 00:00:00 2001 From: Reinhard Kotucha Date: Wed, 12 May 2010 19:25:45 +0000 Subject: tlgs: 8.70 => 8.71 git-svn-id: svn://tug.org/texlive/trunk@18215 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/tlgs/README.TEXLIVE | 2 +- Master/tlpkg/tlgs/bin/gsdll32.dll | Bin 11165696 -> 11575296 bytes Master/tlpkg/tlgs/bin/gsdll32.lib | Bin 8014 -> 8014 bytes Master/tlpkg/tlgs/bin/gswin32.exe | Bin 147456 -> 147456 bytes Master/tlpkg/tlgs/bin/gswin32c.exe | Bin 139264 -> 139264 bytes Master/tlpkg/tlgs/lib/EndOfTask.ps | 0 Master/tlpkg/tlgs/lib/FAPIcidfmap | 64 +- Master/tlpkg/tlgs/lib/FAPIconfig | 28 +- Master/tlpkg/tlgs/lib/FAPIconfig-FCO | 28 +- Master/tlpkg/tlgs/lib/FAPIfontmap | 66 +- Master/tlpkg/tlgs/lib/FCOfontmap-PCLPS3 | 396 +- Master/tlpkg/tlgs/lib/FCOfontmap-PS3 | 318 +- Master/tlpkg/tlgs/lib/PDFA_def.ps | 86 +- Master/tlpkg/tlgs/lib/PDFX_def.ps | 102 +- Master/tlpkg/tlgs/lib/acctest.ps | 200 +- Master/tlpkg/tlgs/lib/addxchar.ps | 714 ++-- Master/tlpkg/tlgs/lib/afmdiff.awk | 0 Master/tlpkg/tlgs/lib/align.ps | 146 +- Master/tlpkg/tlgs/lib/bdftops.ps | 1590 +++---- Master/tlpkg/tlgs/lib/bj8.rpd | 0 Master/tlpkg/tlgs/lib/caption.ps | 112 +- Master/tlpkg/tlgs/lib/cat.ps | 0 Master/tlpkg/tlgs/lib/cid2code.ps | 320 +- Master/tlpkg/tlgs/lib/decrypt.ps | 30 +- Master/tlpkg/tlgs/lib/docie.ps | 440 +- Master/tlpkg/tlgs/lib/dumphint.ps | 1512 +++---- Master/tlpkg/tlgs/lib/font2c.ps | 1350 +++--- Master/tlpkg/tlgs/lib/font2pcl.ps | 1206 +++--- Master/tlpkg/tlgs/lib/ghostpdf.inf | 0 Master/tlpkg/tlgs/lib/gs_ce_e.ps | 94 +- Master/tlpkg/tlgs/lib/gs_cmdl.ps | 360 +- Master/tlpkg/tlgs/lib/gs_fform.ps | 184 +- Master/tlpkg/tlgs/lib/gs_il2_e.ps | 126 +- Master/tlpkg/tlgs/lib/gs_kanji.ps | 316 +- Master/tlpkg/tlgs/lib/gs_ksb_e.ps | 128 +- Master/tlpkg/tlgs/lib/gs_lgo_e.ps | 182 +- Master/tlpkg/tlgs/lib/gs_lgx_e.ps | 120 +- Master/tlpkg/tlgs/lib/gs_pfile.ps | 254 +- Master/tlpkg/tlgs/lib/gs_rdlin.ps | 40 +- Master/tlpkg/tlgs/lib/gs_wl1_e.ps | 132 +- Master/tlpkg/tlgs/lib/gs_wl2_e.ps | 132 +- Master/tlpkg/tlgs/lib/gs_wl5_e.ps | 132 +- Master/tlpkg/tlgs/lib/gslp.ps | 1390 +++--- Master/tlpkg/tlgs/lib/gsnup.ps | 186 +- Master/tlpkg/tlgs/lib/ht_ccsto.ps | 7106 +++++++++++++++---------------- Master/tlpkg/tlgs/lib/image-qa.ps | 3652 ++++++++-------- Master/tlpkg/tlgs/lib/impath.ps | 358 +- Master/tlpkg/tlgs/lib/jispaper.ps | 54 +- Master/tlpkg/tlgs/lib/jobseparator.ps | 8 +- Master/tlpkg/tlgs/lib/landscap.ps | 62 +- Master/tlpkg/tlgs/lib/level1.ps | 6 +- Master/tlpkg/tlgs/lib/lines.ps | 330 +- Master/tlpkg/tlgs/lib/markhint.ps | 260 +- Master/tlpkg/tlgs/lib/markpath.ps | 118 +- Master/tlpkg/tlgs/lib/mkcidfm.ps | 718 ++-- Master/tlpkg/tlgs/lib/packfile.ps | 666 +-- Master/tlpkg/tlgs/lib/pcharstr.ps | 252 +- Master/tlpkg/tlgs/lib/pdf2dsc.ps | 508 +-- Master/tlpkg/tlgs/lib/pdfopt.ps | 2544 +++++------ Master/tlpkg/tlgs/lib/pdfwrite.ps | 794 ++-- Master/tlpkg/tlgs/lib/pf2afm.ps | 1078 ++--- Master/tlpkg/tlgs/lib/pfbtopfa.ps | 68 +- Master/tlpkg/tlgs/lib/ppath.ps | 108 +- Master/tlpkg/tlgs/lib/pphs.ps | 442 +- Master/tlpkg/tlgs/lib/prfont.ps | 496 +-- Master/tlpkg/tlgs/lib/printafm.ps | 348 +- Master/tlpkg/tlgs/lib/ps2ai.ps | 1102 ++--- Master/tlpkg/tlgs/lib/ps2ascii.ps | 3048 ++++++------- Master/tlpkg/tlgs/lib/ps2epsi.ps | 494 +-- Master/tlpkg/tlgs/lib/quit.ps | 2 +- Master/tlpkg/tlgs/lib/rollconv.ps | 744 ++-- Master/tlpkg/tlgs/lib/showchar.ps | 186 +- Master/tlpkg/tlgs/lib/showpage.ps | 2 +- Master/tlpkg/tlgs/lib/stcinfo.ps | 1598 +++---- Master/tlpkg/tlgs/lib/stcolor.ps | 342 +- Master/tlpkg/tlgs/lib/stocht.ps | 124 +- Master/tlpkg/tlgs/lib/traceimg.ps | 84 +- Master/tlpkg/tlgs/lib/traceop.ps | 166 +- Master/tlpkg/tlgs/lib/type1enc.ps | 130 +- Master/tlpkg/tlgs/lib/type1ops.ps | 474 +-- Master/tlpkg/tlgs/lib/uninfo.ps | 440 +- Master/tlpkg/tlgs/lib/unprot.ps | 134 +- Master/tlpkg/tlgs/lib/viewcmyk.ps | 126 +- Master/tlpkg/tlgs/lib/viewgif.ps | 320 +- Master/tlpkg/tlgs/lib/viewjpeg.ps | 318 +- Master/tlpkg/tlgs/lib/viewmiff.ps | 248 +- Master/tlpkg/tlgs/lib/viewpbm.ps | 368 +- Master/tlpkg/tlgs/lib/viewpcx.ps | 300 +- Master/tlpkg/tlgs/lib/viewps2a.ps | 64 +- Master/tlpkg/tlgs/lib/viewrgb.ps | 292 +- Master/tlpkg/tlgs/lib/wftopfa.ps | 606 +-- Master/tlpkg/tlgs/lib/winmaps.ps | 212 +- Master/tlpkg/tlgs/lib/wrfont.ps | 1330 +++--- Master/tlpkg/tlgs/lib/zeroline.ps | 200 +- 94 files changed, 22958 insertions(+), 22958 deletions(-) mode change 100755 => 100644 Master/tlpkg/tlgs/bin/gsdll32.dll mode change 100755 => 100644 Master/tlpkg/tlgs/bin/gsdll32.lib mode change 100755 => 100644 Master/tlpkg/tlgs/lib/EndOfTask.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/FAPIcidfmap mode change 100755 => 100644 Master/tlpkg/tlgs/lib/FAPIconfig mode change 100755 => 100644 Master/tlpkg/tlgs/lib/FAPIconfig-FCO mode change 100755 => 100644 Master/tlpkg/tlgs/lib/FAPIfontmap mode change 100755 => 100644 Master/tlpkg/tlgs/lib/FCOfontmap-PCLPS3 mode change 100755 => 100644 Master/tlpkg/tlgs/lib/FCOfontmap-PS3 mode change 100755 => 100644 Master/tlpkg/tlgs/lib/PDFA_def.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/PDFX_def.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/acctest.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/addxchar.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/afmdiff.awk mode change 100755 => 100644 Master/tlpkg/tlgs/lib/align.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/bdftops.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/bj8.rpd mode change 100755 => 100644 Master/tlpkg/tlgs/lib/caption.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/cat.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/cid2code.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/decrypt.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/docie.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/dumphint.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/font2c.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/font2pcl.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/ghostpdf.inf mode change 100755 => 100644 Master/tlpkg/tlgs/lib/gs_ce_e.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/gs_cmdl.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/gs_fform.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/gs_il2_e.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/gs_kanji.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/gs_ksb_e.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/gs_lgo_e.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/gs_lgx_e.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/gs_pfile.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/gs_rdlin.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/gs_wl1_e.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/gs_wl2_e.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/gs_wl5_e.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/gslp.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/gsnup.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/ht_ccsto.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/image-qa.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/impath.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/jispaper.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/jobseparator.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/landscap.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/level1.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/lines.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/markhint.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/markpath.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/mkcidfm.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/packfile.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/pcharstr.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/pdf2dsc.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/pdfopt.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/pdfwrite.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/pf2afm.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/pfbtopfa.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/ppath.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/pphs.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/prfont.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/printafm.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/ps2ai.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/ps2ascii.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/ps2epsi.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/quit.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/rollconv.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/showchar.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/showpage.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/stcinfo.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/stcolor.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/stocht.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/traceimg.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/traceop.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/type1enc.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/type1ops.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/uninfo.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/unprot.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/viewcmyk.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/viewgif.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/viewjpeg.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/viewmiff.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/viewpbm.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/viewpcx.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/viewps2a.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/viewrgb.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/wftopfa.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/winmaps.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/wrfont.ps mode change 100755 => 100644 Master/tlpkg/tlgs/lib/zeroline.ps diff --git a/Master/tlpkg/tlgs/README.TEXLIVE b/Master/tlpkg/tlgs/README.TEXLIVE index 1e8b83f7bdb..625c2e4a358 100644 --- a/Master/tlpkg/tlgs/README.TEXLIVE +++ b/Master/tlpkg/tlgs/README.TEXLIVE @@ -1,5 +1,5 @@ -This directory contains a subset of the Ghostscript 8.70 distribution +This directory contains a subset of the Ghostscript 8.71 distribution for Windows. The only purpose of this package is to support programs shipped with TeX Live. It's not intended for general use. diff --git a/Master/tlpkg/tlgs/bin/gsdll32.dll b/Master/tlpkg/tlgs/bin/gsdll32.dll old mode 100755 new mode 100644 index ba3bb14e990..21112d0ed4f Binary files a/Master/tlpkg/tlgs/bin/gsdll32.dll and b/Master/tlpkg/tlgs/bin/gsdll32.dll differ diff --git a/Master/tlpkg/tlgs/bin/gsdll32.lib b/Master/tlpkg/tlgs/bin/gsdll32.lib old mode 100755 new mode 100644 index 6f04277b016..dd2d26c7d47 Binary files a/Master/tlpkg/tlgs/bin/gsdll32.lib and b/Master/tlpkg/tlgs/bin/gsdll32.lib differ diff --git a/Master/tlpkg/tlgs/bin/gswin32.exe b/Master/tlpkg/tlgs/bin/gswin32.exe index 827cd3281f7..6caf62d4220 100755 Binary files a/Master/tlpkg/tlgs/bin/gswin32.exe and b/Master/tlpkg/tlgs/bin/gswin32.exe differ diff --git a/Master/tlpkg/tlgs/bin/gswin32c.exe b/Master/tlpkg/tlgs/bin/gswin32c.exe index 988b56919bd..acb5afad16a 100755 Binary files a/Master/tlpkg/tlgs/bin/gswin32c.exe and b/Master/tlpkg/tlgs/bin/gswin32c.exe differ diff --git a/Master/tlpkg/tlgs/lib/EndOfTask.ps b/Master/tlpkg/tlgs/lib/EndOfTask.ps old mode 100755 new mode 100644 diff --git a/Master/tlpkg/tlgs/lib/FAPIcidfmap b/Master/tlpkg/tlgs/lib/FAPIcidfmap old mode 100755 new mode 100644 index 697a2a17667..38e42e60df1 --- a/Master/tlpkg/tlgs/lib/FAPIcidfmap +++ b/Master/tlpkg/tlgs/lib/FAPIcidfmap @@ -1,32 +1,32 @@ -%! -% $Id: FAPIcidfmap 6826 2006-05-31 15:29:52Z leonardo $ -% This is a sample map file for FAPI CID fonts. - -% -% The map is a set of records like this : -% -% /CIDfont_name options_dict ; -% -% where options_dict is a dictionary with the following entries : -% -% Key Type Description -% Path string Absolute path to font file, or relative path to font file from -% the GS_EXTFONTPATH value. -% CIDFontType interger PostScript type for this CID font. Only 0 is currently allowed. -% Note that this is unrelated to the real type of the font file - -% the bridge will perform format conversion. -% FAPI name Name of the renderer to be used with the font. Only /UFST is now allowed. -% SubfontId integer (optional) Index of the font in font collection, such as FCO or TTC. -% It is being ignored if /Path doesn't specify a collection. -% Default value is 0. -% CSI array Must have strongly 2 elements. -% The first element of the array specifies Ordering of CIDSystemInfo. -% The second element specifies Supplement of CIDSystemInfo. -% -% Use regular Postscript syntax. -% -% Examples : -% -% /Ryumin-Medium << /Path (msgothic.ttc) /CIDFontType 0 /FAPI /UFST /CSI [(Japan1) 2] >> ; -% /HeiseiKakuGo-W5 << /Path (F:/WIN2000/Fonts/BATANG.TTC) /CIDFontType 0 /FAPI /UFST /CSI [(Japan1) 2] >> ; - +%! +% $Id: FAPIcidfmap 6826 2006-05-31 15:29:52Z leonardo $ +% This is a sample map file for FAPI CID fonts. + +% +% The map is a set of records like this : +% +% /CIDfont_name options_dict ; +% +% where options_dict is a dictionary with the following entries : +% +% Key Type Description +% Path string Absolute path to font file, or relative path to font file from +% the GS_EXTFONTPATH value. +% CIDFontType interger PostScript type for this CID font. Only 0 is currently allowed. +% Note that this is unrelated to the real type of the font file - +% the bridge will perform format conversion. +% FAPI name Name of the renderer to be used with the font. Only /UFST is now allowed. +% SubfontId integer (optional) Index of the font in font collection, such as FCO or TTC. +% It is being ignored if /Path doesn't specify a collection. +% Default value is 0. +% CSI array Must have strongly 2 elements. +% The first element of the array specifies Ordering of CIDSystemInfo. +% The second element specifies Supplement of CIDSystemInfo. +% +% Use regular Postscript syntax. +% +% Examples : +% +% /Ryumin-Medium << /Path (msgothic.ttc) /CIDFontType 0 /FAPI /UFST /CSI [(Japan1) 2] >> ; +% /HeiseiKakuGo-W5 << /Path (F:/WIN2000/Fonts/BATANG.TTC) /CIDFontType 0 /FAPI /UFST /CSI [(Japan1) 2] >> ; + diff --git a/Master/tlpkg/tlgs/lib/FAPIconfig b/Master/tlpkg/tlgs/lib/FAPIconfig old mode 100755 new mode 100644 index c4e2d781d7c..c539b9266d7 --- a/Master/tlpkg/tlgs/lib/FAPIconfig +++ b/Master/tlpkg/tlgs/lib/FAPIconfig @@ -1,14 +1,14 @@ -%! -% $Id: FAPIconfig 6870 2006-06-20 16:31:15Z leonardo $ -% This is configuration file for FAPI client. - -/FontPath (/Fonts) % A default directory for FAPI-handled font files path in FAPIfontmap. -/CIDFontPath (/CIDFonts) % A default directory for FAPI-handled CID font files path in FAPIcidfmap. -/HookDiskFonts [1 2 9 11 42] % FontType values for disk PS fonts to be redirected to FAPI. -/HookEmbeddedFonts [1 2 9 11 42] % FontType values for embedded PS fonts to be redirected to FAPI. - -% Values allowed for HookDiskFonts and HookEmbeddedFonts are 1, 2, 9, 11, 42. -% "Disk fonts" are fonts being installed to Ghostscript with 'lib/Fontmap' or with GS_FONTPATH, -% and CID font resource files. -% "Embedded fonts" are fonts and CID fonts being embedded into a document. - +%! +% $Id: FAPIconfig 6870 2006-06-20 16:31:15Z leonardo $ +% This is configuration file for FAPI client. + +/FontPath (/Fonts) % A default directory for FAPI-handled font files path in FAPIfontmap. +/CIDFontPath (/CIDFonts) % A default directory for FAPI-handled CID font files path in FAPIcidfmap. +/HookDiskFonts [1 2 9 11 42] % FontType values for disk PS fonts to be redirected to FAPI. +/HookEmbeddedFonts [1 2 9 11 42] % FontType values for embedded PS fonts to be redirected to FAPI. + +% Values allowed for HookDiskFonts and HookEmbeddedFonts are 1, 2, 9, 11, 42. +% "Disk fonts" are fonts being installed to Ghostscript with 'lib/Fontmap' or with GS_FONTPATH, +% and CID font resource files. +% "Embedded fonts" are fonts and CID fonts being embedded into a document. + diff --git a/Master/tlpkg/tlgs/lib/FAPIconfig-FCO b/Master/tlpkg/tlgs/lib/FAPIconfig-FCO old mode 100755 new mode 100644 index 2d6966bf850..dcd8ac53bf5 --- a/Master/tlpkg/tlgs/lib/FAPIconfig-FCO +++ b/Master/tlpkg/tlgs/lib/FAPIconfig-FCO @@ -1,14 +1,14 @@ -%! -% $Id: FAPIconfig-FCO 6998 2006-08-18 04:42:11Z ray $ -% This is configuration file for FAPI client. - -/FontPath () % A default directory for FAPI-handled font files path in FAPIfontmap. -/CIDFontPath () % A default directory for FAPI-handled CID font files path in FAPIcidfmap. -/HookDiskFonts [] % FontType values for disk PS fonts to be redirected to FAPI. -/HookEmbeddedFonts [] % FontType values for embedded PS fonts to be redirected to FAPI. - -% Values allowed for HookDiskFonts and HookEmbeddedFonts are 1, 2, 9, 11, 42. -% "Disk fonts" are fonts being installed to Ghostscript with 'lib/Fontmap' or with GS_FONTPATH, -% and CID font resource files. -% "Embedded fonts" are fonts and CID fonts being embedded into a document. - +%! +% $Id: FAPIconfig-FCO 6998 2006-08-18 04:42:11Z ray $ +% This is configuration file for FAPI client. + +/FontPath () % A default directory for FAPI-handled font files path in FAPIfontmap. +/CIDFontPath () % A default directory for FAPI-handled CID font files path in FAPIcidfmap. +/HookDiskFonts [] % FontType values for disk PS fonts to be redirected to FAPI. +/HookEmbeddedFonts [] % FontType values for embedded PS fonts to be redirected to FAPI. + +% Values allowed for HookDiskFonts and HookEmbeddedFonts are 1, 2, 9, 11, 42. +% "Disk fonts" are fonts being installed to Ghostscript with 'lib/Fontmap' or with GS_FONTPATH, +% and CID font resource files. +% "Embedded fonts" are fonts and CID fonts being embedded into a document. + diff --git a/Master/tlpkg/tlgs/lib/FAPIfontmap b/Master/tlpkg/tlgs/lib/FAPIfontmap old mode 100755 new mode 100644 index a3d4ca3f345..0fedcdeaef8 --- a/Master/tlpkg/tlgs/lib/FAPIfontmap +++ b/Master/tlpkg/tlgs/lib/FAPIfontmap @@ -1,33 +1,33 @@ -%! -% $Id: FAPIfontmap 6870 2006-06-20 16:31:15Z leonardo $ -% This is a sample map file for FAPI fonts. - -% -% The map is a set of records like this : -% -% /font_name options_dict ; -% -% where options_dict is a dictionary with the following entries : -% -% Key Type Description -% Path string Absolute path to font file, or relative path to font file from -% the GS_EXTFONTPATH value. -% FontType interger PostScript type for this font. Only 1 and 42 are currently allowed. -% Note that this is unrelated to the real type of the font file - -% the bridge will perform format conversion. -% FAPI name Name of the renderer to be used with the font. Only /AgfaUFST is now allowed. -% SubfontId integer (optional) Index of the font in font collection, such as FCO or TTC. -% It is being ignored if /Path doesn't specify a collection. -% Default value is 0. -% Decoding name (optional) The name of a Decoding resource to be used with the font. -% If specified, "xlatmap" doesn't work for this font. -% -% Use regular Postscript syntax. -% -% Examples : -% -% /ArialTT << /Path (arial.ttf) /FontType 1 /FAPI /UFST >> ; -% /CourierTT << /Path (F:/WIN2000/Fonts/cour.ttf) /FontType 1 /FAPI /UFST >> ; -% /FCO1 << /Path (F:/AFPL/ufst/fontdata/MTFONTS/PCLPS3/MT1/PCLP3__G.FCO) /FontType 42 /FAPI /UFST /SubfontId 10 >> ; -% - +%! +% $Id: FAPIfontmap 6870 2006-06-20 16:31:15Z leonardo $ +% This is a sample map file for FAPI fonts. + +% +% The map is a set of records like this : +% +% /font_name options_dict ; +% +% where options_dict is a dictionary with the following entries : +% +% Key Type Description +% Path string Absolute path to font file, or relative path to font file from +% the GS_EXTFONTPATH value. +% FontType interger PostScript type for this font. Only 1 and 42 are currently allowed. +% Note that this is unrelated to the real type of the font file - +% the bridge will perform format conversion. +% FAPI name Name of the renderer to be used with the font. Only /AgfaUFST is now allowed. +% SubfontId integer (optional) Index of the font in font collection, such as FCO or TTC. +% It is being ignored if /Path doesn't specify a collection. +% Default value is 0. +% Decoding name (optional) The name of a Decoding resource to be used with the font. +% If specified, "xlatmap" doesn't work for this font. +% +% Use regular Postscript syntax. +% +% Examples : +% +% /ArialTT << /Path (arial.ttf) /FontType 1 /FAPI /UFST >> ; +% /CourierTT << /Path (F:/WIN2000/Fonts/cour.ttf) /FontType 1 /FAPI /UFST >> ; +% /FCO1 << /Path (F:/AFPL/ufst/fontdata/MTFONTS/PCLPS3/MT1/PCLP3__G.FCO) /FontType 42 /FAPI /UFST /SubfontId 10 >> ; +% + diff --git a/Master/tlpkg/tlgs/lib/FCOfontmap-PCLPS3 b/Master/tlpkg/tlgs/lib/FCOfontmap-PCLPS3 old mode 100755 new mode 100644 index f84fb72417d..08b75282c37 --- a/Master/tlpkg/tlgs/lib/FCOfontmap-PCLPS3 +++ b/Master/tlpkg/tlgs/lib/FCOfontmap-PCLPS3 @@ -1,198 +1,198 @@ -% Copyright (C) 2001, 2002 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: FCOfontmap-PCLPS3 8269 2007-10-03 17:37:35Z ray $ - -% May add general FAPIfontmap records here like this : -/Wingdings-Regular << /Path FCOfontfile2 /FontType 1 /FAPI /UFST /SubfontId 0 /Encoding /Wingdings /Decoding /FCO_Wingdings>> ; - -% Mapping Postscript fonts to pclp2_xj.fco FCO members : -FCOfontfile ReadFCOfontmap: -0 Albertus-Medium -1 Albertus-ExtraBold -2 AntiqueOlive -3 AntiqueOlive-Italic -4 AntiqueOlive-Bold -5 Arial -6 Arial-Italic -7 Arial-Bold -8 Arial-BoldItalic -9 Clarendon-Condensed-Bold -10 Coronet -11 CourierHP -12 CourierHP-Italic -13 CourierHP-Bold -14 CourierHP-BoldItalic -15 Garamond-Antiqua -16 Garamond-Kursiv -17 Garamond-Halbfett -18 Garamond-KursivHalbfett -19 LetterGothic -20 LetterGothic-Italic -21 LetterGothic-Bold -22 Marigold -23 CGOmega -24 CGOmega-Italic -25 CGOmega-Bold -26 CGOmega-BoldItalic -27 SymbolMT SymbolEncoding FCO_Symbol -28 CGTimes -29 CGTimes-Italic -30 CGTimes-Bold -31 CGTimes-BoldItalic -32 TimesNewRoman -33 TimesNewRoman-Italic -34 TimesNewRoman-Bold -35 TimesNewRoman-BoldItalic -36 Univers-Medium -37 Univers-MediumItalic -38 Univers-Bold -39 Univers-BoldItalic -40 Univers-Condensed-Medium -41 Univers-Condensed-MediumItalic -42 Univers-Condensed-Bold -43 Univers-Condensed-BoldItalic -44 Courier -45 Courier-Italic -46 Courier-Bold -47 Courier-BoldItalic -48 AlbertusMT-Light -49 AlbertusMT -50 AlbertusMT-Italic -51 AntiqueOlive-Roman -52 AntiqueOlive-Italic -53 AntiqueOlive-Bold -54 AntiqueOlive-Compact -55 AvantGarde-Book -56 AvantGarde-BookOblique -57 AvantGarde-Demi -58 AvantGarde-DemiOblique -59 Bodoni -60 Bodoni-Italic -61 Bodoni-Bold -62 Bodoni-BoldItalic -63 Bodoni-Poster -64 Bodoni-PosterCompressed -65 Bookman-Light -66 Bookman-LightItalic -67 Bookman-Demi -68 Bookman-DemiItalic -69 Candid -70 Apple-Chancery -71 Chicago -72 Clarendon-Light -73 Clarendon -74 Clarendon-Bold -75 CooperBlack -76 CooperBlack-Italic -77 Copperplate-ThirtyTwoBC -78 Copperplate-ThirtyThreeBC -79 Coronet-Regular -80 Courier -81 Courier-Oblique -82 Courier-Bold -83 Courier-BoldOblique -84 Eurostile -85 Eurostile-Bold -86 Eurostile-ExtendedTwo -87 Eurostile-BoldExtendedTwo -88 StempelGaramond-Roman -89 StempelGaramond-Italic -90 StempelGaramond-Bold -91 StempelGaramond-BoldItalic -92 Geneva -93 GillSans-Light -94 GillSans-LightItalic -95 GillSans -96 GillSans-Italic -97 GillSans-Bold -98 GillSans-BoldItalic -99 GillSans-ExtraBold -100 GillSans-Condensed -101 GillSans-BoldCondensed -102 Goudy -103 Goudy-Italic -104 Goudy-Bold -105 Goudy-BoldItalic -106 Goudy-ExtraBold -107 Helvetica-Condensed -108 Helvetica-Condensed-Oblique -109 Helvetica-Condensed-Bold -110 Helvetica-Condensed-BoldObl -111 Helvetica -112 Helvetica-Oblique -113 Helvetica-Bold -114 Helvetica-BoldOblique -115 Helvetica-Narrow -116 Helvetica-Narrow-Oblique -117 Helvetica-Narrow-Bold -118 Helvetica-Narrow-BoldOblique -119 HoeflerText-Regular -120 HoeflerText-Italic -121 HoeflerText-Black -122 HoeflerText-BlackItalic -123 HoeflerText-Ornaments -124 JoannaMT -125 JoannaMT-Italic -126 JoannaMT-Bold -127 JoannaMT-BoldItalic -128 LetterGothic -129 LetterGothic-Slanted -130 LetterGothic-Bold -131 LetterGothic-BoldSlanted -132 LubalinGraph-Book -133 LubalinGraph-BookOblique -134 LubalinGraph-Demi -135 LubalinGraph-DemiOblique -136 Monaco -137 MonaLisa-Recut -138 NewYork -139 NewCenturySchlbk-Roman -140 NewCenturySchlbk-Italic -141 NewCenturySchlbk-Bold -142 NewCenturySchlbk-BoldItalic -143 Optima -144 Optima-Italic -145 Optima-Bold -146 Optima-BoldItalic -147 Oxford -148 Palatino-Roman -149 Palatino-Italic -150 Palatino-Bold -151 Palatino-BoldItalic -152 Symbol SymbolEncoding FCO_Symbol -153 Taffy -154 Times-Roman -155 Times-Italic -156 Times-Bold -157 Times-BoldItalic -158 Univers -159 Univers-Oblique -160 Univers-Bold -161 Univers-BoldOblique -162 Univers-Condensed -163 Univers-CondensedOblique -164 Univers-CondensedBold -165 Univers-CondensedBoldOblique -166 Univers-Light -167 Univers-LightOblique -168 Univers-Extended -169 Univers-ExtendedObl -170 Univers-BoldExt -171 Univers-BoldExtObl -172 ZapfChancery-MediumItalic -173 ZapfDingbats DingbatsEncoding FCO_Dingbats -EndFCOfontmap -%EOF +% Copyright (C) 2001, 2002 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: FCOfontmap-PCLPS3 8269 2007-10-03 17:37:35Z ray $ + +% May add general FAPIfontmap records here like this : +/Wingdings-Regular << /Path FCOfontfile2 /FontType 1 /FAPI /UFST /SubfontId 0 /Encoding /Wingdings /Decoding /FCO_Wingdings>> ; + +% Mapping Postscript fonts to pclp2_xj.fco FCO members : +FCOfontfile ReadFCOfontmap: +0 Albertus-Medium +1 Albertus-ExtraBold +2 AntiqueOlive +3 AntiqueOlive-Italic +4 AntiqueOlive-Bold +5 Arial +6 Arial-Italic +7 Arial-Bold +8 Arial-BoldItalic +9 Clarendon-Condensed-Bold +10 Coronet +11 CourierHP +12 CourierHP-Italic +13 CourierHP-Bold +14 CourierHP-BoldItalic +15 Garamond-Antiqua +16 Garamond-Kursiv +17 Garamond-Halbfett +18 Garamond-KursivHalbfett +19 LetterGothic +20 LetterGothic-Italic +21 LetterGothic-Bold +22 Marigold +23 CGOmega +24 CGOmega-Italic +25 CGOmega-Bold +26 CGOmega-BoldItalic +27 SymbolMT SymbolEncoding FCO_Symbol +28 CGTimes +29 CGTimes-Italic +30 CGTimes-Bold +31 CGTimes-BoldItalic +32 TimesNewRoman +33 TimesNewRoman-Italic +34 TimesNewRoman-Bold +35 TimesNewRoman-BoldItalic +36 Univers-Medium +37 Univers-MediumItalic +38 Univers-Bold +39 Univers-BoldItalic +40 Univers-Condensed-Medium +41 Univers-Condensed-MediumItalic +42 Univers-Condensed-Bold +43 Univers-Condensed-BoldItalic +44 Courier +45 Courier-Italic +46 Courier-Bold +47 Courier-BoldItalic +48 AlbertusMT-Light +49 AlbertusMT +50 AlbertusMT-Italic +51 AntiqueOlive-Roman +52 AntiqueOlive-Italic +53 AntiqueOlive-Bold +54 AntiqueOlive-Compact +55 AvantGarde-Book +56 AvantGarde-BookOblique +57 AvantGarde-Demi +58 AvantGarde-DemiOblique +59 Bodoni +60 Bodoni-Italic +61 Bodoni-Bold +62 Bodoni-BoldItalic +63 Bodoni-Poster +64 Bodoni-PosterCompressed +65 Bookman-Light +66 Bookman-LightItalic +67 Bookman-Demi +68 Bookman-DemiItalic +69 Candid +70 Apple-Chancery +71 Chicago +72 Clarendon-Light +73 Clarendon +74 Clarendon-Bold +75 CooperBlack +76 CooperBlack-Italic +77 Copperplate-ThirtyTwoBC +78 Copperplate-ThirtyThreeBC +79 Coronet-Regular +80 Courier +81 Courier-Oblique +82 Courier-Bold +83 Courier-BoldOblique +84 Eurostile +85 Eurostile-Bold +86 Eurostile-ExtendedTwo +87 Eurostile-BoldExtendedTwo +88 StempelGaramond-Roman +89 StempelGaramond-Italic +90 StempelGaramond-Bold +91 StempelGaramond-BoldItalic +92 Geneva +93 GillSans-Light +94 GillSans-LightItalic +95 GillSans +96 GillSans-Italic +97 GillSans-Bold +98 GillSans-BoldItalic +99 GillSans-ExtraBold +100 GillSans-Condensed +101 GillSans-BoldCondensed +102 Goudy +103 Goudy-Italic +104 Goudy-Bold +105 Goudy-BoldItalic +106 Goudy-ExtraBold +107 Helvetica-Condensed +108 Helvetica-Condensed-Oblique +109 Helvetica-Condensed-Bold +110 Helvetica-Condensed-BoldObl +111 Helvetica +112 Helvetica-Oblique +113 Helvetica-Bold +114 Helvetica-BoldOblique +115 Helvetica-Narrow +116 Helvetica-Narrow-Oblique +117 Helvetica-Narrow-Bold +118 Helvetica-Narrow-BoldOblique +119 HoeflerText-Regular +120 HoeflerText-Italic +121 HoeflerText-Black +122 HoeflerText-BlackItalic +123 HoeflerText-Ornaments +124 JoannaMT +125 JoannaMT-Italic +126 JoannaMT-Bold +127 JoannaMT-BoldItalic +128 LetterGothic +129 LetterGothic-Slanted +130 LetterGothic-Bold +131 LetterGothic-BoldSlanted +132 LubalinGraph-Book +133 LubalinGraph-BookOblique +134 LubalinGraph-Demi +135 LubalinGraph-DemiOblique +136 Monaco +137 MonaLisa-Recut +138 NewYork +139 NewCenturySchlbk-Roman +140 NewCenturySchlbk-Italic +141 NewCenturySchlbk-Bold +142 NewCenturySchlbk-BoldItalic +143 Optima +144 Optima-Italic +145 Optima-Bold +146 Optima-BoldItalic +147 Oxford +148 Palatino-Roman +149 Palatino-Italic +150 Palatino-Bold +151 Palatino-BoldItalic +152 Symbol SymbolEncoding FCO_Symbol +153 Taffy +154 Times-Roman +155 Times-Italic +156 Times-Bold +157 Times-BoldItalic +158 Univers +159 Univers-Oblique +160 Univers-Bold +161 Univers-BoldOblique +162 Univers-Condensed +163 Univers-CondensedOblique +164 Univers-CondensedBold +165 Univers-CondensedBoldOblique +166 Univers-Light +167 Univers-LightOblique +168 Univers-Extended +169 Univers-ExtendedObl +170 Univers-BoldExt +171 Univers-BoldExtObl +172 ZapfChancery-MediumItalic +173 ZapfDingbats DingbatsEncoding FCO_Dingbats +EndFCOfontmap +%EOF diff --git a/Master/tlpkg/tlgs/lib/FCOfontmap-PS3 b/Master/tlpkg/tlgs/lib/FCOfontmap-PS3 old mode 100755 new mode 100644 index ec5f91e3747..c543f072284 --- a/Master/tlpkg/tlgs/lib/FCOfontmap-PS3 +++ b/Master/tlpkg/tlgs/lib/FCOfontmap-PS3 @@ -1,159 +1,159 @@ -% Copyright (C) 2001, 2002 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: FCOfontmap-PS3 8269 2007-10-03 17:37:35Z ray $ - -% May add general FAPIfontmap records here like this : -/Wingdings-Regular << /Path FCOfontfile2 /FontType 1 /FAPI /UFST /SubfontId 0 /Encoding /Wingdings /Decoding /FCO_Wingdings>> ; - -% Mapping Postscript fonts to ps3___xh.fco FCO members : -FCOfontfile ReadFCOfontmap: -0 AlbertusMT-Light -1 AlbertusMT -2 AlbertusMT-Italic -3 AntiqueOlive-Roman -4 AntiqueOlive-Italic -5 AntiqueOlive-Bold -6 AntiqueOlive-Compact -7 ArialMT -8 Arial-ItalicMT -9 Arial-BoldMT -10 Arial-BoldItalicMT -11 AvantGarde-Book -12 AvantGarde-BookOblique -13 AvantGarde-Demi -14 AvantGarde-DemiOblique -15 Bodoni -16 Bodoni-Italic -17 Bodoni-Bold -18 Bodoni-BoldItalic -19 Bodoni-Poster -20 Bodoni-PosterCompressed -21 Bookman-Light -22 Bookman-LightItalic -23 Bookman-Demi -24 Bookman-DemiItalic -% 25 Candid % Disabled due to unknown glyph names. -26 Apple-Chancery -27 Chicago -28 Clarendon-Light -29 Clarendon -30 Clarendon-Bold -31 CooperBlack -32 CooperBlack-Italic -33 Copperplate-ThirtyTwoBC -34 Copperplate-ThirtyThreeBC -35 Coronet-Regular -36 Courier -37 Courier-Oblique -38 Courier-Bold -39 Courier-BoldOblique -40 Eurostile -41 Eurostile-Bold -42 Eurostile-ExtendedTwo -43 Eurostile-BoldExtendedTwo -44 StempelGaramond-Roman -45 StempelGaramond-Italic -46 StempelGaramond-Bold -47 StempelGaramond-BoldItalic -48 Geneva -49 GillSans-Light -50 GillSans-LightItalic -51 GillSans -52 GillSans-Italic -53 GillSans-Bold -54 GillSans-BoldItalic -55 GillSans-ExtraBold -56 GillSans-Condensed -57 GillSans-BoldCondensed -58 Goudy -59 Goudy-Italic -60 Goudy-Bold -61 Goudy-BoldItalic -62 Goudy-ExtraBold -63 Helvetica-Condensed -64 Helvetica-Condensed-Oblique -65 Helvetica-Condensed-Bold -66 Helvetica-Condensed-BoldObl -67 Helvetica -68 Helvetica-Oblique -69 Helvetica-Bold -70 Helvetica-BoldOblique -71 Helvetica-Narrow -72 Helvetica-Narrow-Oblique -73 Helvetica-Narrow-Bold -74 Helvetica-Narrow-BdOblique -75 HoeflerText-Regular -76 HoeflerText-Italic -77 HoeflerText-Black -78 HoeflerText-BlackItalic -79 HoeflerText-Ornaments -80 JoannaMT -81 JoannaMT-Italic -82 JoannaMT-Bold -83 JoannaMT-BoldItalic -84 LetterGothic -85 LetterGothic-Slanted -86 LetterGothic-Bold -87 LetterGothic-BoldSlanted -88 LubalinGraph-Book -89 LubalinGraph-BookOblique -90 LubalinGraph-Demi -91 LubalinGraph-DemiOblique -92 Marigold -93 Monaco -94 MonaLisa-Recut -95 NewYork -96 NewCenturySchlbk-Roman -97 NewCenturySchlbk-Italic -98 NewCenturySchlbk-Bold -99 NewCenturySchlbk-BoldItalic -100 Optima -101 Optima-Italic -102 Optima-Bold -103 Optima-BoldItalic -104 Oxford -105 Palatino-Roman -106 Palatino-Italic -107 Palatino-Bold -108 Palatino-BoldItalic -109 Symbol SymbolEncoding FCO_Symbol -110 Taffy -111 Times-Roman -112 Times-Italic -113 Times-Bold -114 Times-BoldItalic -115 TimesNewRomanPSMT -116 TimesNewRomanPS-ItalicMT -117 TimesNewRomanPS-BoldMT -118 TimesNewRomanPS-BdItMT -119 Univers -120 Univers-Oblique -121 Univers-Bold -122 Univers-BoldOblique -123 Univers-Condensed -124 Univers-CondensedOblique -125 Univers-CondensedBold -126 Univers-CondensedBdOblique -127 Univers-Light -128 Univers-LightOblique -129 Univers-Extended -130 Univers-ExtendedObl -131 Univers-BoldExt -132 Univers-BoldExtObl -133 ZapfChancery-MediumItalic -134 ZapfDingbats DingbatsEncoding FCO_Dingbats -EndFCOfontmap -%EOF +% Copyright (C) 2001, 2002 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: FCOfontmap-PS3 8269 2007-10-03 17:37:35Z ray $ + +% May add general FAPIfontmap records here like this : +/Wingdings-Regular << /Path FCOfontfile2 /FontType 1 /FAPI /UFST /SubfontId 0 /Encoding /Wingdings /Decoding /FCO_Wingdings>> ; + +% Mapping Postscript fonts to ps3___xh.fco FCO members : +FCOfontfile ReadFCOfontmap: +0 AlbertusMT-Light +1 AlbertusMT +2 AlbertusMT-Italic +3 AntiqueOlive-Roman +4 AntiqueOlive-Italic +5 AntiqueOlive-Bold +6 AntiqueOlive-Compact +7 ArialMT +8 Arial-ItalicMT +9 Arial-BoldMT +10 Arial-BoldItalicMT +11 AvantGarde-Book +12 AvantGarde-BookOblique +13 AvantGarde-Demi +14 AvantGarde-DemiOblique +15 Bodoni +16 Bodoni-Italic +17 Bodoni-Bold +18 Bodoni-BoldItalic +19 Bodoni-Poster +20 Bodoni-PosterCompressed +21 Bookman-Light +22 Bookman-LightItalic +23 Bookman-Demi +24 Bookman-DemiItalic +% 25 Candid % Disabled due to unknown glyph names. +26 Apple-Chancery +27 Chicago +28 Clarendon-Light +29 Clarendon +30 Clarendon-Bold +31 CooperBlack +32 CooperBlack-Italic +33 Copperplate-ThirtyTwoBC +34 Copperplate-ThirtyThreeBC +35 Coronet-Regular +36 Courier +37 Courier-Oblique +38 Courier-Bold +39 Courier-BoldOblique +40 Eurostile +41 Eurostile-Bold +42 Eurostile-ExtendedTwo +43 Eurostile-BoldExtendedTwo +44 StempelGaramond-Roman +45 StempelGaramond-Italic +46 StempelGaramond-Bold +47 StempelGaramond-BoldItalic +48 Geneva +49 GillSans-Light +50 GillSans-LightItalic +51 GillSans +52 GillSans-Italic +53 GillSans-Bold +54 GillSans-BoldItalic +55 GillSans-ExtraBold +56 GillSans-Condensed +57 GillSans-BoldCondensed +58 Goudy +59 Goudy-Italic +60 Goudy-Bold +61 Goudy-BoldItalic +62 Goudy-ExtraBold +63 Helvetica-Condensed +64 Helvetica-Condensed-Oblique +65 Helvetica-Condensed-Bold +66 Helvetica-Condensed-BoldObl +67 Helvetica +68 Helvetica-Oblique +69 Helvetica-Bold +70 Helvetica-BoldOblique +71 Helvetica-Narrow +72 Helvetica-Narrow-Oblique +73 Helvetica-Narrow-Bold +74 Helvetica-Narrow-BdOblique +75 HoeflerText-Regular +76 HoeflerText-Italic +77 HoeflerText-Black +78 HoeflerText-BlackItalic +79 HoeflerText-Ornaments +80 JoannaMT +81 JoannaMT-Italic +82 JoannaMT-Bold +83 JoannaMT-BoldItalic +84 LetterGothic +85 LetterGothic-Slanted +86 LetterGothic-Bold +87 LetterGothic-BoldSlanted +88 LubalinGraph-Book +89 LubalinGraph-BookOblique +90 LubalinGraph-Demi +91 LubalinGraph-DemiOblique +92 Marigold +93 Monaco +94 MonaLisa-Recut +95 NewYork +96 NewCenturySchlbk-Roman +97 NewCenturySchlbk-Italic +98 NewCenturySchlbk-Bold +99 NewCenturySchlbk-BoldItalic +100 Optima +101 Optima-Italic +102 Optima-Bold +103 Optima-BoldItalic +104 Oxford +105 Palatino-Roman +106 Palatino-Italic +107 Palatino-Bold +108 Palatino-BoldItalic +109 Symbol SymbolEncoding FCO_Symbol +110 Taffy +111 Times-Roman +112 Times-Italic +113 Times-Bold +114 Times-BoldItalic +115 TimesNewRomanPSMT +116 TimesNewRomanPS-ItalicMT +117 TimesNewRomanPS-BoldMT +118 TimesNewRomanPS-BdItMT +119 Univers +120 Univers-Oblique +121 Univers-Bold +122 Univers-BoldOblique +123 Univers-Condensed +124 Univers-CondensedOblique +125 Univers-CondensedBold +126 Univers-CondensedBdOblique +127 Univers-Light +128 Univers-LightOblique +129 Univers-Extended +130 Univers-ExtendedObl +131 Univers-BoldExt +132 Univers-BoldExtObl +133 ZapfChancery-MediumItalic +134 ZapfDingbats DingbatsEncoding FCO_Dingbats +EndFCOfontmap +%EOF diff --git a/Master/tlpkg/tlgs/lib/PDFA_def.ps b/Master/tlpkg/tlgs/lib/PDFA_def.ps old mode 100755 new mode 100644 index a0ba5f0e4d8..e351f76cc6b --- a/Master/tlpkg/tlgs/lib/PDFA_def.ps +++ b/Master/tlpkg/tlgs/lib/PDFA_def.ps @@ -1,43 +1,43 @@ -%! -% $Id: PDFA_def.ps 8284 2007-10-10 17:40:38Z giles $ -% This is a sample prefix file for creating a PDF/A document. -% Feel free to modify entries marked with "Customize". - -% This assumes an ICC profile to reside in the file (ISO Coated sb.icc), -% unless the user modifies the corresponding line below. - - -systemdict /ProcessColorModel known { - systemdict /ProcessColorModel get dup /DeviceGray ne exch /DeviceCMYK ne and -} { - true -} ifelse -{ (ERROR: ProcessColorModel must be /DeviceGray or DeviceCMYK.)= - /ProcessColorModel cvx /rangecheck signalerror -} if - - -% Define entries to the document Info dictionary : - -/ICCProfile (ISO Coated sb.icc) % Customize. -def - -[ /Title (Title) % Customize. - /DOCINFO pdfmark - -% Define an ICC profile : - -[/_objdef {icc_PDFA} /type /stream /OBJ pdfmark -[{icc_PDFA} <> /PUT pdfmark -[{icc_PDFA} ICCProfile (r) file /PUT pdfmark - -% Define the output intent dictionary : - -[/_objdef {OutputIntent_PDFA} /type /dict /OBJ pdfmark -[{OutputIntent_PDFA} << - /Type /OutputIntent % Must be so (the standard requires). - /S /GTS_PDFA1 % Must be so (the standard requires). - /DestOutputProfile {icc_PDFA} % Must be so (see above). - /OutputConditionIdentifier (CGATS TR001) % Customize ->> /PUT pdfmark -[{Catalog} <> /PUT pdfmark +%! +% $Id: PDFA_def.ps 8284 2007-10-10 17:40:38Z giles $ +% This is a sample prefix file for creating a PDF/A document. +% Feel free to modify entries marked with "Customize". + +% This assumes an ICC profile to reside in the file (ISO Coated sb.icc), +% unless the user modifies the corresponding line below. + + +systemdict /ProcessColorModel known { + systemdict /ProcessColorModel get dup /DeviceGray ne exch /DeviceCMYK ne and +} { + true +} ifelse +{ (ERROR: ProcessColorModel must be /DeviceGray or DeviceCMYK.)= + /ProcessColorModel cvx /rangecheck signalerror +} if + + +% Define entries to the document Info dictionary : + +/ICCProfile (ISO Coated sb.icc) % Customize. +def + +[ /Title (Title) % Customize. + /DOCINFO pdfmark + +% Define an ICC profile : + +[/_objdef {icc_PDFA} /type /stream /OBJ pdfmark +[{icc_PDFA} <> /PUT pdfmark +[{icc_PDFA} ICCProfile (r) file /PUT pdfmark + +% Define the output intent dictionary : + +[/_objdef {OutputIntent_PDFA} /type /dict /OBJ pdfmark +[{OutputIntent_PDFA} << + /Type /OutputIntent % Must be so (the standard requires). + /S /GTS_PDFA1 % Must be so (the standard requires). + /DestOutputProfile {icc_PDFA} % Must be so (see above). + /OutputConditionIdentifier (CGATS TR001) % Customize +>> /PUT pdfmark +[{Catalog} <> /PUT pdfmark diff --git a/Master/tlpkg/tlgs/lib/PDFX_def.ps b/Master/tlpkg/tlgs/lib/PDFX_def.ps old mode 100755 new mode 100644 index 615b66c9732..e276663848b --- a/Master/tlpkg/tlgs/lib/PDFX_def.ps +++ b/Master/tlpkg/tlgs/lib/PDFX_def.ps @@ -1,51 +1,51 @@ -%! -% $Id: PDFX_def.ps 8284 2007-10-10 17:40:38Z giles $ -% This is a sample prefix file for creating a PDF/X-3 document. -% Feel free to modify entries marked with "Customize". - -% This assumes an ICC profile to reside in the file (ISO Coated sb.icc), -% unless the user modifies the corresponding line below. - - -systemdict /ProcessColorModel known { - systemdict /ProcessColorModel get dup /DeviceGray ne exch /DeviceCMYK ne and -} { - true -} ifelse -{ (ERROR: ProcessColorModel must be /DeviceGray or DeviceCMYK.)= - /ProcessColorModel cvx /rangecheck signalerror -} if - - -% Define entries to the document Info dictionary : - -/ICCProfile (ISO Coated sb.icc) def % Customize or remove. - -[ /GTS_PDFXVersion (PDF/X-3:2002) % Must be so (the standard requires). - /Title (Title) % Customize. - /Trapped /False % Must be so (Ghostscript doesn't provide other). - /DOCINFO pdfmark - -% Define an ICC profile : - -currentdict /ICCProfile known { - [/_objdef {icc_PDFX} /type /stream /OBJ pdfmark - [{icc_PDFX} <> /PUT pdfmark - [{icc_PDFX} ICCProfile (r) file /PUT pdfmark -} if - -% Define the output intent dictionary : - -[/_objdef {OutputIntent_PDFX} /type /dict /OBJ pdfmark -[{OutputIntent_PDFX} << - /Type /OutputIntent % Must be so (the standard requires). - /S /GTS_PDFX % Must be so (the standard requires). - /OutputCondition (Commercial and specialty printing) % Customize - /Info (none) % Customize - /OutputConditionIdentifier (CGATS TR001) % Customize - /RegistryName (http://www.color.org) % Must be so (the standard requires). - currentdict /ICCProfile known { - /DestOutputProfile {icc_PDFX} % Must be so (see above). - } if ->> /PUT pdfmark -[{Catalog} <> /PUT pdfmark +%! +% $Id: PDFX_def.ps 8284 2007-10-10 17:40:38Z giles $ +% This is a sample prefix file for creating a PDF/X-3 document. +% Feel free to modify entries marked with "Customize". + +% This assumes an ICC profile to reside in the file (ISO Coated sb.icc), +% unless the user modifies the corresponding line below. + + +systemdict /ProcessColorModel known { + systemdict /ProcessColorModel get dup /DeviceGray ne exch /DeviceCMYK ne and +} { + true +} ifelse +{ (ERROR: ProcessColorModel must be /DeviceGray or DeviceCMYK.)= + /ProcessColorModel cvx /rangecheck signalerror +} if + + +% Define entries to the document Info dictionary : + +/ICCProfile (ISO Coated sb.icc) def % Customize or remove. + +[ /GTS_PDFXVersion (PDF/X-3:2002) % Must be so (the standard requires). + /Title (Title) % Customize. + /Trapped /False % Must be so (Ghostscript doesn't provide other). + /DOCINFO pdfmark + +% Define an ICC profile : + +currentdict /ICCProfile known { + [/_objdef {icc_PDFX} /type /stream /OBJ pdfmark + [{icc_PDFX} <> /PUT pdfmark + [{icc_PDFX} ICCProfile (r) file /PUT pdfmark +} if + +% Define the output intent dictionary : + +[/_objdef {OutputIntent_PDFX} /type /dict /OBJ pdfmark +[{OutputIntent_PDFX} << + /Type /OutputIntent % Must be so (the standard requires). + /S /GTS_PDFX % Must be so (the standard requires). + /OutputCondition (Commercial and specialty printing) % Customize + /Info (none) % Customize + /OutputConditionIdentifier (CGATS TR001) % Customize + /RegistryName (http://www.color.org) % Must be so (the standard requires). + currentdict /ICCProfile known { + /DestOutputProfile {icc_PDFX} % Must be so (see above). + } if +>> /PUT pdfmark +[{Catalog} <> /PUT pdfmark diff --git a/Master/tlpkg/tlgs/lib/acctest.ps b/Master/tlpkg/tlgs/lib/acctest.ps old mode 100755 new mode 100644 index de4c10af316..bd5f7142923 --- a/Master/tlpkg/tlgs/lib/acctest.ps +++ b/Master/tlpkg/tlgs/lib/acctest.ps @@ -1,100 +1,100 @@ -%! -% Check that operators do their access tests correctly. -% $Id: acctest.ps 6300 2005-12-28 19:56:24Z giles $ - -% proc dotest => . -/dotest - { - dup - mark - exch - stopped not % False if error, true if no error. - { (Allowed access: ) print cleartomark == } - if - clear - } -def - -0 0 moveto % So the show commands don't bomb because of nocurrentpoint. - -{ [1 2] executeonly aload } dotest -{ (string) executeonly (seek) anchorsearch } dotest -{ (string) (seek) executeonly anchorsearch } dotest -{ 100 101 (string) noaccess ashow} dotest -{ 100 1 array readonly astore } dotest -{ 100 101 102 103 104 (string) noaccess awidthshow } dotest -{ 1 dict noacess begin } dotest -{ 1 array executeonly 1 array copy } dotest -{ 1 array 1 array readonly copy } dotest -{ 1 dict noaccess 1 dict copy } dotest -{ 1 dict 1 dict readonly copy } dotest -{ 1 string executeonly 1 string copy } dotest -{ 1 string 1 string readonly copy } dotest -{ (100) executeonly cvi } dotest -{ (string) executeonly cvn } dotest -{ (100.001) executeonly cvr } dotest -{ 1 10 1 string readonly cvrs } dotest -{ true 5 string readonly cvs } dotest -{ 1 dict readonly begin /foo true def } dotest -{ 10 array readonly dictstack } dotest -{ 1 string executeonly 1 string eq } dotest -{ 1 string 1 string executeonly eq } dotest -{ 10 array readonly execstack } dotest -{ 1 string noaccess executeonly } dotest -{ 1 array noaccess executeonly } dotest -{ 1 array executeonly { pop } forall } dotest -{ 1 dict noaccess { pop pop } forall } dotest -{ 1 string executeonly { pop } forall } dotest -{ (string1) executeonly (string2) ge } dotest -{ (string1) (string2) executeonly ge } dotest -{ 1 array executeonly 0 get } dotest -{ 1 dict noaccess /key get } dotest -{ 1 string executeonly 0 get } dotest -{ 1 array executeonly 0 1 getinterval } dotest -{ 1 string executeonly 0 1 getinterval } dotest -{ (string1) executeonly (string2) gt } dotest -{ (string1) (string2) executeonly gt } dotest -{ 1 dict noaccess /key known } dotest -{ {} (string) executeonly kshow } dotest -{ (string1) executeonly (string2) le } dotest -{ (string1) (string2) executeonly le } dotest -{ 1 array executeonly length } dotest -{ 1 dict noaccess length } dotest -{ 1 string executeonly length } dotest -%%{ /foo 1 dict def foo begin /bar foo def bar noaccess pop /key load } dotest -{ (string1) executeonly (string2) lt } dotest -{ (string1) (string2) executeonly lt } dotest -{ 1 dict noaccess maxlength } dotest -{ 1 string executeonly 1 string ne } dotest -{ 1 string 1 string executeonly ne } dotest -%{ newpath 0 0 moveto (a) false charpath -% {} {} {} {} pathforall closepath } dotest -{ 1 array executeonly 0 put } dotest -{ 1 dict noaccess /key put } dotest -{ 1 string executeonly 0 put } dotest -{ 1 array executeonly 0 1 putinterval } dotest -{ 1 string executeonly 0 1 putinterval } dotest -{ (access.ps) (r) file executeonly read } dotest -{ (access.ps) (r) file executeonly 10 string readhexstring } dotest -{ (access.ps) (r) file 10 string readonly readhexstring } dotest -{ (access.ps) (r) file executeonly 100 string readline } dotest -{ (access.ps) (r) file 100 string readonly readline } dotest -{ (access.ps) (r) file executeonly 10 string readstring } dotest -{ (access.ps) (r) file 10 string readonly readstring } dotest -% run does not check for no read access? -{ (string) executeonly (seek) search } dotest -{ (string) (seek) executeonly search } dotest -{ (string) executeonly show } -%% some test for store. -{ (string) executeonly stringwidth } dotest -{ (access.ps) (r) file executeonly token } dotest -{ (10) executeonly token } dotest -{ /foo 1 dict def foo begin /bar foo def bar noaccess pop /key where } dotest -{ 100 101 102 (string) noaccess widthshow } dotest -{ (/tmp/_.ps) noaccess (w) file closefile } dotest -{ (/tmp/_.ps) (w) noaccess file closefile } dotest -{ (/tmp/_.ps) (w) file executeonly 100 write } dotest -{ (/tmp/_.ps) (w) file executeonly 10 string writehexstring } dotest -{ (/tmp/_.ps) (w) file 10 string executeonly writehexstring } dotest -{ (/tmp/_.ps) (w) file executeonly 10 string writestring } dotest -{ (/tmp/_.ps) (w) file 10 string executeonly writestring } dotest +%! +% Check that operators do their access tests correctly. +% $Id: acctest.ps 6300 2005-12-28 19:56:24Z giles $ + +% proc dotest => . +/dotest + { + dup + mark + exch + stopped not % False if error, true if no error. + { (Allowed access: ) print cleartomark == } + if + clear + } +def + +0 0 moveto % So the show commands don't bomb because of nocurrentpoint. + +{ [1 2] executeonly aload } dotest +{ (string) executeonly (seek) anchorsearch } dotest +{ (string) (seek) executeonly anchorsearch } dotest +{ 100 101 (string) noaccess ashow} dotest +{ 100 1 array readonly astore } dotest +{ 100 101 102 103 104 (string) noaccess awidthshow } dotest +{ 1 dict noacess begin } dotest +{ 1 array executeonly 1 array copy } dotest +{ 1 array 1 array readonly copy } dotest +{ 1 dict noaccess 1 dict copy } dotest +{ 1 dict 1 dict readonly copy } dotest +{ 1 string executeonly 1 string copy } dotest +{ 1 string 1 string readonly copy } dotest +{ (100) executeonly cvi } dotest +{ (string) executeonly cvn } dotest +{ (100.001) executeonly cvr } dotest +{ 1 10 1 string readonly cvrs } dotest +{ true 5 string readonly cvs } dotest +{ 1 dict readonly begin /foo true def } dotest +{ 10 array readonly dictstack } dotest +{ 1 string executeonly 1 string eq } dotest +{ 1 string 1 string executeonly eq } dotest +{ 10 array readonly execstack } dotest +{ 1 string noaccess executeonly } dotest +{ 1 array noaccess executeonly } dotest +{ 1 array executeonly { pop } forall } dotest +{ 1 dict noaccess { pop pop } forall } dotest +{ 1 string executeonly { pop } forall } dotest +{ (string1) executeonly (string2) ge } dotest +{ (string1) (string2) executeonly ge } dotest +{ 1 array executeonly 0 get } dotest +{ 1 dict noaccess /key get } dotest +{ 1 string executeonly 0 get } dotest +{ 1 array executeonly 0 1 getinterval } dotest +{ 1 string executeonly 0 1 getinterval } dotest +{ (string1) executeonly (string2) gt } dotest +{ (string1) (string2) executeonly gt } dotest +{ 1 dict noaccess /key known } dotest +{ {} (string) executeonly kshow } dotest +{ (string1) executeonly (string2) le } dotest +{ (string1) (string2) executeonly le } dotest +{ 1 array executeonly length } dotest +{ 1 dict noaccess length } dotest +{ 1 string executeonly length } dotest +%%{ /foo 1 dict def foo begin /bar foo def bar noaccess pop /key load } dotest +{ (string1) executeonly (string2) lt } dotest +{ (string1) (string2) executeonly lt } dotest +{ 1 dict noaccess maxlength } dotest +{ 1 string executeonly 1 string ne } dotest +{ 1 string 1 string executeonly ne } dotest +%{ newpath 0 0 moveto (a) false charpath +% {} {} {} {} pathforall closepath } dotest +{ 1 array executeonly 0 put } dotest +{ 1 dict noaccess /key put } dotest +{ 1 string executeonly 0 put } dotest +{ 1 array executeonly 0 1 putinterval } dotest +{ 1 string executeonly 0 1 putinterval } dotest +{ (access.ps) (r) file executeonly read } dotest +{ (access.ps) (r) file executeonly 10 string readhexstring } dotest +{ (access.ps) (r) file 10 string readonly readhexstring } dotest +{ (access.ps) (r) file executeonly 100 string readline } dotest +{ (access.ps) (r) file 100 string readonly readline } dotest +{ (access.ps) (r) file executeonly 10 string readstring } dotest +{ (access.ps) (r) file 10 string readonly readstring } dotest +% run does not check for no read access? +{ (string) executeonly (seek) search } dotest +{ (string) (seek) executeonly search } dotest +{ (string) executeonly show } +%% some test for store. +{ (string) executeonly stringwidth } dotest +{ (access.ps) (r) file executeonly token } dotest +{ (10) executeonly token } dotest +{ /foo 1 dict def foo begin /bar foo def bar noaccess pop /key where } dotest +{ 100 101 102 (string) noaccess widthshow } dotest +{ (/tmp/_.ps) noaccess (w) file closefile } dotest +{ (/tmp/_.ps) (w) noaccess file closefile } dotest +{ (/tmp/_.ps) (w) file executeonly 100 write } dotest +{ (/tmp/_.ps) (w) file executeonly 10 string writehexstring } dotest +{ (/tmp/_.ps) (w) file 10 string executeonly writehexstring } dotest +{ (/tmp/_.ps) (w) file executeonly 10 string writestring } dotest +{ (/tmp/_.ps) (w) file 10 string executeonly writestring } dotest diff --git a/Master/tlpkg/tlgs/lib/addxchar.ps b/Master/tlpkg/tlgs/lib/addxchar.ps old mode 100755 new mode 100644 index ddfc7e334a5..05668739fa0 --- a/Master/tlpkg/tlgs/lib/addxchar.ps +++ b/Master/tlpkg/tlgs/lib/addxchar.ps @@ -1,357 +1,357 @@ -% Copyright (C) 1999 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: addxchar.ps 6300 2005-12-28 19:56:24Z giles $ -% Add the Central European and other Adobe extended Latin characters to a -% Type 1 font. -% Requires -dWRITESYSTEMDICT to disable access protection. - -(type1ops.ps) runlibfile - -% ---------------- Utilities ---------------- % - -/addce_dict 50 dict def -addce_dict begin - -% Define the added copyright notice. -/addednotice (. Portions Copyright (C) 1999 Aladdin Enterprises.) def - -% Open a font for modification by removing the FID and changing the -% FontName. Removing UniqueID and XUID is not necessary, since we -% will only be adding characters. -/openfont { % openfont - dup length dict copy - dup /FID undef - dup /FontName 3 index put -} def - -% Do the equivalent of false charpath for a glyph. -% This should really be an operator! -/glyphpath { % glyphpath - - currentfont /Encoding get 0 3 -1 roll put - <00> false charpath -} def - -% Do the equivalent of charpath + pathbbox for a glyph. -/glyphbbox { % glyphbbox - % We cache this value, because it's expensive to compute. - BBoxes 1 index .knownget { - exch pop - } { - gsave newpath 0 0 moveto dup glyphpath [pathbbox] grestore - BBoxes 3 -1 roll 2 index put - } ifelse aload pop -} def - -% Get the side bearing and width for a glyph. -/glyphsbw { % glyphsbw - % We cache this value, because it's expensive to compute. - SBW 1 index .knownget { - exch pop - } { - dup glyphcs { dup /hsbw eq { pop exit } if } forall - 2 array astore - SBW 3 -1 roll 2 index put - } ifelse aload pop -} def - -% Get the CharString for a glyph, as an array. -/glyphcs { % glyphcs - CharStrings exch get - 4330 exch dup length string .type1decrypt exch pop - dup length lenIV sub lenIV exch getinterval - 0 () /SubFileDecode filter [ exch charstack_read ] -} def - -% Find an occurrence of a value in an array. -/asearch { % asearch true - % asearch false - false 0 4 2 roll exch { - % Stack: false index value element - 2 copy eq { pop pop exch not exch dup exit } if - exch 1 add exch - } forall pop pop -} def - -% Convert an array back to a CharString. -/csdef { % csdef - - charproc_string - 4330 exch dup .type1encrypt exch pop readonly - CharStrings 3 1 roll put -} def - -% Split an accented character name. -/splitaccented { % splitaccented - dup =string cvs - dup 0 1 getinterval cvn - exch dup length 1 sub 1 exch getinterval cvn -} def - -% Begin the definition of a 'seac' character. -% Defines accent, base, abox, bbox. -% The initial dx lines up the origins of the base and the accent. -/beginseac { % beginseac - % -mark- /hsbw - /accent exch def /base exch def - /abox [accent glyphbbox] def - /bbox [base glyphbbox] def - [ base glyphsbw /hsbw accent glyphsbw pop - dup 4 index sub -} def - -% Center the accent over the base of a 'seac' character. -/centeraccent { % centeraccent - bbox 2 get bbox 0 get add 2 div - abox 2 get abox 0 get add 2 div - sub add -} def - -% Finish the definition of a 'seac' character. -/finishseac { % -mark- ... finishseac - - exch cvi exch cvi - charindex base get charindex accent get /seac ] csdef -} def - -% ---------------- Main program ---------------- % - -% Define accented characters that can be made with seac, -% with the accent centered over the character. -/seacchars [ - /Abreve /Amacron - /Cacute /Ccaron /Dcaron - /Ecaron /Edotaccent /Emacron - /Gbreve - /Idotaccent /Imacron - /Lacute - /Nacute /Ncaron - /Ohungarumlaut /Omacron - /Racute /Rcaron - /Sacute /Scedilla - /Tcaron - /Uhungarumlaut /Umacron /Uogonek /Uring - /Zacute /Zdotaccent - /abreve /amacron - /cacute /ccaron - /ecaron /edotaccent /emacron - /gbreve - /lacute - /nacute /ncaron - /ohungarumlaut /omacron - /racute /rcaron - /sacute /scedilla - /uhungarumlaut /umacron /uring - /zacute /zdotaccent -] def - -% Define seac characters where the accent lines up with the right -% edge of the character. -/seacrightchars [ - /Aogonek /Eogonek /Iogonek /aogonek /eogonek /iogonek /uogonek -] def - -% Define seac characters where the caron becomes an appended quoteright. -/seaccaronchars [ - /dcaron /lcaron /tcaron -] def - -% Define seac characters using commaaccent. -/seaccommachars [ - /Gcommaaccent /Kcommaaccent /Lcommaaccent /Ncommaaccent /Rcommaaccent - /Scommaaccent /Tcommaaccent - /gcommaaccent /kcommaaccent /lcommaaccent /ncommaaccent /rcommaaccent - /scommaaccent /tcommaaccent -] def - -% Define the characters copied from the Symbol font. -/symbolchars [ - /Delta /greaterequal /lessequal /lozenge /notequal /partialdiff - /summation -] def - -% Define the procedures for editing the commaaccent character. -% Delete all the hints, since it's too hard to adjust them. -/caedit mark - /rmoveto { exch commatop sub cvi exch } - /hstem { pop pop pop } - /vstem 1 index - /callothersubr { - dup 3 eq { 4 { pop } repeat /skip true def } if - } - /pop { skip { pop /skip false def } if } -.dicttomark def - -/addce { % addce - 20 dict begin - /origfont 1 index def - openfont - dup /CharStrings 2 copy get dup length dict copy put - dup /Encoding 2 copy get dup length array copy put - dup /FontInfo 2 copy get dup length dict copy put - definefont /font exch def - currentdict font end begin begin - font 1000 scalefont setfont - /symbolfont /Symbol findfont def - /BBoxes CharStrings length dict def - /SBW CharStrings length dict def - - /italfactor FontInfo /ItalicAngle .knownget { - neg dup sin exch cos div - } { - 0 - } ifelse def - - % Invert the Encoding (needed for seac). - - /charindex 256 dict def - 0 1 255 { - charindex exch Encoding 1 index get exch put - } for - - % Add the commaaccent character, by moving the comma downward. - - /comma glyphbbox /commatop exch def pop pop pop - /comma glyphcs - /skip false def - [ exch { caedit 1 index .knownget { exec } if } forall ] - /commaaccent exch csdef - - % Add the accented characters that can be made with seac. - - seacchars { - splitaccented beginseac - centeraccent - % If the accent would collide with the base character, - % raise it a little. - abox 1 get bbox 3 get sub dup 0 le { - % ... but not if the accent is in the low position. - abox 1 get 0 gt { - neg 60 add - % Adjust the X position if italic. - dup italfactor mul 3 -1 roll add exch - } { - pop 0 - } ifelse - } { - pop 0 - } ifelse - finishseac - } forall - - seacrightchars { - splitaccented beginseac - bbox 2 get abox 2 get sub add % line up right edges - 0 finishseac - } forall - - /dcroat /d /hyphen beginseac - bbox 2 get abox 2 get sub add % line up right edges - 0 finishseac - - /imacron /dotlessi /macron beginseac - centeraccent - 0 finishseac - - /Lcaron /L /quoteright beginseac - bbox 2 get abox 2 get sub add % line up right edges - 0 finishseac - - seaccaronchars { - dup =string cvs 0 1 getinterval cvn /quoteright beginseac - % Move the quote to the right of the character. - bbox 2 get abox 0 get sub 50 add add - % Adjust the character width as well. - 4 -1 roll abox 2 get abox 0 get sub 50 add add cvi 4 1 roll - 0 finishseac - } forall - - seaccommachars { - dup =string cvs 0 1 getinterval cvn /comma beginseac - centeraccent - commatop neg - % Lower the accent if the character extends below - % the baseline - bbox 1 get 0 .min add - finishseac - } forall - - % Add the characters from the Symbol font. - % We should scale them to match the FontBBox, but we don't. - - symbolchars { - symbolfont /CharStrings get 1 index get - CharStrings 3 1 roll put - } forall - - % Add the one remaining character. - - CharStrings /Dcroat CharStrings /Eth get put - - % Recompute the FontBBox, since some of the accented characters - % may have enlarged it. - - /llx 1000 def /lly 1000 def /urx 0 def /ury 0 def - CharStrings { - pop glyphbbox - ury .max /ury exch def urx .max /urx exch def - lly .min /lly exch def llx .min /llx exch def - } forall - /FontBBox llx cvi lly cvi urx ceiling cvi ury ceiling cvi 4 packedarray def - - % Restore the Encoding and wrap up. - - [/Copyright /Notice] { - FontInfo 1 index .knownget { - addednotice concatstrings FontInfo 3 1 roll put - } { - pop - } ifelse - } forall - FontName font openfont - dup /Encoding origfont /Encoding get put - definefont - - end end -} def - -currentdict end readonly pop % addce_dict - -/addce { addce_dict begin addce end } def - -% ---------------- Integration ---------------- % - -% We would like to patch the font loader so that it adds the extended -% Latin characters automatically. We haven't done this yet. - -% ---------------- Test program ---------------- % - -/TEST where { pop TEST } { false } ifelse { - /FONT where { pop } { /FONT /Palatino-Italic def } ifelse - (unprot.ps) runlibfile - unprot - (wrfont.ps) runlibfile - wrfont_dict begin - /eexec_encrypt true def - /binary_CharStrings true def - end - save - FONT findfont - /Latin-CE exch addce setfont - (t.ce.pfb) (w) file dup writefont closefile - restore - (prfont.ps) runlibfile - (t.ce.pfb) (r) file .loadfont - /Latin-CE DoFont - quit -} if +% Copyright (C) 1999 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: addxchar.ps 6300 2005-12-28 19:56:24Z giles $ +% Add the Central European and other Adobe extended Latin characters to a +% Type 1 font. +% Requires -dWRITESYSTEMDICT to disable access protection. + +(type1ops.ps) runlibfile + +% ---------------- Utilities ---------------- % + +/addce_dict 50 dict def +addce_dict begin + +% Define the added copyright notice. +/addednotice (. Portions Copyright (C) 1999 Aladdin Enterprises.) def + +% Open a font for modification by removing the FID and changing the +% FontName. Removing UniqueID and XUID is not necessary, since we +% will only be adding characters. +/openfont { % openfont + dup length dict copy + dup /FID undef + dup /FontName 3 index put +} def + +% Do the equivalent of false charpath for a glyph. +% This should really be an operator! +/glyphpath { % glyphpath - + currentfont /Encoding get 0 3 -1 roll put + <00> false charpath +} def + +% Do the equivalent of charpath + pathbbox for a glyph. +/glyphbbox { % glyphbbox + % We cache this value, because it's expensive to compute. + BBoxes 1 index .knownget { + exch pop + } { + gsave newpath 0 0 moveto dup glyphpath [pathbbox] grestore + BBoxes 3 -1 roll 2 index put + } ifelse aload pop +} def + +% Get the side bearing and width for a glyph. +/glyphsbw { % glyphsbw + % We cache this value, because it's expensive to compute. + SBW 1 index .knownget { + exch pop + } { + dup glyphcs { dup /hsbw eq { pop exit } if } forall + 2 array astore + SBW 3 -1 roll 2 index put + } ifelse aload pop +} def + +% Get the CharString for a glyph, as an array. +/glyphcs { % glyphcs + CharStrings exch get + 4330 exch dup length string .type1decrypt exch pop + dup length lenIV sub lenIV exch getinterval + 0 () /SubFileDecode filter [ exch charstack_read ] +} def + +% Find an occurrence of a value in an array. +/asearch { % asearch true + % asearch false + false 0 4 2 roll exch { + % Stack: false index value element + 2 copy eq { pop pop exch not exch dup exit } if + exch 1 add exch + } forall pop pop +} def + +% Convert an array back to a CharString. +/csdef { % csdef - + charproc_string + 4330 exch dup .type1encrypt exch pop readonly + CharStrings 3 1 roll put +} def + +% Split an accented character name. +/splitaccented { % splitaccented + dup =string cvs + dup 0 1 getinterval cvn + exch dup length 1 sub 1 exch getinterval cvn +} def + +% Begin the definition of a 'seac' character. +% Defines accent, base, abox, bbox. +% The initial dx lines up the origins of the base and the accent. +/beginseac { % beginseac + % -mark- /hsbw + /accent exch def /base exch def + /abox [accent glyphbbox] def + /bbox [base glyphbbox] def + [ base glyphsbw /hsbw accent glyphsbw pop + dup 4 index sub +} def + +% Center the accent over the base of a 'seac' character. +/centeraccent { % centeraccent + bbox 2 get bbox 0 get add 2 div + abox 2 get abox 0 get add 2 div + sub add +} def + +% Finish the definition of a 'seac' character. +/finishseac { % -mark- ... finishseac - + exch cvi exch cvi + charindex base get charindex accent get /seac ] csdef +} def + +% ---------------- Main program ---------------- % + +% Define accented characters that can be made with seac, +% with the accent centered over the character. +/seacchars [ + /Abreve /Amacron + /Cacute /Ccaron /Dcaron + /Ecaron /Edotaccent /Emacron + /Gbreve + /Idotaccent /Imacron + /Lacute + /Nacute /Ncaron + /Ohungarumlaut /Omacron + /Racute /Rcaron + /Sacute /Scedilla + /Tcaron + /Uhungarumlaut /Umacron /Uogonek /Uring + /Zacute /Zdotaccent + /abreve /amacron + /cacute /ccaron + /ecaron /edotaccent /emacron + /gbreve + /lacute + /nacute /ncaron + /ohungarumlaut /omacron + /racute /rcaron + /sacute /scedilla + /uhungarumlaut /umacron /uring + /zacute /zdotaccent +] def + +% Define seac characters where the accent lines up with the right +% edge of the character. +/seacrightchars [ + /Aogonek /Eogonek /Iogonek /aogonek /eogonek /iogonek /uogonek +] def + +% Define seac characters where the caron becomes an appended quoteright. +/seaccaronchars [ + /dcaron /lcaron /tcaron +] def + +% Define seac characters using commaaccent. +/seaccommachars [ + /Gcommaaccent /Kcommaaccent /Lcommaaccent /Ncommaaccent /Rcommaaccent + /Scommaaccent /Tcommaaccent + /gcommaaccent /kcommaaccent /lcommaaccent /ncommaaccent /rcommaaccent + /scommaaccent /tcommaaccent +] def + +% Define the characters copied from the Symbol font. +/symbolchars [ + /Delta /greaterequal /lessequal /lozenge /notequal /partialdiff + /summation +] def + +% Define the procedures for editing the commaaccent character. +% Delete all the hints, since it's too hard to adjust them. +/caedit mark + /rmoveto { exch commatop sub cvi exch } + /hstem { pop pop pop } + /vstem 1 index + /callothersubr { + dup 3 eq { 4 { pop } repeat /skip true def } if + } + /pop { skip { pop /skip false def } if } +.dicttomark def + +/addce { % addce + 20 dict begin + /origfont 1 index def + openfont + dup /CharStrings 2 copy get dup length dict copy put + dup /Encoding 2 copy get dup length array copy put + dup /FontInfo 2 copy get dup length dict copy put + definefont /font exch def + currentdict font end begin begin + font 1000 scalefont setfont + /symbolfont /Symbol findfont def + /BBoxes CharStrings length dict def + /SBW CharStrings length dict def + + /italfactor FontInfo /ItalicAngle .knownget { + neg dup sin exch cos div + } { + 0 + } ifelse def + + % Invert the Encoding (needed for seac). + + /charindex 256 dict def + 0 1 255 { + charindex exch Encoding 1 index get exch put + } for + + % Add the commaaccent character, by moving the comma downward. + + /comma glyphbbox /commatop exch def pop pop pop + /comma glyphcs + /skip false def + [ exch { caedit 1 index .knownget { exec } if } forall ] + /commaaccent exch csdef + + % Add the accented characters that can be made with seac. + + seacchars { + splitaccented beginseac + centeraccent + % If the accent would collide with the base character, + % raise it a little. + abox 1 get bbox 3 get sub dup 0 le { + % ... but not if the accent is in the low position. + abox 1 get 0 gt { + neg 60 add + % Adjust the X position if italic. + dup italfactor mul 3 -1 roll add exch + } { + pop 0 + } ifelse + } { + pop 0 + } ifelse + finishseac + } forall + + seacrightchars { + splitaccented beginseac + bbox 2 get abox 2 get sub add % line up right edges + 0 finishseac + } forall + + /dcroat /d /hyphen beginseac + bbox 2 get abox 2 get sub add % line up right edges + 0 finishseac + + /imacron /dotlessi /macron beginseac + centeraccent + 0 finishseac + + /Lcaron /L /quoteright beginseac + bbox 2 get abox 2 get sub add % line up right edges + 0 finishseac + + seaccaronchars { + dup =string cvs 0 1 getinterval cvn /quoteright beginseac + % Move the quote to the right of the character. + bbox 2 get abox 0 get sub 50 add add + % Adjust the character width as well. + 4 -1 roll abox 2 get abox 0 get sub 50 add add cvi 4 1 roll + 0 finishseac + } forall + + seaccommachars { + dup =string cvs 0 1 getinterval cvn /comma beginseac + centeraccent + commatop neg + % Lower the accent if the character extends below + % the baseline + bbox 1 get 0 .min add + finishseac + } forall + + % Add the characters from the Symbol font. + % We should scale them to match the FontBBox, but we don't. + + symbolchars { + symbolfont /CharStrings get 1 index get + CharStrings 3 1 roll put + } forall + + % Add the one remaining character. + + CharStrings /Dcroat CharStrings /Eth get put + + % Recompute the FontBBox, since some of the accented characters + % may have enlarged it. + + /llx 1000 def /lly 1000 def /urx 0 def /ury 0 def + CharStrings { + pop glyphbbox + ury .max /ury exch def urx .max /urx exch def + lly .min /lly exch def llx .min /llx exch def + } forall + /FontBBox llx cvi lly cvi urx ceiling cvi ury ceiling cvi 4 packedarray def + + % Restore the Encoding and wrap up. + + [/Copyright /Notice] { + FontInfo 1 index .knownget { + addednotice concatstrings FontInfo 3 1 roll put + } { + pop + } ifelse + } forall + FontName font openfont + dup /Encoding origfont /Encoding get put + definefont + + end end +} def + +currentdict end readonly pop % addce_dict + +/addce { addce_dict begin addce end } def + +% ---------------- Integration ---------------- % + +% We would like to patch the font loader so that it adds the extended +% Latin characters automatically. We haven't done this yet. + +% ---------------- Test program ---------------- % + +/TEST where { pop TEST } { false } ifelse { + /FONT where { pop } { /FONT /Palatino-Italic def } ifelse + (unprot.ps) runlibfile + unprot + (wrfont.ps) runlibfile + wrfont_dict begin + /eexec_encrypt true def + /binary_CharStrings true def + end + save + FONT findfont + /Latin-CE exch addce setfont + (t.ce.pfb) (w) file dup writefont closefile + restore + (prfont.ps) runlibfile + (t.ce.pfb) (r) file .loadfont + /Latin-CE DoFont + quit +} if diff --git a/Master/tlpkg/tlgs/lib/afmdiff.awk b/Master/tlpkg/tlgs/lib/afmdiff.awk old mode 100755 new mode 100644 diff --git a/Master/tlpkg/tlgs/lib/align.ps b/Master/tlpkg/tlgs/lib/align.ps old mode 100755 new mode 100644 index 58d9e600495..23bd61a8950 --- a/Master/tlpkg/tlgs/lib/align.ps +++ b/Master/tlpkg/tlgs/lib/align.ps @@ -1,73 +1,73 @@ -% Copyright (C) 1989, 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: align.ps 6300 2005-12-28 19:56:24Z giles $ -% Print a page that indicates the proper settings of Margins and HWMargins -% for a given device. Requires a Level 2 system. - -% Reset the offset and margins. - -<< - /PageOffset [0 0] - /Margins [0 0] - /.HWMargins [0 0 0 0] ->> -setpagedevice -<< - /ImagingBBox null ->> -setpagedevice - -% Determine the actual page size. - -clippath pathbbox newpath -/y1 exch def /x1 exch def pop pop - -% Draw lines that should be exactly 1" in from each edge, -% and should extend precisely to the edge of the paper. - -1 setlinewidth -0 setgray -72 0 moveto 0 y1 rlineto stroke -0 72 moveto x1 0 rlineto stroke - -% Print the text in the middle of the page. - -/S 80 string def -108 480 moveto -/Helvetica 12 selectfont - { currentfile S readline pop dup (%END) eq { pop exit } if - gsave show grestore 0 -15 rmoveto - } loop -Let the distance in inches from the left edge of the page to -the vertical line be H, and from the bottom edge to the -horizontal line be V; let the lengths of the gaps at the top -and bottom of the vertical line be T and B respectively, and -the gaps at the left and right of the horizontal line be L -and R. For correct alignment of pages, put the following line -in a file named (for example) margins.ps, and then mention -margins.ps on the gs command line when printing any of your -own files: - - << /.HWMargins [ml mb mr mt] /Margins [x y] >> setpagedevice - -where - ml = L * 72, mb = B * 72, mr = R * 72, mt = T * 72, -%END -/res currentpagedevice /.MarginsHWResolution get def -( x = (1 - H) * ) show res 0 get =string cvs show -(, y = (V - 1) * ) show res 1 get =string cvs show - -showpage +% Copyright (C) 1989, 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: align.ps 6300 2005-12-28 19:56:24Z giles $ +% Print a page that indicates the proper settings of Margins and HWMargins +% for a given device. Requires a Level 2 system. + +% Reset the offset and margins. + +<< + /PageOffset [0 0] + /Margins [0 0] + /.HWMargins [0 0 0 0] +>> +setpagedevice +<< + /ImagingBBox null +>> +setpagedevice + +% Determine the actual page size. + +clippath pathbbox newpath +/y1 exch def /x1 exch def pop pop + +% Draw lines that should be exactly 1" in from each edge, +% and should extend precisely to the edge of the paper. + +1 setlinewidth +0 setgray +72 0 moveto 0 y1 rlineto stroke +0 72 moveto x1 0 rlineto stroke + +% Print the text in the middle of the page. + +/S 80 string def +108 480 moveto +/Helvetica 12 selectfont + { currentfile S readline pop dup (%END) eq { pop exit } if + gsave show grestore 0 -15 rmoveto + } loop +Let the distance in inches from the left edge of the page to +the vertical line be H, and from the bottom edge to the +horizontal line be V; let the lengths of the gaps at the top +and bottom of the vertical line be T and B respectively, and +the gaps at the left and right of the horizontal line be L +and R. For correct alignment of pages, put the following line +in a file named (for example) margins.ps, and then mention +margins.ps on the gs command line when printing any of your +own files: + + << /.HWMargins [ml mb mr mt] /Margins [x y] >> setpagedevice + +where + ml = L * 72, mb = B * 72, mr = R * 72, mt = T * 72, +%END +/res currentpagedevice /.MarginsHWResolution get def +( x = (1 - H) * ) show res 0 get =string cvs show +(, y = (V - 1) * ) show res 1 get =string cvs show + +showpage diff --git a/Master/tlpkg/tlgs/lib/bdftops.ps b/Master/tlpkg/tlgs/lib/bdftops.ps old mode 100755 new mode 100644 index 3b620d0eb59..bf310c529de --- a/Master/tlpkg/tlgs/lib/bdftops.ps +++ b/Master/tlpkg/tlgs/lib/bdftops.ps @@ -1,795 +1,795 @@ -% Copyright (C) 1990, 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: bdftops.ps 6300 2005-12-28 19:56:24Z giles $ -% bdftops.ps -% Convert a BDF file (possibly with (an) associated AFM file(s)) -% to a PostScript Type 1 font (without eexec encryption). -% The resulting font will work with any PostScript language interpreter, -% but not with ATM or other font rasterizers lacking a complete interpreter. - -/envBDF 120 dict def -envBDF begin - -% "Import" the image-to-path package. -% This also brings in the Type 1 opcodes (type1ops.ps). - (impath.ps) runlibfile - -% "Import" the font-writing package. - (wrfont.ps) runlibfile - wrfont_dict begin - /binary_CharStrings false def - /binary_tokens false def - /encrypt_CharStrings true def - /standard_only true def - end - /lenIV 0 def - -% Invert the StandardEncoding vector. - 256 dict dup begin - 0 1 255 { dup StandardEncoding exch get exch def } for - end /StandardDecoding exch def - -% Define the properties copied to FontInfo. - mark - (COPYRIGHT) /Notice - (FAMILY_NAME) /FamilyName - (FULL_NAME) /FullName - (WEIGHT_NAME) /Weight - .dicttomark /properties exch def - -% Define the character sequences for synthesizing missing composite -% characters in the standard encoding. - mark - /AE [/A /E] - /OE [/O /E] - /ae [/a /e] - /ellipsis [/period /period /period] - /emdash [/hyphen /hyphen /hyphen] - /endash [/hyphen /hyphen] - /fi [/f /i] - /fl [/f /l] - /germandbls [/s /s] - /guillemotleft [/less /less] - /guillemotright [/greater /greater] - /oe [/o /e] - /quotedblbase [/comma /comma] - .dicttomark /composites exch def - -% Define the procedure for synthesizing composites. -% This must not be bound. - /compose - { exch pop - FontMatrix Private /composematrix get invertmatrix concat - 0 0 moveto - dup gsave false charpath pathbbox currentpoint grestore - 6 2 roll setcachedevice show - } def -% Define the CharString procedure that calls compose, with the string -% on the stack. This too must remain unbound. - /compose_proc - { Private /compose get exec - } def - -% Define aliases for missing characters similarly. - mark - /acute /quoteright - /bullet /asterisk - /cedilla /comma - /circumflex /asciicircum - /dieresis /quotedbl - /dotlessi /i - /exclamdown /exclam - /florin /f - /fraction /slash - /grave /quoteleft - /guilsinglleft /less - /guilsinglright /greater - /hungarumlaut /quotedbl - /periodcentered /asterisk - /questiondown /question - /quotedblleft /quotedbl - /quotedblright /quotedbl - /quotesinglbase /comma - /quotesingle /quoteright - /tilde /asciitilde - .dicttomark /aliases exch def - -% Define overstruck characters that can be synthesized with seac. - mark - [ /Aacute /Acircumflex /Adieresis /Agrave /Aring /Atilde - /Ccedilla - /Eacute /Ecircumflex /Edieresis /Egrave - /Iacute /Icircumflex /Idieresis /Igrave - /Lslash - /Ntilde - /Oacute /Ocircumflex /Odieresis /Ograve /Otilde - /Scaron - /Uacute /Ucircumflex /Udieresis /Ugrave - /Yacute /Ydieresis - /Zcaron - /aacute /acircumflex /adieresis /agrave /aring /atilde - /ccedilla - /eacute /ecircumflex /edieresis /egrave - /iacute /icircumflex /idieresis /igrave - /lslash - /ntilde - /oacute /ocircumflex /odieresis /ograve /otilde - /scaron - /uacute /ucircumflex /udieresis /ugrave - /yacute /ydieresis - /zcaron - ] - { dup =string cvs - [ exch dup 0 1 getinterval cvn - exch dup length 1 sub 1 exch getinterval cvn - ] - } forall - /cent [/c /slash] - /daggerdbl [/bar /equal] - /divide [/colon /hyphen] - /sterling [/L /hyphen] - /yen [/Y /equal] - .dicttomark /accentedchars exch def - -% ------ Output utilities ------ % - - /ws {psfile exch writestring} bind def - /wl {ws (\n) ws} bind def - /wt {=string cvs ws ( ) ws} bind def - -% ------ BDF file parsing utilities ------ % - -% Define a buffer for reading the BDF file. - /buffer 400 string def - -% Read a line from the BDF file into the buffer. -% Ignore empty (zero-length) lines. -% Define /keyword as the first word on the line. -% Define /args as the remainder of the line. -% If the keyword is equal to commentword, skip the line. -% (If commentword is equal to a space, never skip.) - /nextline - { { bdfile buffer readline not - { (Premature EOF\n) print stop } if - dup length 0 ne { exit } if pop - } - loop - ( ) search - { /keyword exch def pop } - { /keyword exch def () } - ifelse - /args exch def - keyword commentword eq { nextline } if - } bind def - -% Get a word argument from args. We do *not* copy the string. - /warg % warg -> string - { args ( ) search - { exch pop exch } - { () } - ifelse /args exch def - } bind def - -% Get an integer argument from args. - /iarg % iarg -> int - { warg cvi - } bind def - -% Get a numeric argument from args. - /narg % narg -> int|real - { warg cvr - dup dup cvi eq { cvi } if - } bind def - -% Convert the remainder of args into a string. - /remarg % remarg -> string - { args copystring - } bind def - -% Get a string argument that occupies the remainder of args. - /sarg % sarg -> string - { args (") anchorsearch - { pop /args exch def } { pop } ifelse - args args length 1 sub get (") 0 get eq - { args 0 args length 1 sub getinterval /args exch def } if - args copystring - } bind def - -% Check that the keyword is the expected one. - /checkline % (EXPECTED-KEYWORD) checkline -> - { dup keyword ne - { (Expected ) print = - (Line=) print keyword print ( ) print args print (\n) print stop - } if - pop - } bind def - -% Read a line and check its keyword. - /getline % (EXPECTED-KEYWORD) getline -> - { nextline checkline - } bind def - -% Find the first/last non-zero bit of a non-zero byte. - /fnzb - { 0 { exch dup 128 ge { pop exit } { dup add exch 1 add } ifelse } - loop - } bind def - /lnzb - { 7 { exch dup 1 and 0 ne { pop exit } { -1 bitshift exch 1 sub } ifelse } - loop - } bind def - -% ------ Type 1 encoding utilities ------ % - -% Parse the side bearing and width information that begins a CharString. -% Arguments: charstring. Result: sbx sby wx wy substring. - /parsesbw - { mark exch lenIV - { % stack: mark ... string dropcount - dup 2 index length exch sub getinterval - dup 0 get dup 32 lt { pop exit } if - dup 246 le - { 139 sub exch 1 } - { dup 250 le - { 247 sub 8 bitshift 108 add 1 index 1 get add exch 2 } - { dup 254 le - { 251 sub 8 bitshift 108 add 1 index 1 get add neg exch 2 } - { pop dup 1 get 128 xor 128 sub - 8 bitshift 1 index 2 get add - 8 bitshift 1 index 3 get add - 8 bitshift 1 index 4 get add exch 5 - } ifelse - } ifelse - } ifelse - } loop - counttomark 3 eq { 0 3 1 roll 0 exch } if - 6 -1 roll pop - } bind def - -% Find the side bearing and width information that begins a CharString. -% Arguments: charstring. Result: charstring sizethroughsbw. - /findsbw - { dup parsesbw 4 { exch pop } repeat skipsbw - } bind def - /skipsbw % charstring sbwprefix -> sizethroughsbw - { length 1 index length exch sub - 2 copy get 12 eq { 2 } { 1 } ifelse add - } bind def - -% Encode a number, and append it to a string. -% Arguments: str num. Result: newstr. - /concatnum - { dup dup -107 ge exch 107 le and - { 139 add 1 string dup 0 3 index put } - { dup dup -1131 ge exch 1131 le and - { dup 0 ge { 16#f694 } { neg 16#fa94 } ifelse add - 2 string dup 0 3 index -8 bitshift put - dup 1 3 index 255 and put - } - { 5 string dup 0 255 put exch - 2 copy 1 exch -24 bitshift 255 and put - 2 copy 2 exch -16 bitshift 255 and put - 2 copy 3 exch -8 bitshift 255 and put - 2 copy 4 exch 255 and put - exch - } - ifelse - } - ifelse exch pop concatstrings - } bind def - -% ------ Point arithmetic utilities ------ % - - /ptadd { exch 4 -1 roll add 3 1 roll add } bind def - /ptexch { 4 2 roll } bind def - /ptneg { neg exch neg exch } bind def - /ptpop { pop pop } bind def - /ptsub { ptneg ptadd } bind def - -% ------ The main program ------ % - - /readBDF % - % readBDF -> - { /xuid exch def % may be null - /uniqueID exch def % may be -1 - /encodingname exch def - /encoding encodingname cvx exec def - /fontname exch def - /psname exch def - /bdfname exch def - gsave % so we can set the CTM to the font matrix - -% Open the input files. We don't open the output file until -% we've done a minimal validity check on the input. - bdfname (r) file /bdfile exch def - /commentword ( ) def - -% Check for the STARTFONT. - (STARTFONT) getline - args (2.1) ne { (Not version 2.1\n) print stop } if - -% Initialize the font. - /Font 20 dict def - Font begin - /FontName fontname def - /PaintType 0 def - /FontType 1 def - uniqueID 0 gt { /UniqueID uniqueID def } if - xuid null ne { /XUID xuid def } if - /Encoding encoding def - /FontInfo 20 dict def - /Private 20 dict def - currentdict end currentdict end - exch begin begin % insert font above environment - -% Initialize the Private dictionary in the font. - Private begin - /-! {string currentfile exch readhexstring pop} readonly def - /-| {string currentfile exch readstring pop} readonly def - /|- {readonly def} readonly def - /| {readonly put} readonly def - /BlueValues [] def - /lenIV lenIV def - /MinFeature {16 16} def - /password 5839 def - /UniqueID uniqueID def - end % Private - -% Invert the Encoding, for synthesizing composite characters. - /decoding encoding length dict def - 0 1 encoding length 1 sub - { dup encoding exch get exch decoding 3 1 roll put } - for - -% Now open the output file. - psname (w) file /psfile exch def - -% Put out a header compatible with the Adobe "standard". - (%!FontType1-1.0: ) ws fontname wt (000.000) wl - (% This is a font description converted from ) ws - bdfname wl - (% by bdftops running on ) ws - statusdict /product get ws ( revision ) ws - revision =string cvs ws (.) wl - -% Copy the initial comments, up to FONT. - true - { nextline - keyword (COMMENT) ne {exit} if - { (% Here are the initial comments from the BDF file:\n%) wl - } if false - (%) ws remarg wl - } loop pop - () wl - /commentword (COMMENT) def % do skip comments from now on - -% Read and process the FONT, SIZE, and FONTBOUNDINGBOX. - % If we cared about FONT, we'd use it here. If the BDF files - % from MIT had PostScript names rather than X names, we would - % care; but what's there is unusable, so we discard FONT. - % The FONTBOUNDINGBOX may not be reliable, so we discard it too. - (FONT) checkline - (SIZE) getline - /pointsize iarg def /xres iarg def /yres iarg def - (FONTBOUNDINGBOX) getline - nextline - -% Initialize the font bounding box bookeeping. - /fbbxo 1000 def - /fbbyo 1000 def - /fbbxe -1000 def - /fbbye -1000 def - -% Read and process the properties. We only care about a few of them. - keyword (STARTPROPERTIES) eq - { iarg - { nextline - properties keyword known - { FontInfo properties keyword get sarg readonly put - } if - } repeat - (ENDPROPERTIES) getline - nextline - } if - -% Compute and set the FontMatrix. - Font /FontMatrix - [ 0.001 0 0 0.001 xres mul yres div 0 0 ] readonly - dup setmatrix put - -% Read and process the header for the bitmaps. - (CHARS) checkline - /ccount iarg def - -% Initialize the CharStrings dictionary. - /charstrings ccount - composites length add - aliases length add - accentedchars length add - 1 add dict def % 1 add for .notdef - /isfixedwidth true def - /fixedwidth null def - /subrcount 0 def - /subrs [] def - -% Read the bitmap data. This reads the remainder of the file. -% We do this before processing the bitmaps so that we can compute -% the correct FontBBox first. - /chardata ccount dict def - ccount -1 1 - { (STARTCHAR) getline - /charname remarg def - (ENCODING) getline - /eindex iarg def - eindex dup 0 ge exch 255 le and - { charname /charname StandardEncoding eindex get def - charname /.notdef eq eindex 0 gt and - { /charname (A) eindex =string cvs concatstrings cvn def - } - if - (/) print charname =string cvs print (,) print print - } - { (/) print charname print - } - ifelse - 10 mod 1 eq { (\n) print flush } if - (SWIDTH) getline - /swx iarg pointsize mul 1000 div xres mul 72 div def - /swy iarg pointsize mul 1000 div xres mul 72 div def - (DWIDTH) getline % Ignore, use SWIDTH instead - (BBX) getline - /bbw iarg def /bbh iarg def /bbox iarg def /bboy iarg def - nextline - keyword (ATTRIBUTES) eq - { nextline - } if - (BITMAP) checkline - -% Update the font bounding box. - /fbbxo fbbxo bbox .min def - /fbbyo fbbyo bboy .min def - /fbbxe fbbxe bbox bbw add .max def - /fbbye fbbye bboy bbh add .max def - -% Read the bits for this character. - /raster bbw 7 add 8 idiv def - /cbits raster bbh mul string def - cbits length 0 gt - { 0 raster cbits length raster sub - { cbits exch raster getinterval - bdfile buffer readline not - { (EOF in bitmap\n) print stop } if - % stack has - 0 () /SubFileDecode filter - exch 2 copy readhexstring pop pop pop closefile - } for - } if - - (ENDCHAR) getline - -% Save the character data. - chardata charname [swx swy bbw bbh bbox bboy cbits] put - } for - - (ENDFONT) getline - -% Allocate the buffers for the bitmap and the outline, -% according to the font bounding box. - /fbbw fbbxe fbbxo sub def - /fbbh fbbye fbbyo sub def - /fraster fbbw 7 add 8 idiv def - /bits fraster fbbh mul 200 .max 65535 .min string def - /outline bits length 16 mul 65535 .min string def - -% Process the characters. - chardata - { exch /charname exch def aload pop - /cbits exch def - /bboy exch def /bbox exch def - /bbh exch def /bbw exch def - /swy exch def /swx exch def - -% The bitmap handed to type1imagepath must have the correct height, -% because type1imagepath uses this to compute the scale factor, -% so we have to clear the unused parts of it. - /raster bbw 7 add 8 idiv def - bits dup 0 1 raster fbbh mul 1 sub - { 0 put dup } for - pop pop - bits raster fbbh bbh sub mul cbits putinterval - -% Compute the font entry, converting the bitmap to an outline. - bits 0 raster fbbh mul getinterval % the bitmap image - bbw fbbh % bitmap width & height - swx swy % width x & y - bbox neg bboy neg % origin x & y - % Account for lenIV when converting the outline. - outline lenIV outline length lenIV sub getinterval - type1imagepath - length lenIV add - outline exch 0 exch getinterval - -% Check for a fixed width font. - isfixedwidth - { fixedwidth null eq - { /fixedwidth swx def } - { fixedwidth swx ne { /isfixedwidth false def } if } - ifelse - } if - -% Finish up the character. - copystring - charname exch charstrings 3 1 roll put - } forall - -% Add CharStrings entries for aliases. - aliases - { charstrings 2 index known not charstrings 2 index known and - { charstrings exch get charstrings 3 1 roll put - } - { pop pop - } - ifelse - } - forall - -% If this is not a fixed-width font, synthesize missing characters -% out of available ones. - isfixedwidth not - { false composites - { 1 index charstrings exch known not - 1 index { decoding exch known and } forall - { ( /) print 1 index bits cvs print - /combine exch def - 0 1 combine length 1 sub - { dup combine exch get decoding exch get - bits 3 1 roll put - } for - bits 0 combine length getinterval copystring - [ exch /compose_proc load aload pop ] cvx - charstrings 3 1 roll put - pop true - } - { pop pop } - ifelse - } - forall flush - { Private /composematrix matrix put - Private /compose /compose load put - } - if - } - if - -% Synthesize accented characters with seac if needed and possible. - accentedchars - { aload pop /accent exch def /base exch def - buffer cvs /accented exch def - charstrings accented known not - charstrings base known and - charstrings accent known and - StandardDecoding base known and - StandardDecoding accent known and - encoding StandardDecoding base get get base eq and - encoding StandardDecoding accent get get accent eq and - { ( /) print accented print - charstrings base get findsbw 0 exch getinterval - /acstring exch def % start with sbw of base - charstrings accent get parsesbw - 4 { pop } repeat % just leave sbx - acstring exch concatnum - 0 concatnum 0 concatnum % adx ady - decoding base get concatnum % bchar - decoding accent get concatnum % achar - s_seac concatstrings - charstrings exch accented copystring exch put - } if - } forall - -% Make a CharStrings entry for .notdef. - outline lenIV <8b8b0d0e> putinterval % 0 0 hsbw endchar - charstrings /.notdef outline 0 lenIV 4 add getinterval copystring put - -% Encrypt the CharStrings and Subrs (in place). - charstrings - { % Be careful not to encrypt aliased characters twice, - % since they share their CharString. - aliases 2 index known - { charstrings aliases 3 index get .knownget - { 1 index ne } - { true } - ifelse - } - { true - } - ifelse - 1 index type /stringtype eq and - { 4330 exch dup .type1encrypt exch pop - readonly charstrings 3 1 roll put - } - { pop pop - } - ifelse - } - forall - 0 1 subrcount 1 sub - { dup subrs exch get - 4330 exch dup .type1encrypt exch pop - subrs 3 1 roll put - } - for - -% Make most of the remaining entries in the font dictionaries. - -% The Type 1 font machinery really only works with a 1000 unit -% character coordinate system. Set this up here, by computing the factor -% to make the X entry in the FontMatrix come out at exactly 0.001. - /fontscale 1000 fbbh div yres mul xres div def - Font /FontBBox - [ fbbxo fontscale mul - fbbyo fontscale mul - fbbxe fontscale mul - fbbye fontscale mul - ] cvx readonly put - Font /CharStrings charstrings readonly put - FontInfo /FullName known not - { % Some programs insist on FullName being present. - FontInfo /FullName FontName dup length string cvs put - } - if - FontInfo /isFixedPitch isfixedwidth put - subrcount 0 gt - { Private /Subrs subrs 0 subrcount getinterval readonly put - } if - -% Determine the italic angle and underline position -% by actually installing the font. - save - /_temp_ Font definefont setfont - [1000 0 0 1000 0 0] setmatrix % mitigate rounding problems -% The italic angle is the multiple of -5 degrees -% that minimizes the width of the 'I'. - 0 9999 0 5 85 - { dup rotate - newpath 0 0 moveto (I) false charpath - dup neg rotate - pathbbox pop exch pop exch sub - dup 3 index lt { 4 -2 roll } if - pop pop - } - for pop -% The underline position is halfway between the bottom of the 'A' -% and the bottom of the FontBBox. - newpath 0 0 moveto (A) false charpath - FontMatrix concat - pathbbox pop pop exch pop -% Put the values in FontInfo. - 3 -1 roll - restore - Font /FontBBox get 1 get add 2 div cvi - dup FontInfo /UnderlinePosition 3 -1 roll put - 2 div abs FontInfo /UnderlineThickness 3 -1 roll put - FontInfo /ItalicAngle 3 -1 roll put - -% Clean up and finish. - grestore - bdfile closefile - Font currentdict end end begin % remove font from dict stack - (\n) print flush - - } bind def - -% ------ Reader for AFM files ------ % - -% Dictionary for looking up character keywords - /cmdict 6 dict dup begin - /C { /c iarg def } def - /N { /n warg copystring def } def - /WX { /w narg def } def - /W0X /WX load def - /W /WX load def - /W0 /WX load def - end def - - /readAFM % fontdict afmfilename readAFM -> fontdict - { (r) file /bdfile exch def - /Font exch def - /commentword (Comment) def - -% Check for the StartFontMetrics. - (StartFontMetrics) getline - args cvr 2.0 lt { (Not version 2.0 or greater\n) print stop } if - -% Look for StartCharMetrics, then parse the character metrics. -% The only information we care about is the X width. - /metrics 0 dict def - { nextline - keyword (EndFontMetrics) eq { exit } if - keyword (StartCharMetrics) eq - { iarg dup dict /metrics exch def - { /c -1 def /n null def /w null def - nextline buffer - { token not { exit } if - dup cmdict exch known - { exch /args exch def cmdict exch get exec args } - { pop } - ifelse - } loop - c 0 ge n null ne or w null ne and - { n null eq { /n Font /Encoding get c get def } if - metrics n w put - } - if - } - repeat - (EndCharMetrics) getline - } if - } loop - -% Insert the metrics in the font. - metrics length 0 ne - { Font /Metrics metrics readonly put - } if - Font - } bind def - -end % envBDF - -% Enter the main program in the current dictionary. -/bdfafmtops % infilename afmfilename* outfilename fontname - % encodingname uniqueID xuid - { envBDF begin - 7 -2 roll exch 7 2 roll % afm* in out fontname encodingname uniqueID xuid - readBDF % afm* font - exch { readAFM } forall - save exch - dup /FontName get exch definefont - setfont - psfile writefont - restore - psfile closefile - end - } bind def - -% If the program was invoked from the command line, run it now. -[ shellarguments - { counttomark 4 ge - { dup 0 get - dup 48 ge exch 57 le and % last arg starts with a digit? - { /StandardEncoding } % no encodingname - { cvn } % have encodingname - ifelse - exch (.) search % next-to-last arg has . in it? - { mark 4 1 roll % have xuid - { cvi exch pop exch (.) search not { exit } if } - loop cvi ] - 3 -1 roll cvi exch - } - { cvi null % no xuid - } - ifelse - counttomark 5 roll - counttomark 6 sub array astore - 7 -2 roll cvn 7 -3 roll % make sure fontname is a name - bdfafmtops - } - { cleartomark - (Usage:\n bdftops xx.bdf [yy1.afm ...] zz.gsf fontname uniqueID [xuid] [encodingname]\n) print flush - mark - } - ifelse - } -if pop +% Copyright (C) 1990, 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: bdftops.ps 6300 2005-12-28 19:56:24Z giles $ +% bdftops.ps +% Convert a BDF file (possibly with (an) associated AFM file(s)) +% to a PostScript Type 1 font (without eexec encryption). +% The resulting font will work with any PostScript language interpreter, +% but not with ATM or other font rasterizers lacking a complete interpreter. + +/envBDF 120 dict def +envBDF begin + +% "Import" the image-to-path package. +% This also brings in the Type 1 opcodes (type1ops.ps). + (impath.ps) runlibfile + +% "Import" the font-writing package. + (wrfont.ps) runlibfile + wrfont_dict begin + /binary_CharStrings false def + /binary_tokens false def + /encrypt_CharStrings true def + /standard_only true def + end + /lenIV 0 def + +% Invert the StandardEncoding vector. + 256 dict dup begin + 0 1 255 { dup StandardEncoding exch get exch def } for + end /StandardDecoding exch def + +% Define the properties copied to FontInfo. + mark + (COPYRIGHT) /Notice + (FAMILY_NAME) /FamilyName + (FULL_NAME) /FullName + (WEIGHT_NAME) /Weight + .dicttomark /properties exch def + +% Define the character sequences for synthesizing missing composite +% characters in the standard encoding. + mark + /AE [/A /E] + /OE [/O /E] + /ae [/a /e] + /ellipsis [/period /period /period] + /emdash [/hyphen /hyphen /hyphen] + /endash [/hyphen /hyphen] + /fi [/f /i] + /fl [/f /l] + /germandbls [/s /s] + /guillemotleft [/less /less] + /guillemotright [/greater /greater] + /oe [/o /e] + /quotedblbase [/comma /comma] + .dicttomark /composites exch def + +% Define the procedure for synthesizing composites. +% This must not be bound. + /compose + { exch pop + FontMatrix Private /composematrix get invertmatrix concat + 0 0 moveto + dup gsave false charpath pathbbox currentpoint grestore + 6 2 roll setcachedevice show + } def +% Define the CharString procedure that calls compose, with the string +% on the stack. This too must remain unbound. + /compose_proc + { Private /compose get exec + } def + +% Define aliases for missing characters similarly. + mark + /acute /quoteright + /bullet /asterisk + /cedilla /comma + /circumflex /asciicircum + /dieresis /quotedbl + /dotlessi /i + /exclamdown /exclam + /florin /f + /fraction /slash + /grave /quoteleft + /guilsinglleft /less + /guilsinglright /greater + /hungarumlaut /quotedbl + /periodcentered /asterisk + /questiondown /question + /quotedblleft /quotedbl + /quotedblright /quotedbl + /quotesinglbase /comma + /quotesingle /quoteright + /tilde /asciitilde + .dicttomark /aliases exch def + +% Define overstruck characters that can be synthesized with seac. + mark + [ /Aacute /Acircumflex /Adieresis /Agrave /Aring /Atilde + /Ccedilla + /Eacute /Ecircumflex /Edieresis /Egrave + /Iacute /Icircumflex /Idieresis /Igrave + /Lslash + /Ntilde + /Oacute /Ocircumflex /Odieresis /Ograve /Otilde + /Scaron + /Uacute /Ucircumflex /Udieresis /Ugrave + /Yacute /Ydieresis + /Zcaron + /aacute /acircumflex /adieresis /agrave /aring /atilde + /ccedilla + /eacute /ecircumflex /edieresis /egrave + /iacute /icircumflex /idieresis /igrave + /lslash + /ntilde + /oacute /ocircumflex /odieresis /ograve /otilde + /scaron + /uacute /ucircumflex /udieresis /ugrave + /yacute /ydieresis + /zcaron + ] + { dup =string cvs + [ exch dup 0 1 getinterval cvn + exch dup length 1 sub 1 exch getinterval cvn + ] + } forall + /cent [/c /slash] + /daggerdbl [/bar /equal] + /divide [/colon /hyphen] + /sterling [/L /hyphen] + /yen [/Y /equal] + .dicttomark /accentedchars exch def + +% ------ Output utilities ------ % + + /ws {psfile exch writestring} bind def + /wl {ws (\n) ws} bind def + /wt {=string cvs ws ( ) ws} bind def + +% ------ BDF file parsing utilities ------ % + +% Define a buffer for reading the BDF file. + /buffer 400 string def + +% Read a line from the BDF file into the buffer. +% Ignore empty (zero-length) lines. +% Define /keyword as the first word on the line. +% Define /args as the remainder of the line. +% If the keyword is equal to commentword, skip the line. +% (If commentword is equal to a space, never skip.) + /nextline + { { bdfile buffer readline not + { (Premature EOF\n) print stop } if + dup length 0 ne { exit } if pop + } + loop + ( ) search + { /keyword exch def pop } + { /keyword exch def () } + ifelse + /args exch def + keyword commentword eq { nextline } if + } bind def + +% Get a word argument from args. We do *not* copy the string. + /warg % warg -> string + { args ( ) search + { exch pop exch } + { () } + ifelse /args exch def + } bind def + +% Get an integer argument from args. + /iarg % iarg -> int + { warg cvi + } bind def + +% Get a numeric argument from args. + /narg % narg -> int|real + { warg cvr + dup dup cvi eq { cvi } if + } bind def + +% Convert the remainder of args into a string. + /remarg % remarg -> string + { args copystring + } bind def + +% Get a string argument that occupies the remainder of args. + /sarg % sarg -> string + { args (") anchorsearch + { pop /args exch def } { pop } ifelse + args args length 1 sub get (") 0 get eq + { args 0 args length 1 sub getinterval /args exch def } if + args copystring + } bind def + +% Check that the keyword is the expected one. + /checkline % (EXPECTED-KEYWORD) checkline -> + { dup keyword ne + { (Expected ) print = + (Line=) print keyword print ( ) print args print (\n) print stop + } if + pop + } bind def + +% Read a line and check its keyword. + /getline % (EXPECTED-KEYWORD) getline -> + { nextline checkline + } bind def + +% Find the first/last non-zero bit of a non-zero byte. + /fnzb + { 0 { exch dup 128 ge { pop exit } { dup add exch 1 add } ifelse } + loop + } bind def + /lnzb + { 7 { exch dup 1 and 0 ne { pop exit } { -1 bitshift exch 1 sub } ifelse } + loop + } bind def + +% ------ Type 1 encoding utilities ------ % + +% Parse the side bearing and width information that begins a CharString. +% Arguments: charstring. Result: sbx sby wx wy substring. + /parsesbw + { mark exch lenIV + { % stack: mark ... string dropcount + dup 2 index length exch sub getinterval + dup 0 get dup 32 lt { pop exit } if + dup 246 le + { 139 sub exch 1 } + { dup 250 le + { 247 sub 8 bitshift 108 add 1 index 1 get add exch 2 } + { dup 254 le + { 251 sub 8 bitshift 108 add 1 index 1 get add neg exch 2 } + { pop dup 1 get 128 xor 128 sub + 8 bitshift 1 index 2 get add + 8 bitshift 1 index 3 get add + 8 bitshift 1 index 4 get add exch 5 + } ifelse + } ifelse + } ifelse + } loop + counttomark 3 eq { 0 3 1 roll 0 exch } if + 6 -1 roll pop + } bind def + +% Find the side bearing and width information that begins a CharString. +% Arguments: charstring. Result: charstring sizethroughsbw. + /findsbw + { dup parsesbw 4 { exch pop } repeat skipsbw + } bind def + /skipsbw % charstring sbwprefix -> sizethroughsbw + { length 1 index length exch sub + 2 copy get 12 eq { 2 } { 1 } ifelse add + } bind def + +% Encode a number, and append it to a string. +% Arguments: str num. Result: newstr. + /concatnum + { dup dup -107 ge exch 107 le and + { 139 add 1 string dup 0 3 index put } + { dup dup -1131 ge exch 1131 le and + { dup 0 ge { 16#f694 } { neg 16#fa94 } ifelse add + 2 string dup 0 3 index -8 bitshift put + dup 1 3 index 255 and put + } + { 5 string dup 0 255 put exch + 2 copy 1 exch -24 bitshift 255 and put + 2 copy 2 exch -16 bitshift 255 and put + 2 copy 3 exch -8 bitshift 255 and put + 2 copy 4 exch 255 and put + exch + } + ifelse + } + ifelse exch pop concatstrings + } bind def + +% ------ Point arithmetic utilities ------ % + + /ptadd { exch 4 -1 roll add 3 1 roll add } bind def + /ptexch { 4 2 roll } bind def + /ptneg { neg exch neg exch } bind def + /ptpop { pop pop } bind def + /ptsub { ptneg ptadd } bind def + +% ------ The main program ------ % + + /readBDF % + % readBDF -> + { /xuid exch def % may be null + /uniqueID exch def % may be -1 + /encodingname exch def + /encoding encodingname cvx exec def + /fontname exch def + /psname exch def + /bdfname exch def + gsave % so we can set the CTM to the font matrix + +% Open the input files. We don't open the output file until +% we've done a minimal validity check on the input. + bdfname (r) file /bdfile exch def + /commentword ( ) def + +% Check for the STARTFONT. + (STARTFONT) getline + args (2.1) ne { (Not version 2.1\n) print stop } if + +% Initialize the font. + /Font 20 dict def + Font begin + /FontName fontname def + /PaintType 0 def + /FontType 1 def + uniqueID 0 gt { /UniqueID uniqueID def } if + xuid null ne { /XUID xuid def } if + /Encoding encoding def + /FontInfo 20 dict def + /Private 20 dict def + currentdict end currentdict end + exch begin begin % insert font above environment + +% Initialize the Private dictionary in the font. + Private begin + /-! {string currentfile exch readhexstring pop} readonly def + /-| {string currentfile exch readstring pop} readonly def + /|- {readonly def} readonly def + /| {readonly put} readonly def + /BlueValues [] def + /lenIV lenIV def + /MinFeature {16 16} def + /password 5839 def + /UniqueID uniqueID def + end % Private + +% Invert the Encoding, for synthesizing composite characters. + /decoding encoding length dict def + 0 1 encoding length 1 sub + { dup encoding exch get exch decoding 3 1 roll put } + for + +% Now open the output file. + psname (w) file /psfile exch def + +% Put out a header compatible with the Adobe "standard". + (%!FontType1-1.0: ) ws fontname wt (000.000) wl + (% This is a font description converted from ) ws + bdfname wl + (% by bdftops running on ) ws + statusdict /product get ws ( revision ) ws + revision =string cvs ws (.) wl + +% Copy the initial comments, up to FONT. + true + { nextline + keyword (COMMENT) ne {exit} if + { (% Here are the initial comments from the BDF file:\n%) wl + } if false + (%) ws remarg wl + } loop pop + () wl + /commentword (COMMENT) def % do skip comments from now on + +% Read and process the FONT, SIZE, and FONTBOUNDINGBOX. + % If we cared about FONT, we'd use it here. If the BDF files + % from MIT had PostScript names rather than X names, we would + % care; but what's there is unusable, so we discard FONT. + % The FONTBOUNDINGBOX may not be reliable, so we discard it too. + (FONT) checkline + (SIZE) getline + /pointsize iarg def /xres iarg def /yres iarg def + (FONTBOUNDINGBOX) getline + nextline + +% Initialize the font bounding box bookeeping. + /fbbxo 1000 def + /fbbyo 1000 def + /fbbxe -1000 def + /fbbye -1000 def + +% Read and process the properties. We only care about a few of them. + keyword (STARTPROPERTIES) eq + { iarg + { nextline + properties keyword known + { FontInfo properties keyword get sarg readonly put + } if + } repeat + (ENDPROPERTIES) getline + nextline + } if + +% Compute and set the FontMatrix. + Font /FontMatrix + [ 0.001 0 0 0.001 xres mul yres div 0 0 ] readonly + dup setmatrix put + +% Read and process the header for the bitmaps. + (CHARS) checkline + /ccount iarg def + +% Initialize the CharStrings dictionary. + /charstrings ccount + composites length add + aliases length add + accentedchars length add + 1 add dict def % 1 add for .notdef + /isfixedwidth true def + /fixedwidth null def + /subrcount 0 def + /subrs [] def + +% Read the bitmap data. This reads the remainder of the file. +% We do this before processing the bitmaps so that we can compute +% the correct FontBBox first. + /chardata ccount dict def + ccount -1 1 + { (STARTCHAR) getline + /charname remarg def + (ENCODING) getline + /eindex iarg def + eindex dup 0 ge exch 255 le and + { charname /charname StandardEncoding eindex get def + charname /.notdef eq eindex 0 gt and + { /charname (A) eindex =string cvs concatstrings cvn def + } + if + (/) print charname =string cvs print (,) print print + } + { (/) print charname print + } + ifelse + 10 mod 1 eq { (\n) print flush } if + (SWIDTH) getline + /swx iarg pointsize mul 1000 div xres mul 72 div def + /swy iarg pointsize mul 1000 div xres mul 72 div def + (DWIDTH) getline % Ignore, use SWIDTH instead + (BBX) getline + /bbw iarg def /bbh iarg def /bbox iarg def /bboy iarg def + nextline + keyword (ATTRIBUTES) eq + { nextline + } if + (BITMAP) checkline + +% Update the font bounding box. + /fbbxo fbbxo bbox .min def + /fbbyo fbbyo bboy .min def + /fbbxe fbbxe bbox bbw add .max def + /fbbye fbbye bboy bbh add .max def + +% Read the bits for this character. + /raster bbw 7 add 8 idiv def + /cbits raster bbh mul string def + cbits length 0 gt + { 0 raster cbits length raster sub + { cbits exch raster getinterval + bdfile buffer readline not + { (EOF in bitmap\n) print stop } if + % stack has + 0 () /SubFileDecode filter + exch 2 copy readhexstring pop pop pop closefile + } for + } if + + (ENDCHAR) getline + +% Save the character data. + chardata charname [swx swy bbw bbh bbox bboy cbits] put + } for + + (ENDFONT) getline + +% Allocate the buffers for the bitmap and the outline, +% according to the font bounding box. + /fbbw fbbxe fbbxo sub def + /fbbh fbbye fbbyo sub def + /fraster fbbw 7 add 8 idiv def + /bits fraster fbbh mul 200 .max 65535 .min string def + /outline bits length 16 mul 65535 .min string def + +% Process the characters. + chardata + { exch /charname exch def aload pop + /cbits exch def + /bboy exch def /bbox exch def + /bbh exch def /bbw exch def + /swy exch def /swx exch def + +% The bitmap handed to type1imagepath must have the correct height, +% because type1imagepath uses this to compute the scale factor, +% so we have to clear the unused parts of it. + /raster bbw 7 add 8 idiv def + bits dup 0 1 raster fbbh mul 1 sub + { 0 put dup } for + pop pop + bits raster fbbh bbh sub mul cbits putinterval + +% Compute the font entry, converting the bitmap to an outline. + bits 0 raster fbbh mul getinterval % the bitmap image + bbw fbbh % bitmap width & height + swx swy % width x & y + bbox neg bboy neg % origin x & y + % Account for lenIV when converting the outline. + outline lenIV outline length lenIV sub getinterval + type1imagepath + length lenIV add + outline exch 0 exch getinterval + +% Check for a fixed width font. + isfixedwidth + { fixedwidth null eq + { /fixedwidth swx def } + { fixedwidth swx ne { /isfixedwidth false def } if } + ifelse + } if + +% Finish up the character. + copystring + charname exch charstrings 3 1 roll put + } forall + +% Add CharStrings entries for aliases. + aliases + { charstrings 2 index known not charstrings 2 index known and + { charstrings exch get charstrings 3 1 roll put + } + { pop pop + } + ifelse + } + forall + +% If this is not a fixed-width font, synthesize missing characters +% out of available ones. + isfixedwidth not + { false composites + { 1 index charstrings exch known not + 1 index { decoding exch known and } forall + { ( /) print 1 index bits cvs print + /combine exch def + 0 1 combine length 1 sub + { dup combine exch get decoding exch get + bits 3 1 roll put + } for + bits 0 combine length getinterval copystring + [ exch /compose_proc load aload pop ] cvx + charstrings 3 1 roll put + pop true + } + { pop pop } + ifelse + } + forall flush + { Private /composematrix matrix put + Private /compose /compose load put + } + if + } + if + +% Synthesize accented characters with seac if needed and possible. + accentedchars + { aload pop /accent exch def /base exch def + buffer cvs /accented exch def + charstrings accented known not + charstrings base known and + charstrings accent known and + StandardDecoding base known and + StandardDecoding accent known and + encoding StandardDecoding base get get base eq and + encoding StandardDecoding accent get get accent eq and + { ( /) print accented print + charstrings base get findsbw 0 exch getinterval + /acstring exch def % start with sbw of base + charstrings accent get parsesbw + 4 { pop } repeat % just leave sbx + acstring exch concatnum + 0 concatnum 0 concatnum % adx ady + decoding base get concatnum % bchar + decoding accent get concatnum % achar + s_seac concatstrings + charstrings exch accented copystring exch put + } if + } forall + +% Make a CharStrings entry for .notdef. + outline lenIV <8b8b0d0e> putinterval % 0 0 hsbw endchar + charstrings /.notdef outline 0 lenIV 4 add getinterval copystring put + +% Encrypt the CharStrings and Subrs (in place). + charstrings + { % Be careful not to encrypt aliased characters twice, + % since they share their CharString. + aliases 2 index known + { charstrings aliases 3 index get .knownget + { 1 index ne } + { true } + ifelse + } + { true + } + ifelse + 1 index type /stringtype eq and + { 4330 exch dup .type1encrypt exch pop + readonly charstrings 3 1 roll put + } + { pop pop + } + ifelse + } + forall + 0 1 subrcount 1 sub + { dup subrs exch get + 4330 exch dup .type1encrypt exch pop + subrs 3 1 roll put + } + for + +% Make most of the remaining entries in the font dictionaries. + +% The Type 1 font machinery really only works with a 1000 unit +% character coordinate system. Set this up here, by computing the factor +% to make the X entry in the FontMatrix come out at exactly 0.001. + /fontscale 1000 fbbh div yres mul xres div def + Font /FontBBox + [ fbbxo fontscale mul + fbbyo fontscale mul + fbbxe fontscale mul + fbbye fontscale mul + ] cvx readonly put + Font /CharStrings charstrings readonly put + FontInfo /FullName known not + { % Some programs insist on FullName being present. + FontInfo /FullName FontName dup length string cvs put + } + if + FontInfo /isFixedPitch isfixedwidth put + subrcount 0 gt + { Private /Subrs subrs 0 subrcount getinterval readonly put + } if + +% Determine the italic angle and underline position +% by actually installing the font. + save + /_temp_ Font definefont setfont + [1000 0 0 1000 0 0] setmatrix % mitigate rounding problems +% The italic angle is the multiple of -5 degrees +% that minimizes the width of the 'I'. + 0 9999 0 5 85 + { dup rotate + newpath 0 0 moveto (I) false charpath + dup neg rotate + pathbbox pop exch pop exch sub + dup 3 index lt { 4 -2 roll } if + pop pop + } + for pop +% The underline position is halfway between the bottom of the 'A' +% and the bottom of the FontBBox. + newpath 0 0 moveto (A) false charpath + FontMatrix concat + pathbbox pop pop exch pop +% Put the values in FontInfo. + 3 -1 roll + restore + Font /FontBBox get 1 get add 2 div cvi + dup FontInfo /UnderlinePosition 3 -1 roll put + 2 div abs FontInfo /UnderlineThickness 3 -1 roll put + FontInfo /ItalicAngle 3 -1 roll put + +% Clean up and finish. + grestore + bdfile closefile + Font currentdict end end begin % remove font from dict stack + (\n) print flush + + } bind def + +% ------ Reader for AFM files ------ % + +% Dictionary for looking up character keywords + /cmdict 6 dict dup begin + /C { /c iarg def } def + /N { /n warg copystring def } def + /WX { /w narg def } def + /W0X /WX load def + /W /WX load def + /W0 /WX load def + end def + + /readAFM % fontdict afmfilename readAFM -> fontdict + { (r) file /bdfile exch def + /Font exch def + /commentword (Comment) def + +% Check for the StartFontMetrics. + (StartFontMetrics) getline + args cvr 2.0 lt { (Not version 2.0 or greater\n) print stop } if + +% Look for StartCharMetrics, then parse the character metrics. +% The only information we care about is the X width. + /metrics 0 dict def + { nextline + keyword (EndFontMetrics) eq { exit } if + keyword (StartCharMetrics) eq + { iarg dup dict /metrics exch def + { /c -1 def /n null def /w null def + nextline buffer + { token not { exit } if + dup cmdict exch known + { exch /args exch def cmdict exch get exec args } + { pop } + ifelse + } loop + c 0 ge n null ne or w null ne and + { n null eq { /n Font /Encoding get c get def } if + metrics n w put + } + if + } + repeat + (EndCharMetrics) getline + } if + } loop + +% Insert the metrics in the font. + metrics length 0 ne + { Font /Metrics metrics readonly put + } if + Font + } bind def + +end % envBDF + +% Enter the main program in the current dictionary. +/bdfafmtops % infilename afmfilename* outfilename fontname + % encodingname uniqueID xuid + { envBDF begin + 7 -2 roll exch 7 2 roll % afm* in out fontname encodingname uniqueID xuid + readBDF % afm* font + exch { readAFM } forall + save exch + dup /FontName get exch definefont + setfont + psfile writefont + restore + psfile closefile + end + } bind def + +% If the program was invoked from the command line, run it now. +[ shellarguments + { counttomark 4 ge + { dup 0 get + dup 48 ge exch 57 le and % last arg starts with a digit? + { /StandardEncoding } % no encodingname + { cvn } % have encodingname + ifelse + exch (.) search % next-to-last arg has . in it? + { mark 4 1 roll % have xuid + { cvi exch pop exch (.) search not { exit } if } + loop cvi ] + 3 -1 roll cvi exch + } + { cvi null % no xuid + } + ifelse + counttomark 5 roll + counttomark 6 sub array astore + 7 -2 roll cvn 7 -3 roll % make sure fontname is a name + bdfafmtops + } + { cleartomark + (Usage:\n bdftops xx.bdf [yy1.afm ...] zz.gsf fontname uniqueID [xuid] [encodingname]\n) print flush + mark + } + ifelse + } +if pop diff --git a/Master/tlpkg/tlgs/lib/bj8.rpd b/Master/tlpkg/tlgs/lib/bj8.rpd old mode 100755 new mode 100644 diff --git a/Master/tlpkg/tlgs/lib/caption.ps b/Master/tlpkg/tlgs/lib/caption.ps old mode 100755 new mode 100644 index a41d99c5481..6f0a7d31000 --- a/Master/tlpkg/tlgs/lib/caption.ps +++ b/Master/tlpkg/tlgs/lib/caption.ps @@ -1,56 +1,56 @@ -%! -% Copyright (C) 1995 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: caption.ps 6300 2005-12-28 19:56:24Z giles $ -% Add a "caption" to the bottom of each page. -/captionsize 20 def -/caption - { /Helvetica //captionsize selectfont - (Printed by Aladdin's XXYYZZ) show - /Symbol //captionsize selectfont - (\324) show % trademarkserif - /Helvetica //captionsize selectfont - ( product) show - } bind def - -10 dict begin -gsave - initgraphics - clippath pathbbox - pop exch 36 add /by exch def - % We can't use stringwidth, so we have to show and measure. - gsave - 0 0 0 0 rectclip - 0 0 moveto caption currentpoint pop /bw exch def - grestore - add bw sub 2 div /bx exch def - % We don't have the font bbox available, so we guess. - /bh captionsize 1.05 mul def -grestore -/showcaption - { gsave - initgraphics - //bx 9 sub //by 9 sub //bw 18 add //bh 18 add - 1 setgray 4 copy rectfill 0 setgray 1.5 setlinewidth rectstroke - //bx //by moveto //caption exec - grestore - } bind def -<< /EndPage [ - /showcaption load /exec load - currentpagedevice /EndPage get /exec load - ] cvx ->> setpagedevice -end +%! +% Copyright (C) 1995 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: caption.ps 6300 2005-12-28 19:56:24Z giles $ +% Add a "caption" to the bottom of each page. +/captionsize 20 def +/caption + { /Helvetica //captionsize selectfont + (Printed by Aladdin's XXYYZZ) show + /Symbol //captionsize selectfont + (\324) show % trademarkserif + /Helvetica //captionsize selectfont + ( product) show + } bind def + +10 dict begin +gsave + initgraphics + clippath pathbbox + pop exch 36 add /by exch def + % We can't use stringwidth, so we have to show and measure. + gsave + 0 0 0 0 rectclip + 0 0 moveto caption currentpoint pop /bw exch def + grestore + add bw sub 2 div /bx exch def + % We don't have the font bbox available, so we guess. + /bh captionsize 1.05 mul def +grestore +/showcaption + { gsave + initgraphics + //bx 9 sub //by 9 sub //bw 18 add //bh 18 add + 1 setgray 4 copy rectfill 0 setgray 1.5 setlinewidth rectstroke + //bx //by moveto //caption exec + grestore + } bind def +<< /EndPage [ + /showcaption load /exec load + currentpagedevice /EndPage get /exec load + ] cvx +>> setpagedevice +end diff --git a/Master/tlpkg/tlgs/lib/cat.ps b/Master/tlpkg/tlgs/lib/cat.ps old mode 100755 new mode 100644 diff --git a/Master/tlpkg/tlgs/lib/cid2code.ps b/Master/tlpkg/tlgs/lib/cid2code.ps old mode 100755 new mode 100644 index 475cf189baf..af7ff22774f --- a/Master/tlpkg/tlgs/lib/cid2code.ps +++ b/Master/tlpkg/tlgs/lib/cid2code.ps @@ -1,160 +1,160 @@ -% Copyright (C) 1998, 2000 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: cid2code.ps 6300 2005-12-28 19:56:24Z giles $ -% Construct an inverse map from CIDs to codes. - -% Create an inverse map from CIDs to code values. -% We only use this for 16-bit Unicode, so it has some limitations. -% After invoking .cmap2code, loading a CMap file prints out the map -% instead of doing what it usually does. For example: -% -% gs -dNODISPLAY -dBATCH lib/cid2code.ps -c .cmap2code\ -% -f Resource/CMap/UniJIS-UCS2-H > mapfile - -/.cmap2codedict 10 dict begin - -/begincmap { - mark -} def -/endcmap { - % Stack: mark code_lo1 code_hi1 cid1 ... - 20 dict begin - /depth counttomark 3 sub def - % Do a first pass to determine the maximum CID. - 0 0 3 depth { - 1 add /d exch def - d index d 2 add index 1 get add d 3 add index 1 get sub .max - } for - 1 add /ncid exch def - /map ncid 2 mul string def - % Now fill in the map. - 0 3 depth { - /d exch def - d index 2 mul /cid2 exch def - d 1 add index /hi exch def - d 2 add index 2 string copy /lo exch def - lo 1 get 1 hi 1 get { - map cid2 lo 0 get put - map cid2 1 add 3 -1 roll put - /cid2 cid2 2 add def - } for - } for - % Print the map. - (%stdout) (w) file - dup (<) print - dup /ASCIIHexEncode filter - dup map writestring - closefile - () = flush - closefile - end -} def -%/begincodespacerange -/endcodespacerange {cleartomark} def -%/usecmap - -%/beginbfchar -/endbfchar {cleartomark} def -%/beginbfrange -/endbfrange {cleartomark} def - -%/begincidchar -/endcidchar { - counttomark 2 idiv { dup counttomark 1 add 3 roll } repeat pop -} def -%/begincidrange -/endcidrange { - counttomark 1 add -1 roll pop -} def - -%/beginnotdefchar -/endnotdefchar {cleartomark} def -%/beginnotdefrange -/endnotdefrange {cleartomark} def - -currentdict end readonly def - -/.cmap2code { % - .cmap2code - - /CIDInit /ProcSet findresource dup length dict copy - .cmap2codedict { 3 copy put pop pop } forall - /CIDInit exch /ProcSet defineresource pop -} def - -% Extract and print reverse mapping information from a cid2code.txt file. -/.printhex2 { % .printhex2 - - (<) print - 16#10000 add 16 =string cvrs 1 4 getinterval print - (>) print -} def -/.cid2code { % .cid2code - - 30 dict begin - /column exch def - (r) file /f exch def - (%!) = - (/CIDInit /ProcSet findresource begin 12 dict begin begincmap) = - % Print the information from the template. - { - exch ==only ( ) print - dup type /dicttype eq { - dup length =only ( dict dup begin) = { - ( ) print exch ===only ( ) print ===only ( def) = - } forall (end def) = - } { - ===only - } ifelse ( def) = - } forall - % Read the data from the cid2code.txt file. - { - f =string readline pop (CID\t) anchorsearch { pop pop exit } if pop - } loop - /map [ { - f =string readline not { pop exit } if - column { (\t) search pop pop pop } repeat - (\t) search { exch pop exch pop } if - (,) search { exch pop exch pop } if - dup length 4 ne { pop (*) } if - dup (*) eq { pop (0000) } if - (16#) exch concatstrings cvi - } loop ] def - % Print the code space range(s). - /maxcid map length 1 sub def - mark maxcid - dup 255 and 255 eq { - 0 exch - } { - dup 16#ff00 and exch 0 2 index 1 sub - } ifelse - counttomark 2 idiv dup =only ( begincodespacerange) = { - exch .printhex2 .printhex2 () = - } repeat (endcodespacerange) = - % Print the map data. - 0 1 100 maxcid { - /lo exch def - /hi lo 99 add maxcid .min def - 0 lo 1 hi { map exch get 0 ne { 1 add } if } for - dup 0 eq { - pop - } { - =only ( begincidchar) = lo 1 hi { - map 1 index get dup 0 eq { pop pop } { exch .printhex2 = } ifelse - } for (endcidchar) = - } ifelse - } for - % Wrap up. - (endcmap CMapName currentdict /CMap defineresource pop end end) = - f closefile - end -} bind def +% Copyright (C) 1998, 2000 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: cid2code.ps 6300 2005-12-28 19:56:24Z giles $ +% Construct an inverse map from CIDs to codes. + +% Create an inverse map from CIDs to code values. +% We only use this for 16-bit Unicode, so it has some limitations. +% After invoking .cmap2code, loading a CMap file prints out the map +% instead of doing what it usually does. For example: +% +% gs -dNODISPLAY -dBATCH lib/cid2code.ps -c .cmap2code\ +% -f Resource/CMap/UniJIS-UCS2-H > mapfile + +/.cmap2codedict 10 dict begin + +/begincmap { + mark +} def +/endcmap { + % Stack: mark code_lo1 code_hi1 cid1 ... + 20 dict begin + /depth counttomark 3 sub def + % Do a first pass to determine the maximum CID. + 0 0 3 depth { + 1 add /d exch def + d index d 2 add index 1 get add d 3 add index 1 get sub .max + } for + 1 add /ncid exch def + /map ncid 2 mul string def + % Now fill in the map. + 0 3 depth { + /d exch def + d index 2 mul /cid2 exch def + d 1 add index /hi exch def + d 2 add index 2 string copy /lo exch def + lo 1 get 1 hi 1 get { + map cid2 lo 0 get put + map cid2 1 add 3 -1 roll put + /cid2 cid2 2 add def + } for + } for + % Print the map. + (%stdout) (w) file + dup (<) print + dup /ASCIIHexEncode filter + dup map writestring + closefile + () = flush + closefile + end +} def +%/begincodespacerange +/endcodespacerange {cleartomark} def +%/usecmap + +%/beginbfchar +/endbfchar {cleartomark} def +%/beginbfrange +/endbfrange {cleartomark} def + +%/begincidchar +/endcidchar { + counttomark 2 idiv { dup counttomark 1 add 3 roll } repeat pop +} def +%/begincidrange +/endcidrange { + counttomark 1 add -1 roll pop +} def + +%/beginnotdefchar +/endnotdefchar {cleartomark} def +%/beginnotdefrange +/endnotdefrange {cleartomark} def + +currentdict end readonly def + +/.cmap2code { % - .cmap2code - + /CIDInit /ProcSet findresource dup length dict copy + .cmap2codedict { 3 copy put pop pop } forall + /CIDInit exch /ProcSet defineresource pop +} def + +% Extract and print reverse mapping information from a cid2code.txt file. +/.printhex2 { % .printhex2 - + (<) print + 16#10000 add 16 =string cvrs 1 4 getinterval print + (>) print +} def +/.cid2code { % .cid2code - + 30 dict begin + /column exch def + (r) file /f exch def + (%!) = + (/CIDInit /ProcSet findresource begin 12 dict begin begincmap) = + % Print the information from the template. + { + exch ==only ( ) print + dup type /dicttype eq { + dup length =only ( dict dup begin) = { + ( ) print exch ===only ( ) print ===only ( def) = + } forall (end def) = + } { + ===only + } ifelse ( def) = + } forall + % Read the data from the cid2code.txt file. + { + f =string readline pop (CID\t) anchorsearch { pop pop exit } if pop + } loop + /map [ { + f =string readline not { pop exit } if + column { (\t) search pop pop pop } repeat + (\t) search { exch pop exch pop } if + (,) search { exch pop exch pop } if + dup length 4 ne { pop (*) } if + dup (*) eq { pop (0000) } if + (16#) exch concatstrings cvi + } loop ] def + % Print the code space range(s). + /maxcid map length 1 sub def + mark maxcid + dup 255 and 255 eq { + 0 exch + } { + dup 16#ff00 and exch 0 2 index 1 sub + } ifelse + counttomark 2 idiv dup =only ( begincodespacerange) = { + exch .printhex2 .printhex2 () = + } repeat (endcodespacerange) = + % Print the map data. + 0 1 100 maxcid { + /lo exch def + /hi lo 99 add maxcid .min def + 0 lo 1 hi { map exch get 0 ne { 1 add } if } for + dup 0 eq { + pop + } { + =only ( begincidchar) = lo 1 hi { + map 1 index get dup 0 eq { pop pop } { exch .printhex2 = } ifelse + } for (endcidchar) = + } ifelse + } for + % Wrap up. + (endcmap CMapName currentdict /CMap defineresource pop end end) = + f closefile + end +} bind def diff --git a/Master/tlpkg/tlgs/lib/decrypt.ps b/Master/tlpkg/tlgs/lib/decrypt.ps old mode 100755 new mode 100644 index b172f6d83b4..2108173ea9f --- a/Master/tlpkg/tlgs/lib/decrypt.ps +++ b/Master/tlpkg/tlgs/lib/decrypt.ps @@ -1,15 +1,15 @@ -%! -% Decrypt an eexec-encoded file. -% $Id: decrypt.ps 6300 2005-12-28 19:56:24Z giles $ - -(t.in) (r) file /in exch def -(t.out) (w) file /out exch def -256 string /buf exch def -55665 % eexec encryption seed - { in buf readhexstring /more exch def - dup .type1decrypt out exch writestring - more not { exit } if - } loop -in closefile -out closefile -quit +%! +% Decrypt an eexec-encoded file. +% $Id: decrypt.ps 6300 2005-12-28 19:56:24Z giles $ + +(t.in) (r) file /in exch def +(t.out) (w) file /out exch def +256 string /buf exch def +55665 % eexec encryption seed + { in buf readhexstring /more exch def + dup .type1decrypt out exch writestring + more not { exit } if + } loop +in closefile +out closefile +quit diff --git a/Master/tlpkg/tlgs/lib/docie.ps b/Master/tlpkg/tlgs/lib/docie.ps old mode 100755 new mode 100644 index 31b4df74ec0..b74cd151ac2 --- a/Master/tlpkg/tlgs/lib/docie.ps +++ b/Master/tlpkg/tlgs/lib/docie.ps @@ -1,220 +1,220 @@ -% Copyright (C) 1995 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: docie.ps 8411 2007-11-28 18:39:59Z ray $ -% docie.ps -% Emulate CIE algorithms in PostScript. - -% ---------------- Auxiliary procedures ---------------- % - -/r1default [0 1] def -/r3default [0 1 0 1 0 1] def - -/apply3 % [ ] apply3 - { { 4 -1 roll exch exec } forall - } bind def - -/restrict % restrict - { 3 1 roll .max .min - } bind def - -/restrict3 % [ ... ] restrict3 - { aload pop - 7 -1 roll 3 1 roll restrict 7 1 roll - 5 -1 roll 3 1 roll restrict 5 1 roll - restrict 3 1 roll - } bind def - -/rescale % rescale - { 1 index sub 3 1 roll sub exch div 0 .max 1 .min - } bind def - -/rescale3 % [ ... ] rescale3 - { aload pop - 7 -1 roll 3 1 roll rescale 7 1 roll - 5 -1 roll 3 1 roll rescale 5 1 roll - rescale 3 1 roll - } bind def - -/mmult3 % [ ... ] mmult3 - % - { 4 -1 roll dup dup 6 -1 roll dup dup 8 -1 roll dup dup - 10 -1 roll { 10 -1 roll mul } forall - % Stack: u1 v1 w1 u2 v2 w2 u3 v3 w3 - 4 -1 roll add 6 -1 roll add - % Stack: u1 v1 u2 v2 u3 v3 w' - 7 1 roll 3 -1 roll add 4 -1 roll add - % Stack: w' u1 u2 u3 v' - 5 1 roll add add 3 1 roll - } bind def - -/minvert3 % [ ... ] minvert3 - % [ ... ] - { 16 dict begin - aload pop { I H G F E D C B A } { exch def } forall - /coa E I mul F H mul sub def - /cob F G mul D I mul sub def - /coc D H mul E G mul sub def - /det A coa mul B cob mul add C coc mul add def - [ coa det div - C H mul B I mul sub det div - B F mul C E mul sub det div - cob det div - A I mul C G mul sub det div - C D mul A F mul sub det div - coc det div - B G mul A H mul sub det div - A E mul B D mul sub det div - ] - end - } bind def - -/print1 - { print dup == - } bind def - -/print3 - { print 3 array astore dup == aload pop - } bind def - -% ---------------- Mapping to XYZ ---------------- % - -/csmap % csmap - { 3 index /RangeLMN .knownget not { r3default } if restrict3 -DOCIEDEBUG { (After RangeLMN Decode: ) print3 } if - 3 index /DecodeLMN .knownget { apply3 } if -DOCIEDEBUG { (After DecodeLMN Decode: ) print3 } if - 3 index /MatrixLMN .knownget { mmult3 } if -DOCIEDEBUG { (After MatrixLMN Decode: ) print3 } if - } bind def - -/csciea % csciea - { 1 index /RangeA .knownget not { r1default aload pop } if restrict -DOCIEDEBUG { (After RangeA Decode: ) print1 } if - 1 index /DecodeA .knownget { exec } if -DOCIEDEBUG { (After DecodeA Decode: ) print1 } if - 1 index /MatrixA .knownget - { { 1 index mul exch } forall pop } - { dup dup } - ifelse -DOCIEDEBUG { (After MatrixA Decode: ) print3 } if - csmap - } bind def - -/cscieabc % cscieabc - { 3 index /RangeABC .knownget not { r3default } if restrict3 -DOCIEDEBUG { (After RangeABC Decode: ) print3 } if - 3 index /DecodeABC .knownget { apply3 } if -DOCIEDEBUG { (After DecodeABC Decode: ) print3 } if - 3 index /MatrixABC .knownget { mmult3 } if -DOCIEDEBUG { (After MatrixABC Decode: ) print3 } if - csmap - } bind def - -% ---------------- Rendering from XYZ ---------------- % - -/lookup3 % lookup3 - % - { 3 -1 roll 3 index 0 get 1 sub mul - 3 -1 roll 3 index 1 get 1 sub mul - 3 -1 roll 3 index 2 get 1 sub mul - % Stack: rtable ia ib ic -DOCIEDEBUG { (RenderTable indices: ) print3 mark 5 1 roll } if - 3 -1 roll round cvi 3 index 3 get exch get - % Stack: rtable ib ic string - 3 -1 roll round cvi 3 index 2 get mul - % Stack: rtable ic string ib*nc - 3 -1 roll round cvi add 2 index 4 get mul - % Stack: rtable string index - 2 index 4 get getinterval - % Stack: rtable bytes -DOCIEDEBUG { (RenderTable values: ) print (<) print (%stdout) (w) file 1 index writehexstring (>) = } if - } bind def - -/bpdefault [0 0 0] def - -/crmap % crmap ... - { -DOCIEDEBUG { (CIE XYZ = ) print3 } if - 3 index /MatrixPQR .knownget { mmult3 } if -DOCIEDEBUG { (After MatrixPQR: ) print3 } if - 4 index /WhitePoint get - 5 index /BlackPoint .knownget not { bpdefault } if - 5 index /WhitePoint get - 6 index /BlackPoint .knownget not { bpdefault } if - 4 - { 4 -1 roll aload pop - % Stack: csdict crdict x y z pt pt pt px py pz - 3 copy 12 index /MatrixPQR .knownget { mmult3 } if 6 array astore - } - repeat - % Stack: csdict crdict x y z wps+ bps+ wpd+ bpd+ - 9 -1 roll pop % get rid of csdict - 7 4 roll - 7 index /TransformPQR get - { % Stack: crdict wps+ bps+ wpd+ bpd+ u v w proc - 8 copy exch pop exch pop - exec exch pop 4 -1 roll pop - } - forall - 7 3 roll pop pop pop pop % get rid of White/BlackPoints -DOCIEDEBUG { (After TransformPQR: ) print3 } if - 3 index /MatrixPQR .knownget { minvert3 mmult3 } if -DOCIEDEBUG { (After MatrixPQR': ) print3 } if - 3 index /MatrixLMN .knownget { mmult3 } if -DOCIEDEBUG { (After MatrixLMN Encode: ) print3 } if - 3 index /EncodeLMN .knownget { apply3 } if -DOCIEDEBUG { (After EncodeLMN Encode: ) print3 } if - 3 index /RangeLMN .knownget not { r3default } if restrict3 -DOCIEDEBUG { (After RangeLMN Encode: ) print3 } if - 3 index /MatrixABC .knownget { mmult3 } if -DOCIEDEBUG { (After MatrixABC Encode: ) print3 } if - 3 index /EncodeABC .knownget { apply3 } if -DOCIEDEBUG { (After EncodeABC Encode: ) print3 } if - 3 index /RangeABC .knownget not { r3default } if - 5 -1 roll /RenderTable .knownget - { % Stack: u v w ranges rtable - 5 1 roll rescale3 -DOCIEDEBUG { (Rescaled ABC: ) print3 } if - % Stack: rtable a b c - lookup3 - % Stack: rtable bytes - 0 1 3 index 4 get 1 sub - { % Stack: values rtable bytes c - 2 copy get 255 div - % Stack: values rtable bytes c v - 3 index 3 -1 roll 5 add get exec 3 1 roll - } - for pop pop -DOCIEDEBUG { (After RenderTableT: ) print ] dup == aload pop } if - } - { restrict3 -DOCIEDEBUG { (After RangeABC Encode: ) print3 } if - } - ifelse - } bind def - -% ---------------- Top level control ---------------- % - -/mapdict mark - /CIEBasedA { 1 get exch csciea currentcolorrendering 4 1 roll crmap } bind - /DeviceGray { pop /DefaultGray /ColorSpace findresource 1 get exch csciea currentcolorrendering 4 1 roll crmap } bind - /CIEBasedABC { 1 get 4 1 roll cscieabc currentcolorrendering 4 1 roll crmap } bind - /DeviceRGB { pop /DefaultRGB /ColorSpace findresource 1 get 4 1 roll cscieabc currentcolorrendering 4 1 roll crmap } bind -.dicttomark def -/mapcie % mapcie ... - % mapcie ... - { currentcolorspace dup 0 get //mapdict exch get exec - } bind def +% Copyright (C) 1995 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: docie.ps 8411 2007-11-28 18:39:59Z ray $ +% docie.ps +% Emulate CIE algorithms in PostScript. + +% ---------------- Auxiliary procedures ---------------- % + +/r1default [0 1] def +/r3default [0 1 0 1 0 1] def + +/apply3 % [ ] apply3 + { { 4 -1 roll exch exec } forall + } bind def + +/restrict % restrict + { 3 1 roll .max .min + } bind def + +/restrict3 % [ ... ] restrict3 + { aload pop + 7 -1 roll 3 1 roll restrict 7 1 roll + 5 -1 roll 3 1 roll restrict 5 1 roll + restrict 3 1 roll + } bind def + +/rescale % rescale + { 1 index sub 3 1 roll sub exch div 0 .max 1 .min + } bind def + +/rescale3 % [ ... ] rescale3 + { aload pop + 7 -1 roll 3 1 roll rescale 7 1 roll + 5 -1 roll 3 1 roll rescale 5 1 roll + rescale 3 1 roll + } bind def + +/mmult3 % [ ... ] mmult3 + % + { 4 -1 roll dup dup 6 -1 roll dup dup 8 -1 roll dup dup + 10 -1 roll { 10 -1 roll mul } forall + % Stack: u1 v1 w1 u2 v2 w2 u3 v3 w3 + 4 -1 roll add 6 -1 roll add + % Stack: u1 v1 u2 v2 u3 v3 w' + 7 1 roll 3 -1 roll add 4 -1 roll add + % Stack: w' u1 u2 u3 v' + 5 1 roll add add 3 1 roll + } bind def + +/minvert3 % [ ... ] minvert3 + % [ ... ] + { 16 dict begin + aload pop { I H G F E D C B A } { exch def } forall + /coa E I mul F H mul sub def + /cob F G mul D I mul sub def + /coc D H mul E G mul sub def + /det A coa mul B cob mul add C coc mul add def + [ coa det div + C H mul B I mul sub det div + B F mul C E mul sub det div + cob det div + A I mul C G mul sub det div + C D mul A F mul sub det div + coc det div + B G mul A H mul sub det div + A E mul B D mul sub det div + ] + end + } bind def + +/print1 + { print dup == + } bind def + +/print3 + { print 3 array astore dup == aload pop + } bind def + +% ---------------- Mapping to XYZ ---------------- % + +/csmap % csmap + { 3 index /RangeLMN .knownget not { r3default } if restrict3 +DOCIEDEBUG { (After RangeLMN Decode: ) print3 } if + 3 index /DecodeLMN .knownget { apply3 } if +DOCIEDEBUG { (After DecodeLMN Decode: ) print3 } if + 3 index /MatrixLMN .knownget { mmult3 } if +DOCIEDEBUG { (After MatrixLMN Decode: ) print3 } if + } bind def + +/csciea % csciea + { 1 index /RangeA .knownget not { r1default aload pop } if restrict +DOCIEDEBUG { (After RangeA Decode: ) print1 } if + 1 index /DecodeA .knownget { exec } if +DOCIEDEBUG { (After DecodeA Decode: ) print1 } if + 1 index /MatrixA .knownget + { { 1 index mul exch } forall pop } + { dup dup } + ifelse +DOCIEDEBUG { (After MatrixA Decode: ) print3 } if + csmap + } bind def + +/cscieabc % cscieabc + { 3 index /RangeABC .knownget not { r3default } if restrict3 +DOCIEDEBUG { (After RangeABC Decode: ) print3 } if + 3 index /DecodeABC .knownget { apply3 } if +DOCIEDEBUG { (After DecodeABC Decode: ) print3 } if + 3 index /MatrixABC .knownget { mmult3 } if +DOCIEDEBUG { (After MatrixABC Decode: ) print3 } if + csmap + } bind def + +% ---------------- Rendering from XYZ ---------------- % + +/lookup3 % lookup3 + % + { 3 -1 roll 3 index 0 get 1 sub mul + 3 -1 roll 3 index 1 get 1 sub mul + 3 -1 roll 3 index 2 get 1 sub mul + % Stack: rtable ia ib ic +DOCIEDEBUG { (RenderTable indices: ) print3 mark 5 1 roll } if + 3 -1 roll round cvi 3 index 3 get exch get + % Stack: rtable ib ic string + 3 -1 roll round cvi 3 index 2 get mul + % Stack: rtable ic string ib*nc + 3 -1 roll round cvi add 2 index 4 get mul + % Stack: rtable string index + 2 index 4 get getinterval + % Stack: rtable bytes +DOCIEDEBUG { (RenderTable values: ) print (<) print (%stdout) (w) file 1 index writehexstring (>) = } if + } bind def + +/bpdefault [0 0 0] def + +/crmap % crmap ... + { +DOCIEDEBUG { (CIE XYZ = ) print3 } if + 3 index /MatrixPQR .knownget { mmult3 } if +DOCIEDEBUG { (After MatrixPQR: ) print3 } if + 4 index /WhitePoint get + 5 index /BlackPoint .knownget not { bpdefault } if + 5 index /WhitePoint get + 6 index /BlackPoint .knownget not { bpdefault } if + 4 + { 4 -1 roll aload pop + % Stack: csdict crdict x y z pt pt pt px py pz + 3 copy 12 index /MatrixPQR .knownget { mmult3 } if 6 array astore + } + repeat + % Stack: csdict crdict x y z wps+ bps+ wpd+ bpd+ + 9 -1 roll pop % get rid of csdict + 7 4 roll + 7 index /TransformPQR get + { % Stack: crdict wps+ bps+ wpd+ bpd+ u v w proc + 8 copy exch pop exch pop + exec exch pop 4 -1 roll pop + } + forall + 7 3 roll pop pop pop pop % get rid of White/BlackPoints +DOCIEDEBUG { (After TransformPQR: ) print3 } if + 3 index /MatrixPQR .knownget { minvert3 mmult3 } if +DOCIEDEBUG { (After MatrixPQR': ) print3 } if + 3 index /MatrixLMN .knownget { mmult3 } if +DOCIEDEBUG { (After MatrixLMN Encode: ) print3 } if + 3 index /EncodeLMN .knownget { apply3 } if +DOCIEDEBUG { (After EncodeLMN Encode: ) print3 } if + 3 index /RangeLMN .knownget not { r3default } if restrict3 +DOCIEDEBUG { (After RangeLMN Encode: ) print3 } if + 3 index /MatrixABC .knownget { mmult3 } if +DOCIEDEBUG { (After MatrixABC Encode: ) print3 } if + 3 index /EncodeABC .knownget { apply3 } if +DOCIEDEBUG { (After EncodeABC Encode: ) print3 } if + 3 index /RangeABC .knownget not { r3default } if + 5 -1 roll /RenderTable .knownget + { % Stack: u v w ranges rtable + 5 1 roll rescale3 +DOCIEDEBUG { (Rescaled ABC: ) print3 } if + % Stack: rtable a b c + lookup3 + % Stack: rtable bytes + 0 1 3 index 4 get 1 sub + { % Stack: values rtable bytes c + 2 copy get 255 div + % Stack: values rtable bytes c v + 3 index 3 -1 roll 5 add get exec 3 1 roll + } + for pop pop +DOCIEDEBUG { (After RenderTableT: ) print ] dup == aload pop } if + } + { restrict3 +DOCIEDEBUG { (After RangeABC Encode: ) print3 } if + } + ifelse + } bind def + +% ---------------- Top level control ---------------- % + +/mapdict mark + /CIEBasedA { 1 get exch csciea currentcolorrendering 4 1 roll crmap } bind + /DeviceGray { pop /DefaultGray /ColorSpace findresource 1 get exch csciea currentcolorrendering 4 1 roll crmap } bind + /CIEBasedABC { 1 get 4 1 roll cscieabc currentcolorrendering 4 1 roll crmap } bind + /DeviceRGB { pop /DefaultRGB /ColorSpace findresource 1 get 4 1 roll cscieabc currentcolorrendering 4 1 roll crmap } bind +.dicttomark def +/mapcie % mapcie ... + % mapcie ... + { currentcolorspace dup 0 get //mapdict exch get exec + } bind def diff --git a/Master/tlpkg/tlgs/lib/dumphint.ps b/Master/tlpkg/tlgs/lib/dumphint.ps old mode 100755 new mode 100644 index c5e1e2f81f4..80e92eb1dba --- a/Master/tlpkg/tlgs/lib/dumphint.ps +++ b/Master/tlpkg/tlgs/lib/dumphint.ps @@ -1,756 +1,756 @@ -% Copyright (C) 2000, 2001 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: dumphint.ps 8284 2007-10-10 17:40:38Z giles $ -% Linearized PDF hint formatting utility. - -% -% Linearized PDF hints generated by Acrobat suite seem to deviate from -% the published specification. -% -% /P (page offset hint table) key in hint stream is not generated by -% Adobe products. The key is no longer required in PDF 1.5. -% -% Per-page items 4 and 5 of the page offset hint table start from 1st -% page rather than 2nd page as the spec claims. -% -% All array entries start from the new byte boundary. -% - -/table_width 79 def -/col1_width 66 def - -% Skip bits to the next byte boundary -/bytealign { % bytealign - - begin /N 0 def /B 0 def end -} bind def - -% Set bit stream position and align it to byte boundary -/set_align { % <<>> pos set_align - - exch begin - S exch setfileposition - /N 0 def /B 0 def - end -} bind def - -% Read requested number of bits from the bit stream. -/bitread { % bitwrite - exch begin - 0 % bit val - { - 1 index N .min % bit val m - dup 3 1 roll % bit m val m - bitshift % bit m val<>(N-m) - 3 -1 roll % m val' bit - 2 index sub % m val' bit' - 3 -1 roll % val' bit' m - N exch sub dup % val' bit' N' N' - 1 exch bitshift % val' bit' N' 1<)= - } { - hint_stream /S get 128 string - readstring pop - dup length 128 eq { - == - } { pop (Error reading nd5 string.) == - } ifelse - } ifelse - } forall - } { - () = (none) = - } ifelse - - (4. The number of objects in the group.) array_header - hint_stream bytealign - /shint_group_cnt [ - shint_all_shared { - hint_stream shint_group_bits bitread - } repeat - ] readonly def - - shint_group_cnt dump_array - - } bind def - -% Analyze the thumbnail hint table. -/dump_thumbnail_table { - hint_stream - - dup 32 bitread - dup /thint_1st_obj_id exch def - (1. Object number of the first thumbnail image.) two_column - - dup 32 bitread - dup /thint_1st_obj_pos exch def - (2. Location of the first thumbnail image.) two_column - - dup 32 bitread - dup /thint_page_cnt exch def - (3. Number of pages that have thumbnail images.) two_column - - dup 16 bitread - dup /thint_no_thumbnail_bits exch def - (4. Bits for the max number of consecutive pages without a thumbnail image.) two_column - - dup 32 bitread - dup /thint_min_sz exch def - (5. The least length of a thumbnail image in bytes.) two_column - - dup 15 bitread - dup /thint_obj_sz_bits exch def - (6. Bits for the difference between max and min length of a thumbnail image.) two_column - - dup 32 bitread - dup /thint_min_obj_cnt exch def - (7. The least number of objects in a thumbnail image.) two_column - - dup 16 bitread - dup /thint_obj_cnt_bits exch def - (8. Bits for the difference between max and min number of objects in a thumbnail image.) two_column - - dup 32 bitread - dup /thint_1st_shared_obj exch def - (9. First object in the thumbnail shared objects section.) two_column - - dup 32 bitread - dup /thint_1st_shared_pos exch def - (10. Location of the first object in the thumbnail shared objects section.) two_column - - dup 32 bitread - dup /thint_shared_cnt exch def - (11. Number of thumbnail shared objects.) two_column - - dup 32 bitread - dup /thint_shared_section_sz exch def - (12. Length of the thumbnail shared objects section in bytes.) two_column - - pop - LinearizationParams /N get - - (1. The number of preceding pages lacking a thumbnail image.) array_header - hint_stream bytealign - /thint_no_thumbnail_pages [ - 2 index { - hint_stream thint_no_thumbnail_bits bitread - } repeat - ] readonly def - - thint_no_thumbnail_pages dump_array - - (2. Number of objects in this page's thumbnail image.) array_header - hint_stream bytealign - /thint_page_obj_cnt [ - 2 index { - hint_stream thint_obj_cnt_bits bitread - thint_min_obj_cnt add - } repeat - ] readonly def - - thint_page_obj_cnt dump_array - - (3. Length of this page's thumbnail image in bytes.) array_header - hint_stream bytealign - /thint_page_obj_sz [ - 2 index { - hint_stream thint_obj_sz_bits bitread - thint_min_sz add - } repeat - ] readonly def - - thint_page_obj_sz dump_array - pop -} bind def - -% Analyze the generic hint table. -% The hint field names are re-used. -/dump_generic_table { - hint_stream - - dup 32 bitread - dup /ghint_1st_obj exch def - (1. Object number of the first object in the group.) two_column - - dup 32 bitread - dup /ghint_1st_obj_pos exch def - (2. Location of the first object in the group.) two_column - - dup 32 bitread - dup /ghint_obj_cnt exch def - (3. Number of objects in the group.) two_column - - dup 32 bitread - dup /ghint_group_sz exch def - (4. Length of the object group in bytes.) two_column - - pop -} bind def - -% Analyze the interactive hint table. -% The hint field names are re-used. -/dump_interactive_table { - hint_stream - - dup 32 bitread - dup /ihint_1st_obj exch def - (1. Object number of the first object in the group.) two_column - - dup 32 bitread - dup /ihint_1st_obj_pos exch def - (2. Location of the first object in the group.) two_column - - dup 32 bitread - dup /ihint_obj_cnt exch def - (3. Number of objects in the group.) two_column - - dup 32 bitread - dup /ihint_group_sz exch def - (4. Length of the object group in bytes.) two_column - - dup 32 bitread - dup /ihint_shared_cnt exch def - (5. Number of shared object references.) two_column - - dup 16 bitread - dup /ihint_shared_obj_bits exch def - (6. Bits for the max shared object id used by the interactive form or the logical structure hierarchy.) - 1 index hint_sobits ne { - (\n*** This fiels is not equal to max shared object ID bits ***) concatstrings - } if - - pop - - (7. Shared object identifier.) array_header - hint_stream bytealign - /ihint_shared_obj_id [ - ihint_shared_cnt { - hint_stream hint_sobits bitread - } repeat - ] readonly def - - ihint_shared_obj_id dump_array -} bind def - -% Enumerate all documented hint tables. -/dump_all_tables { % <> dump_all_tables - - (Page offset hint table) table_header - hint_stream 0 set_align - dump_page_offset_table - - (S, Shared object hint table) table_header - dup /S .knownget { - hint_stream exch set_align - dump_shared_object_table - } { - (Required table is not found.) error_msg - } ifelse - - dup /T .knownget { - (T, Thumbnail hint table) table_header - hint_stream exch set_align - dump_thumbnail_table - } if - - dup /O .knownget { - (O, Outline hint table) table_header - hint_stream exch set_align - dump_generic_table - } if - - dup /A .knownget { - (A, Thread information hint table) table_header - hint_stream exch set_align - dump_generic_table - } if - - dup /E .knownget { - (E, Named destination hint table) table_header - hint_stream exch set_align - dump_generic_table - } if - - dup /V .knownget { - (V, Interactive form hint table) table_header - hint_stream exch set_align - dump_interactive_table - } if - - dup /I .knownget { - (I, Information dictionary hint table) table_header - hint_stream exch set_align - dump_generic_table - } if - - dup /C .knownget { - (C, Logical structure hint table) table_header - hint_stream exch set_align - dump_interactive_table - } if - - dup /L .knownget { - (L, Page label hint table) table_header - hint_stream exch set_align - dump_generic_table - } if - - pop -} bind def - - -% Load PDF file and extract the hint stream. -/pdf_dump_hints { % pdf_dump_hints - - dup (r) file % fname - false exch % fname F file - { - dup 7 string readstring pop % fname F file () - (%PDF-1.) ne { pop exit } if % fname F file - dup 0 setfileposition - dup token not { pop exit } if % fname F file obj - dup type /integertype ne { pop exit } if % fname F file obj - 1 index token not { pop pop exit } if % fname F file obj gen - dup type /integertype ne {pop pop exit}if % fname F file obj gen - 4 2 roll % fname obj gen F file - dup 0 setfileposition - exch true or % fname obj gen file T - exit - } loop - { - pdfdict begin - pdfopenfile dup begin - 40 dict begin - /IDict exch def - .setsafe - - % Read all objects into memory. - Trailer touch - resolveR % fname <<>> - dup /Linearized known { - dup /L get % fname <<>> Len - 3 -1 roll status not { 0 0 0 0 } if % <<>> Len - pop pop exch pop % <<>> Len len - eq { - /LinearizationParams exch def - LinearizationParams /H get - dup length 2 eq { - 0 get PDFoffset add PDFfile exch setfileposition - PDFfile token pop - PDFfile token pop - resolveR dup true resolvestream - /ReusableStreamDecode filter - bitstream dup bytealign - /hint_stream exch def - - dump_all_tables - } { - pop - (Overflow hint stream is not supported.) = - } ifelse - } { - pop - (Wrong file length in linearization dictionary.) = - } ifelse - } { - pop (The file is not linearized.) = - } ifelse - end % temporary dict - end % IDict - end - } { - pop - (Input file is not a valid PDF file.) = - } ifelse -} bind def - -% Initial setup -/dump_hints { - counttomark 1 eq { - exch pop - save exch - 3000000 setvmthreshold - pdfoptdict begin - pdf_dump_hints - end - restore - true - } { - cleartomark false - } ifelse -} bind def - -/shellarguments {false} def -(pdfopt.ps) runlibfile -currentdict /shellarguments undef - -% Check for command line arguments. -mark shellarguments { - dump_hints not { - (Usage: gs -dNODISPLAY -- dumphint.ps input.pdf) = flush - } if -} { - pop -} ifelse - -% EOF +% Copyright (C) 2000, 2001 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: dumphint.ps 8284 2007-10-10 17:40:38Z giles $ +% Linearized PDF hint formatting utility. + +% +% Linearized PDF hints generated by Acrobat suite seem to deviate from +% the published specification. +% +% /P (page offset hint table) key in hint stream is not generated by +% Adobe products. The key is no longer required in PDF 1.5. +% +% Per-page items 4 and 5 of the page offset hint table start from 1st +% page rather than 2nd page as the spec claims. +% +% All array entries start from the new byte boundary. +% + +/table_width 79 def +/col1_width 66 def + +% Skip bits to the next byte boundary +/bytealign { % bytealign - + begin /N 0 def /B 0 def end +} bind def + +% Set bit stream position and align it to byte boundary +/set_align { % <<>> pos set_align - + exch begin + S exch setfileposition + /N 0 def /B 0 def + end +} bind def + +% Read requested number of bits from the bit stream. +/bitread { % bitwrite + exch begin + 0 % bit val + { + 1 index N .min % bit val m + dup 3 1 roll % bit m val m + bitshift % bit m val<>(N-m) + 3 -1 roll % m val' bit + 2 index sub % m val' bit' + 3 -1 roll % val' bit' m + N exch sub dup % val' bit' N' N' + 1 exch bitshift % val' bit' N' 1<)= + } { + hint_stream /S get 128 string + readstring pop + dup length 128 eq { + == + } { pop (Error reading nd5 string.) == + } ifelse + } ifelse + } forall + } { + () = (none) = + } ifelse + + (4. The number of objects in the group.) array_header + hint_stream bytealign + /shint_group_cnt [ + shint_all_shared { + hint_stream shint_group_bits bitread + } repeat + ] readonly def + + shint_group_cnt dump_array + + } bind def + +% Analyze the thumbnail hint table. +/dump_thumbnail_table { + hint_stream + + dup 32 bitread + dup /thint_1st_obj_id exch def + (1. Object number of the first thumbnail image.) two_column + + dup 32 bitread + dup /thint_1st_obj_pos exch def + (2. Location of the first thumbnail image.) two_column + + dup 32 bitread + dup /thint_page_cnt exch def + (3. Number of pages that have thumbnail images.) two_column + + dup 16 bitread + dup /thint_no_thumbnail_bits exch def + (4. Bits for the max number of consecutive pages without a thumbnail image.) two_column + + dup 32 bitread + dup /thint_min_sz exch def + (5. The least length of a thumbnail image in bytes.) two_column + + dup 15 bitread + dup /thint_obj_sz_bits exch def + (6. Bits for the difference between max and min length of a thumbnail image.) two_column + + dup 32 bitread + dup /thint_min_obj_cnt exch def + (7. The least number of objects in a thumbnail image.) two_column + + dup 16 bitread + dup /thint_obj_cnt_bits exch def + (8. Bits for the difference between max and min number of objects in a thumbnail image.) two_column + + dup 32 bitread + dup /thint_1st_shared_obj exch def + (9. First object in the thumbnail shared objects section.) two_column + + dup 32 bitread + dup /thint_1st_shared_pos exch def + (10. Location of the first object in the thumbnail shared objects section.) two_column + + dup 32 bitread + dup /thint_shared_cnt exch def + (11. Number of thumbnail shared objects.) two_column + + dup 32 bitread + dup /thint_shared_section_sz exch def + (12. Length of the thumbnail shared objects section in bytes.) two_column + + pop + LinearizationParams /N get + + (1. The number of preceding pages lacking a thumbnail image.) array_header + hint_stream bytealign + /thint_no_thumbnail_pages [ + 2 index { + hint_stream thint_no_thumbnail_bits bitread + } repeat + ] readonly def + + thint_no_thumbnail_pages dump_array + + (2. Number of objects in this page's thumbnail image.) array_header + hint_stream bytealign + /thint_page_obj_cnt [ + 2 index { + hint_stream thint_obj_cnt_bits bitread + thint_min_obj_cnt add + } repeat + ] readonly def + + thint_page_obj_cnt dump_array + + (3. Length of this page's thumbnail image in bytes.) array_header + hint_stream bytealign + /thint_page_obj_sz [ + 2 index { + hint_stream thint_obj_sz_bits bitread + thint_min_sz add + } repeat + ] readonly def + + thint_page_obj_sz dump_array + pop +} bind def + +% Analyze the generic hint table. +% The hint field names are re-used. +/dump_generic_table { + hint_stream + + dup 32 bitread + dup /ghint_1st_obj exch def + (1. Object number of the first object in the group.) two_column + + dup 32 bitread + dup /ghint_1st_obj_pos exch def + (2. Location of the first object in the group.) two_column + + dup 32 bitread + dup /ghint_obj_cnt exch def + (3. Number of objects in the group.) two_column + + dup 32 bitread + dup /ghint_group_sz exch def + (4. Length of the object group in bytes.) two_column + + pop +} bind def + +% Analyze the interactive hint table. +% The hint field names are re-used. +/dump_interactive_table { + hint_stream + + dup 32 bitread + dup /ihint_1st_obj exch def + (1. Object number of the first object in the group.) two_column + + dup 32 bitread + dup /ihint_1st_obj_pos exch def + (2. Location of the first object in the group.) two_column + + dup 32 bitread + dup /ihint_obj_cnt exch def + (3. Number of objects in the group.) two_column + + dup 32 bitread + dup /ihint_group_sz exch def + (4. Length of the object group in bytes.) two_column + + dup 32 bitread + dup /ihint_shared_cnt exch def + (5. Number of shared object references.) two_column + + dup 16 bitread + dup /ihint_shared_obj_bits exch def + (6. Bits for the max shared object id used by the interactive form or the logical structure hierarchy.) + 1 index hint_sobits ne { + (\n*** This fiels is not equal to max shared object ID bits ***) concatstrings + } if + + pop + + (7. Shared object identifier.) array_header + hint_stream bytealign + /ihint_shared_obj_id [ + ihint_shared_cnt { + hint_stream hint_sobits bitread + } repeat + ] readonly def + + ihint_shared_obj_id dump_array +} bind def + +% Enumerate all documented hint tables. +/dump_all_tables { % <> dump_all_tables - + (Page offset hint table) table_header + hint_stream 0 set_align + dump_page_offset_table + + (S, Shared object hint table) table_header + dup /S .knownget { + hint_stream exch set_align + dump_shared_object_table + } { + (Required table is not found.) error_msg + } ifelse + + dup /T .knownget { + (T, Thumbnail hint table) table_header + hint_stream exch set_align + dump_thumbnail_table + } if + + dup /O .knownget { + (O, Outline hint table) table_header + hint_stream exch set_align + dump_generic_table + } if + + dup /A .knownget { + (A, Thread information hint table) table_header + hint_stream exch set_align + dump_generic_table + } if + + dup /E .knownget { + (E, Named destination hint table) table_header + hint_stream exch set_align + dump_generic_table + } if + + dup /V .knownget { + (V, Interactive form hint table) table_header + hint_stream exch set_align + dump_interactive_table + } if + + dup /I .knownget { + (I, Information dictionary hint table) table_header + hint_stream exch set_align + dump_generic_table + } if + + dup /C .knownget { + (C, Logical structure hint table) table_header + hint_stream exch set_align + dump_interactive_table + } if + + dup /L .knownget { + (L, Page label hint table) table_header + hint_stream exch set_align + dump_generic_table + } if + + pop +} bind def + + +% Load PDF file and extract the hint stream. +/pdf_dump_hints { % pdf_dump_hints - + dup (r) file % fname + false exch % fname F file + { + dup 7 string readstring pop % fname F file () + (%PDF-1.) ne { pop exit } if % fname F file + dup 0 setfileposition + dup token not { pop exit } if % fname F file obj + dup type /integertype ne { pop exit } if % fname F file obj + 1 index token not { pop pop exit } if % fname F file obj gen + dup type /integertype ne {pop pop exit}if % fname F file obj gen + 4 2 roll % fname obj gen F file + dup 0 setfileposition + exch true or % fname obj gen file T + exit + } loop + { + pdfdict begin + pdfopenfile dup begin + 40 dict begin + /IDict exch def + .setsafe + + % Read all objects into memory. + Trailer touch + resolveR % fname <<>> + dup /Linearized known { + dup /L get % fname <<>> Len + 3 -1 roll status not { 0 0 0 0 } if % <<>> Len + pop pop exch pop % <<>> Len len + eq { + /LinearizationParams exch def + LinearizationParams /H get + dup length 2 eq { + 0 get PDFoffset add PDFfile exch setfileposition + PDFfile token pop + PDFfile token pop + resolveR dup true resolvestream + /ReusableStreamDecode filter + bitstream dup bytealign + /hint_stream exch def + + dump_all_tables + } { + pop + (Overflow hint stream is not supported.) = + } ifelse + } { + pop + (Wrong file length in linearization dictionary.) = + } ifelse + } { + pop (The file is not linearized.) = + } ifelse + end % temporary dict + end % IDict + end + } { + pop + (Input file is not a valid PDF file.) = + } ifelse +} bind def + +% Initial setup +/dump_hints { + counttomark 1 eq { + exch pop + save exch + 3000000 setvmthreshold + pdfoptdict begin + pdf_dump_hints + end + restore + true + } { + cleartomark false + } ifelse +} bind def + +/shellarguments {false} def +(pdfopt.ps) runlibfile +currentdict /shellarguments undef + +% Check for command line arguments. +mark shellarguments { + dump_hints not { + (Usage: gs -dNODISPLAY -- dumphint.ps input.pdf) = flush + } if +} { + pop +} ifelse + +% EOF diff --git a/Master/tlpkg/tlgs/lib/font2c.ps b/Master/tlpkg/tlgs/lib/font2c.ps old mode 100755 new mode 100644 index c5234d72b02..0dcdaab3a9f --- a/Master/tlpkg/tlgs/lib/font2c.ps +++ b/Master/tlpkg/tlgs/lib/font2c.ps @@ -1,675 +1,675 @@ -% Copyright (C) 1992, 1993, 1994, 1995, 1999 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: font2c.ps 6300 2005-12-28 19:56:24Z giles $ -% font2c.ps -% Write out a PostScript Type 0 or Type 1 font as C code -% that can be linked with the interpreter. -% This even works on protected fonts, if you use the -dWRITESYSTEMDICT -% switch in the command line. The code is reentrant and location- -% independent and has no external references, so it can be put into -% a sharable library even on VMS. - -/font2cdict 100 dict dup begin - -% Define the maximum string length that all compilers will accept. -% This must be approximately -% min(max line length, max string literal length) / 4 - 5. - -/max_wcs 50 def - -% Define a temporary file for writing out procedures. -/wtempname (_.tmp) def - -% ------ Protection utilities ------ % - -% Protection values are represented by a mask: -/a_noaccess 0 def -/a_executeonly 1 def -/a_readonly 3 def -/a_all 7 def -/prot_names - [ (0) (a_execute) null (a_readonly) null null null (a_all) - ] def -/prot_opers - [ {noaccess} {executeonly} {} {readonly} {} {} {} {} - ] def - -% Get the protection of an object. - /getpa - { dup wcheck - { pop a_all } - { % Check for executeonly or noaccess objects in protected. - dup protected exch known - { protected exch get } - { pop a_readonly } - ifelse - } - ifelse - } bind def - -% Get the protection appropriate for (all the) values in a dictionary. - /getva - { a_noaccess exch - { exch pop - dup type dup /stringtype eq 1 index /arraytype eq or - exch /packedarraytype eq or - { getpa a_readonly and or } - { pop pop a_all exit } - ifelse - } - forall - } bind def - -% Keep track of executeonly and noaccess objects, -% but don't let the protection actually take effect. -.currentglobal -false .setglobal % so protected can reference local objs -/protected % do first so // will work - systemdict wcheck { 1500 dict } { 1 dict } ifelse -def -systemdict wcheck not - { (Warning: you will not be able to convert protected fonts.\n) print - (If you need to convert a protected font, please\n) print - (restart the program and specify the -dWRITESYSTEMDICT switch.\n) print - flush - (%end) .skipeof - } -if -userdict begin - /executeonly - { dup //protected exch //a_executeonly put readonly - } bind def - /noaccess - { dup //protected exch //a_noaccess put readonly - } bind def -end -true .setglobal -systemdict begin - /executeonly - { userdict /executeonly get exec - } bind odef - /noaccess - { userdict /noaccess get exec - } bind odef -end -%end -.setglobal - -% ------ Output utilities ------ % - -% By convention, the output file is named cfile. - -% Define some utilities for writing the output file. - /wtstring 100 string def - /wb {cfile exch write} bind def - /ws {cfile exch writestring} bind def - /wl {ws (\n) ws} bind def - /wt {wtstring cvs ws} bind def - -% Write a C string. Some compilers have unreasonably small limits on -% the length of a string literal or the length of a line, so every place -% that uses wcs must either know that the string is short, -% or be prepared to use wcca instead. - /wbx - { 8#1000 add 8 (0000) cvrs dup 0 (\\) 0 get put ws - } bind def - /wcst - [ - 32 { /wbx load } repeat - 95 { /wb load } repeat - 129 { /wbx load } repeat - ] def - ("\\) { wcst exch { (\\) ws wb } put } forall - /wcs - { (") ws { dup wcst exch get exec } forall (") ws - } bind def - /can_wcs % Test if can use wcs - { length max_wcs le - } bind def - /wncs % name -> C string - { wtstring cvs wcs - } bind def -% Write a C string as an array of character values. -% We only need this because of line and literal length limitations. - /wca % wca - - { 0 4 -2 roll exch - { % Stack: suffix n prefix char - exch ws - exch dup 19 ge { () wl pop 0 } if 1 add - exch dup 32 ge 1 index 126 le and - { 39 wb dup 39 eq 1 index 92 eq or { 92 wb } if wb 39 wb } - { wt } - ifelse (,) - } forall - pop pop ws - } bind def - /wcca % wcca - - { ({\n) (}) wca - } bind def - -% Write object protection attributes. Note that dictionaries and arrays are -% the only objects that can be writable. - /wpa - { dup xcheck { (a_executable|) ws } if - dup type dup /dicttype eq exch /arraytype eq or - { getpa } - { getpa a_readonly and } - ifelse prot_names exch get ws - } bind def - /wva - { getva prot_names exch get ws - } bind def - -% ------ Object writing ------ % - - /wnstring 128 string def - -% Convert an object to a string to be scanned at a later time. - /cvos % cvos - { % We'd like to use == and write directly to a string, - % but we can't do the former because of operators, - % and we can't do the latter because we can't predict - % how long the string would have to be.... - wtempname (w) file dup 3 -1 roll wproc closefile - wtempname status pop pop pop exch pop string - wtempname (r) file dup 3 -1 roll readstring pop exch closefile - } bind def - -% Write a string/name or null as an element of a string/name/null array. -% Convert any other kind of value to a token to be read back in. - /wsn - { dup null eq - { pop (\t255,255,) wl - } - { dup type /nametype eq { wnstring cvs } if - dup type /stringtype ne { cvos (255,) ws } if - dup length 256 idiv wt (,) ws - dup length 256 mod wt - (,) (,\n) wca - } - ifelse - } bind def -% Write a packed string/name/null array. - /wsna % <(string|name|null)*> wsna - - { (\tstatic const unsigned char ) ws exch wt ([] = {) wl - { wsn } forall - (\t0\n};) wl - } bind def - -% Write a number or an array of numbers, as refs. -/isnumber - { type dup /integertype eq exch /realtype eq or - } bind def -/wnums - { dup isnumber - { (real_v\() ws wt (\),) ws } - { { wnums } forall } - ifelse - } bind def - -% Test whether a procedure or unusual array can be written (printed). -/iswx 4 dict dup begin - /arraytype { { iswproc } isall } def - /nametype { pop true } def - /operatortype { pop true } def % assume it has been bound in - /packedarraytype /arraytype load def -end def -/iswnx 6 dict dup begin - /arraytype { { iswproc } isall } def - /integertype { pop true } def - /nametype { pop true } def - /realtype { pop true } def - /stringtype { pop true } def - /packedarraytype /arraytype load def -end def -/iswproc % iswproc - { dup xcheck { iswx } { iswnx } ifelse - 1 index type .knownget { exec } { pop false } ifelse - } bind def - -% Write a printable procedure (one for which iswproc returns true). -/wproca 3 dict dup begin - /arraytype - { 1 index ({) writestring - { 1 index ( ) writestring 1 index exch wproc } forall - (}) writestring - } bind def - /packedarraytype /arraytype load def - /operatortype { .writecvs } bind def % assume binding would work -end def -/wproc % wproc - - { dup type wproca exch .knownget { exec } { write==only } ifelse - } bind def - -% Write a named object. Return true if this was possible. -% Legal types are: boolean, integer, name, real, string, -% array of (integer, integer+real, name, null+string), -% and certain procedures and other arrays (see iswproc above). -% All other objects are either handled specially or ignored. - /isall % isall - { true 3 -1 roll - { 2 index exec not { pop false exit } if } - forall exch pop - } bind def - /wott 8 dict dup begin - /arraytype - { woatt - { aload pop 2 index 2 index exec - { exch pop exec exit } - { pop pop } - ifelse - } - forall - } bind def - /booleantype - { { (\tmake_true\(&) } { (\tmake_false\(&) } ifelse ws - wt (\);) wl true - } bind def - /integertype - { (\tmake_int\(&) ws exch wt (, ) ws - wt (\);) wl true - } bind def - /nametype - { (\tcode = (*pprocs->name_create)\(i_ctx_p, &) ws exch wt - (, ) ws wnstring cvs wcs % OK, names are short - (\);) wl - (\tif ( code < 0 ) return code;) wl - true - } bind def - /packedarraytype - /arraytype load def - /realtype - { (\tmake_real\(&) ws exch wt (, (float)) ws - wt (\);) wl true - } bind def - /stringtype - { ({\tstatic const unsigned char s_[] = ) ws - dup dup can_wcs { wcs } { wcca } ifelse - (;) wl - (\tmake_const_string\(&) ws exch wt - (, a_readonly, ) ws length wt (, (const byte *)s_\);) wl - (}) wl true - } bind def - end def -% Write some other kind of object, if known. - /wother - { dup otherobjs exch known - { otherobjs exch get (\t) ws exch wt ( = ) ws wt (;) wl true } - { pop pop false } - ifelse - } bind def -% Top-level procedure. - /wo % name obj -> OK - { dup type wott exch .knownget { exec } { wother } ifelse - } bind def - -% Write an array (called by wo). - /wap % wap - - { dup xcheck not 1 index wcheck not and 1 index rcheck and - { pop pop } - { (\tr_set_attrs\(&) ws exch wt (, ) ws wpa (\);) wl } - ifelse - } bind def - /wnuma { % <_v> wnuma - - ({\tstatic const ref_\() ws exch ws (\) a_[] = {) wl exch - % Stack: name type_v array - dup length 0 eq { - (\t) ws 1 index ws (\(0\)) wl - } { - dup { - (\t) ws 2 index ws (\() ws wt (\),) wl - } forall - } ifelse exch pop - % Stack: name array - (\t};) wl - dup wcheck { - (\tcode = (*pprocs->scalar_array_create)\(i_ctx_p, &) ws exch wt - (, (const ref *)a_, ) ws dup length wt - (, ) ws wpa (\);) wl - (\tif ( code < 0 ) return code;) wl - } { - (\tmake_const_array\(&) ws exch wt - (, avm_foreign|) ws dup wpa (, ) ws length wt - (, (const ref *)a_\);) wl - } ifelse - (}) wl - } bind def - /woatt [ - % Integers - { { { type /integertype eq } isall } - { (long) (integer_v) wnuma true } - } - % Integers + reals - { { { type dup /integertype eq exch /realtype eq or } isall } - { (float) (real_v) wnuma true } - } - % Strings + nulls - { { { type dup /nulltype eq exch /stringtype eq or } isall } - { ({) ws dup (sa_) exch wsna - (\tcode = (*pprocs->string_array_create)\(i_ctx_p, &) ws exch wt - (, \(const char *\)sa_, ) ws dup length wt (, ) ws wpa (\);) wl - (\tif ( code < 0 ) return code;) wl - (}) wl true - } - } - % Names - { { { type /nametype eq } isall } - { ({) ws dup (na_) exch wsna - (\tcode = (*pprocs->name_array_create)\(i_ctx_p, &) ws 1 index wt - (, \(const char *\)na_, ) ws dup length wt (\);) wl - (\tif ( code < 0 ) return code;) wl - wap (}) wl true - } - } - % Procedure - { { iswproc } - { dup cvos - % Stack: name proc string - ({\tstatic const unsigned char s_[] = ) ws - dup dup can_wcs { wcs } { wcca } ifelse - (;) wl - (\tcode = (*pprocs->ref_from_string)\(i_ctx_p, &) ws 2 index wt - (, \(const char *\)s_, ) ws length wt (\);) wl - (\tif ( code < 0 ) return code;) wl - wap (}) wl true - wtempname deletefile - } - } - % Default - { { pop true } - { wother } - } - ] def - -% Write a named dictionary. We assume the ref is already declared. - /wd % wd - - { 3 1 roll - ({) ws - (\tref v_[) ws dup length wt (];) wl - dup [ exch - { counttomark 2 sub wtstring cvs - (v_[) exch concatstrings (]) concatstrings exch wo not - { (Skipping ) print ==only (....\n) print } - if - } forall - ] - % Stack: array of keys (names) - ({) ws dup (str_keys_) exch wsna - (\tstatic const cfont_dict_keys keys_ =) wl - (\t { 0, 0, ) ws length wt (, ) ws 3 -1 roll wt (, ) ws - dup wpa (, ) ws dup wva ( };) wl pop - (\tcode = \(*pprocs->ref_dict_create\)\(i_ctx_p, &) ws wt - (, &keys_, \(const char *\)str_keys_, v_\);) wl - (\tif ( code < 0 ) return code;) wl - (}) wl - (}) wl - } bind def - -% Write character dictionary keys. -% We save a lot of space by abbreviating keys which appear in -% StandardEncoding or ISOLatin1Encoding. -% Writes code to declare and initialize enc_keys_, str_keys, and keys_. -/wcdkeys % wcdkeys - - { % Write keys present in StandardEncoding or ISOLatin1Encoding, - % pushing other keys on the o-stack. - (static const charindex enc_keys_[] = {) wl - dup [ exch 0 exch - { pop decoding 1 index known - { decoding exch get ({) ws dup -8 bitshift wt - (,) ws 255 and wt (}, ) ws - 1 add dup 5 mod 0 eq { (\n) ws } if - } - { exch } - ifelse - } - forall pop - ] - ({0,0}\n};) wl - % Write other keys. - (str_keys_) exch wsna - % Write the declaration for keys_. - (static const cfont_dict_keys keys_ = {) wl - (\tenc_keys_, countof\(enc_keys_\) - 1,) wl - (\t) ws dup length wt ( - \(countof\(enc_keys_\) - 1\), 0, ) ws - dup wpa (, ) ws wva () wl - (};) wl - } bind def - -% Enumerate character dictionary values in the same order that -% the keys appear in enc_keys_ and str_keys_. -% is called with each value in turn. -/cdforall % cdforall - - { 2 copy - { decoding 3 index known - { 3 -1 roll pop exec } - { pop pop pop } - ifelse - } - /exec cvx 3 packedarray cvx - /forall cvx - 5 -2 roll - { decoding 3 index known - { pop pop pop } - { 3 -1 roll pop exec } - ifelse - } - /exec cvx 3 packedarray cvx - /forall cvx - 6 packedarray cvx exec - } bind def - -% ------ Writers for special objects ------ % - -/writespecial 10 dict dup begin - - /FontInfo { 0 wd } def - - /Private { 0 wd } def - - /CharStrings - { ({) wl - dup wcdkeys - (static const unsigned char values_[] = {) wl - { wsn } cdforall - (\t0\n};) wl - (\tcode = \(*pprocs->string_dict_create\)\(i_ctx_p, &) ws wt - (, &keys_, (const char *)str_keys_, \(const char *\)values_\);) wl - (\tif ( code < 0 ) return code;) wl - (}) wl - } bind def - - /Metrics - { ({) wl - dup wcdkeys - (static const ref_(float) values_[] = {) wl - dup { (\t) ws wnums () wl } cdforall - (\t0\n};) wl - (static const unsigned char lengths_[] = {) wl - { (\t) ws dup isnumber - { pop 0 } - { length 1 add } - ifelse wt (,) wl - } cdforall - (\t0\n};) wl - (\tcode = \(*pprocs->num_dict_create\)\(i_ctx_p, &) ws wt - (, &keys_, str_keys_, (const ref *)values_, lengths_\);) wl - (\tif ( code < 0 ) return code;) wl - (}) wl - } bind def - - /Metrics2 /Metrics load def - - /FDepVector pop % (converted to a list of font names) - -end def - -% ------ The main program ------ % - -% Construct an inverse dictionary of encodings. -[ /StandardEncoding /ISOLatin1Encoding - /SymbolEncoding /DingbatsEncoding - /KanjiSubEncoding -] -dup length dict begin - { mark exch dup { .findencoding exch def } stopped cleartomark - } forall -currentdict end /encodingnames exch def - -% Invert the StandardEncoding and ISOLatin1Encoding vectors. -512 dict begin - 0 1 255 { dup ISOLatin1Encoding exch get exch 256 add def } for - 0 1 255 { dup StandardEncoding exch get exch def } for -currentdict end /decoding exch def - -/writefont % cfilename procname -> [writes the current font] - { (gsf_) exch concatstrings - /fontprocname exch def - /cfname exch def - /cfile cfname (w) file def - -% Remove unwanted keys from the font. - currentfont dup length dict begin { def } forall - { /FID /MIDVector /CurMID } { currentdict exch undef } forall - /Font currentdict end def - -% Replace the FDepVector with a list of font names. - Font /FDepVector .knownget - { [ exch { /FontName get } forall ] - Font /FDepVector 3 -1 roll put - } - if - -% Find all the special objects we know about. -% wo uses this to write out references to otherwise intractable objects. - /otherobjs writespecial length dict dup begin - writespecial - { pop Font 1 index .knownget { exch def } { pop } ifelse - } - forall - end def - -% Define a dummy FontInfo, in case the font doesn't have one. - /FontInfo 0 dict def - -% Write out the boilerplate. - Font begin - (/****************************************************************) wl - ( Portions of this file are subject to the following notice(s):) wl - systemdict /copyright get wl - FontInfo /Notice .knownget - { (----------------------------------------------------------------) wl wl - } if - (****************************************************************/) wl - () wl - (/* ) ws cfname ws ( */) wl - (/* This file was created by the ) ws product ws ( font2c utility. */) wl - () wl - (#undef DEBUG) wl - (#include "ccfont.h") wl - () wl - -% Write the procedure prologue. - (#ifdef __PROTOTYPES__) wl - (ccfont_proc\() ws fontprocname ws (\);) wl - (int) wl - fontprocname ws ((i_ctx_t *i_ctx_p, const cfont_procs *pprocs, ref *pfont)) wl - (#else) wl - (int) wl - fontprocname ws ((i_ctx_p, pprocs, pfont) i_ctx_t *i_ctx_p; const cfont_procs *pprocs; ref *pfont;) wl - (#endif) wl - ({\tint code;) wl - (\tref Font;) wl - otherobjs - { exch pop (\tref ) ws wt (;) wl } - forall - -% Write out the special objects. - otherobjs - { exch writespecial 2 index get exec - } - forall - -% Write out the main font dictionary. -% If possible, substitute the encoding name for the encoding; -% PostScript code will fix this up. - { /Encoding /PrefEnc } - { Font 1 index .knownget - { encodingnames exch .knownget { def } { pop } ifelse } - { pop } - ifelse - } - forall - (Font) Font FontType 0 eq { 5 } { 1 } ifelse wd - -% Finish the procedural initialization code. - (\t*pfont = Font;) wl - (\treturn 0;) wl - (}) wl - end % Font - - cfile closefile - - } bind def - -end def % font2cdict - -% Compute the procedure name from the font name. -% Replace all non-alphanumeric characters with '_'. -/makefontprocnamemap 256 string - 0 1 255 { 2 copy 95 put pop } for - (0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz) - { 2 copy dup put pop } forall -readonly def -/makefontprocname % makefontprocname - { dup length string cvs - dup length 1 sub -1 0 - { % Stack: string index - 2 copy 2 copy get //makefontprocnamemap exch get put pop - } - for - } def - -/writefont { font2cdict begin writefont end } def - -% If the program was invoked from the command line, run it now. -[ shellarguments - { counttomark dup 2 eq exch 3 eq or - { counttomark -1 roll cvn - (Converting ) print dup =only ( font.\n) print flush - % Ensure that we get a clean copy of the font from the - % file system. - 2 { % do both local and global - currentglobal not setglobal - dup undefinefont - } repeat - findfont setfont - (FontName is ) print currentfont /FontName get ==only (.\n) print flush - counttomark 1 eq - { % Construct the procedure name from the file name. - currentfont /FontName get makefontprocname - } - if - writefont - (Done.\n) print flush - } - { cleartomark - (Usage: font2c fontname cfilename.c [shortname]\n) print - ( e.g.: font2c Courier cour.c\n) print flush - mark - } - ifelse - } -if pop +% Copyright (C) 1992, 1993, 1994, 1995, 1999 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: font2c.ps 6300 2005-12-28 19:56:24Z giles $ +% font2c.ps +% Write out a PostScript Type 0 or Type 1 font as C code +% that can be linked with the interpreter. +% This even works on protected fonts, if you use the -dWRITESYSTEMDICT +% switch in the command line. The code is reentrant and location- +% independent and has no external references, so it can be put into +% a sharable library even on VMS. + +/font2cdict 100 dict dup begin + +% Define the maximum string length that all compilers will accept. +% This must be approximately +% min(max line length, max string literal length) / 4 - 5. + +/max_wcs 50 def + +% Define a temporary file for writing out procedures. +/wtempname (_.tmp) def + +% ------ Protection utilities ------ % + +% Protection values are represented by a mask: +/a_noaccess 0 def +/a_executeonly 1 def +/a_readonly 3 def +/a_all 7 def +/prot_names + [ (0) (a_execute) null (a_readonly) null null null (a_all) + ] def +/prot_opers + [ {noaccess} {executeonly} {} {readonly} {} {} {} {} + ] def + +% Get the protection of an object. + /getpa + { dup wcheck + { pop a_all } + { % Check for executeonly or noaccess objects in protected. + dup protected exch known + { protected exch get } + { pop a_readonly } + ifelse + } + ifelse + } bind def + +% Get the protection appropriate for (all the) values in a dictionary. + /getva + { a_noaccess exch + { exch pop + dup type dup /stringtype eq 1 index /arraytype eq or + exch /packedarraytype eq or + { getpa a_readonly and or } + { pop pop a_all exit } + ifelse + } + forall + } bind def + +% Keep track of executeonly and noaccess objects, +% but don't let the protection actually take effect. +.currentglobal +false .setglobal % so protected can reference local objs +/protected % do first so // will work + systemdict wcheck { 1500 dict } { 1 dict } ifelse +def +systemdict wcheck not + { (Warning: you will not be able to convert protected fonts.\n) print + (If you need to convert a protected font, please\n) print + (restart the program and specify the -dWRITESYSTEMDICT switch.\n) print + flush + (%end) .skipeof + } +if +userdict begin + /executeonly + { dup //protected exch //a_executeonly put readonly + } bind def + /noaccess + { dup //protected exch //a_noaccess put readonly + } bind def +end +true .setglobal +systemdict begin + /executeonly + { userdict /executeonly get exec + } bind odef + /noaccess + { userdict /noaccess get exec + } bind odef +end +%end +.setglobal + +% ------ Output utilities ------ % + +% By convention, the output file is named cfile. + +% Define some utilities for writing the output file. + /wtstring 100 string def + /wb {cfile exch write} bind def + /ws {cfile exch writestring} bind def + /wl {ws (\n) ws} bind def + /wt {wtstring cvs ws} bind def + +% Write a C string. Some compilers have unreasonably small limits on +% the length of a string literal or the length of a line, so every place +% that uses wcs must either know that the string is short, +% or be prepared to use wcca instead. + /wbx + { 8#1000 add 8 (0000) cvrs dup 0 (\\) 0 get put ws + } bind def + /wcst + [ + 32 { /wbx load } repeat + 95 { /wb load } repeat + 129 { /wbx load } repeat + ] def + ("\\) { wcst exch { (\\) ws wb } put } forall + /wcs + { (") ws { dup wcst exch get exec } forall (") ws + } bind def + /can_wcs % Test if can use wcs + { length max_wcs le + } bind def + /wncs % name -> C string + { wtstring cvs wcs + } bind def +% Write a C string as an array of character values. +% We only need this because of line and literal length limitations. + /wca % wca - + { 0 4 -2 roll exch + { % Stack: suffix n prefix char + exch ws + exch dup 19 ge { () wl pop 0 } if 1 add + exch dup 32 ge 1 index 126 le and + { 39 wb dup 39 eq 1 index 92 eq or { 92 wb } if wb 39 wb } + { wt } + ifelse (,) + } forall + pop pop ws + } bind def + /wcca % wcca - + { ({\n) (}) wca + } bind def + +% Write object protection attributes. Note that dictionaries and arrays are +% the only objects that can be writable. + /wpa + { dup xcheck { (a_executable|) ws } if + dup type dup /dicttype eq exch /arraytype eq or + { getpa } + { getpa a_readonly and } + ifelse prot_names exch get ws + } bind def + /wva + { getva prot_names exch get ws + } bind def + +% ------ Object writing ------ % + + /wnstring 128 string def + +% Convert an object to a string to be scanned at a later time. + /cvos % cvos + { % We'd like to use == and write directly to a string, + % but we can't do the former because of operators, + % and we can't do the latter because we can't predict + % how long the string would have to be.... + wtempname (w) file dup 3 -1 roll wproc closefile + wtempname status pop pop pop exch pop string + wtempname (r) file dup 3 -1 roll readstring pop exch closefile + } bind def + +% Write a string/name or null as an element of a string/name/null array. +% Convert any other kind of value to a token to be read back in. + /wsn + { dup null eq + { pop (\t255,255,) wl + } + { dup type /nametype eq { wnstring cvs } if + dup type /stringtype ne { cvos (255,) ws } if + dup length 256 idiv wt (,) ws + dup length 256 mod wt + (,) (,\n) wca + } + ifelse + } bind def +% Write a packed string/name/null array. + /wsna % <(string|name|null)*> wsna - + { (\tstatic const unsigned char ) ws exch wt ([] = {) wl + { wsn } forall + (\t0\n};) wl + } bind def + +% Write a number or an array of numbers, as refs. +/isnumber + { type dup /integertype eq exch /realtype eq or + } bind def +/wnums + { dup isnumber + { (real_v\() ws wt (\),) ws } + { { wnums } forall } + ifelse + } bind def + +% Test whether a procedure or unusual array can be written (printed). +/iswx 4 dict dup begin + /arraytype { { iswproc } isall } def + /nametype { pop true } def + /operatortype { pop true } def % assume it has been bound in + /packedarraytype /arraytype load def +end def +/iswnx 6 dict dup begin + /arraytype { { iswproc } isall } def + /integertype { pop true } def + /nametype { pop true } def + /realtype { pop true } def + /stringtype { pop true } def + /packedarraytype /arraytype load def +end def +/iswproc % iswproc + { dup xcheck { iswx } { iswnx } ifelse + 1 index type .knownget { exec } { pop false } ifelse + } bind def + +% Write a printable procedure (one for which iswproc returns true). +/wproca 3 dict dup begin + /arraytype + { 1 index ({) writestring + { 1 index ( ) writestring 1 index exch wproc } forall + (}) writestring + } bind def + /packedarraytype /arraytype load def + /operatortype { .writecvs } bind def % assume binding would work +end def +/wproc % wproc - + { dup type wproca exch .knownget { exec } { write==only } ifelse + } bind def + +% Write a named object. Return true if this was possible. +% Legal types are: boolean, integer, name, real, string, +% array of (integer, integer+real, name, null+string), +% and certain procedures and other arrays (see iswproc above). +% All other objects are either handled specially or ignored. + /isall % isall + { true 3 -1 roll + { 2 index exec not { pop false exit } if } + forall exch pop + } bind def + /wott 8 dict dup begin + /arraytype + { woatt + { aload pop 2 index 2 index exec + { exch pop exec exit } + { pop pop } + ifelse + } + forall + } bind def + /booleantype + { { (\tmake_true\(&) } { (\tmake_false\(&) } ifelse ws + wt (\);) wl true + } bind def + /integertype + { (\tmake_int\(&) ws exch wt (, ) ws + wt (\);) wl true + } bind def + /nametype + { (\tcode = (*pprocs->name_create)\(i_ctx_p, &) ws exch wt + (, ) ws wnstring cvs wcs % OK, names are short + (\);) wl + (\tif ( code < 0 ) return code;) wl + true + } bind def + /packedarraytype + /arraytype load def + /realtype + { (\tmake_real\(&) ws exch wt (, (float)) ws + wt (\);) wl true + } bind def + /stringtype + { ({\tstatic const unsigned char s_[] = ) ws + dup dup can_wcs { wcs } { wcca } ifelse + (;) wl + (\tmake_const_string\(&) ws exch wt + (, a_readonly, ) ws length wt (, (const byte *)s_\);) wl + (}) wl true + } bind def + end def +% Write some other kind of object, if known. + /wother + { dup otherobjs exch known + { otherobjs exch get (\t) ws exch wt ( = ) ws wt (;) wl true } + { pop pop false } + ifelse + } bind def +% Top-level procedure. + /wo % name obj -> OK + { dup type wott exch .knownget { exec } { wother } ifelse + } bind def + +% Write an array (called by wo). + /wap % wap - + { dup xcheck not 1 index wcheck not and 1 index rcheck and + { pop pop } + { (\tr_set_attrs\(&) ws exch wt (, ) ws wpa (\);) wl } + ifelse + } bind def + /wnuma { % <_v> wnuma - + ({\tstatic const ref_\() ws exch ws (\) a_[] = {) wl exch + % Stack: name type_v array + dup length 0 eq { + (\t) ws 1 index ws (\(0\)) wl + } { + dup { + (\t) ws 2 index ws (\() ws wt (\),) wl + } forall + } ifelse exch pop + % Stack: name array + (\t};) wl + dup wcheck { + (\tcode = (*pprocs->scalar_array_create)\(i_ctx_p, &) ws exch wt + (, (const ref *)a_, ) ws dup length wt + (, ) ws wpa (\);) wl + (\tif ( code < 0 ) return code;) wl + } { + (\tmake_const_array\(&) ws exch wt + (, avm_foreign|) ws dup wpa (, ) ws length wt + (, (const ref *)a_\);) wl + } ifelse + (}) wl + } bind def + /woatt [ + % Integers + { { { type /integertype eq } isall } + { (long) (integer_v) wnuma true } + } + % Integers + reals + { { { type dup /integertype eq exch /realtype eq or } isall } + { (float) (real_v) wnuma true } + } + % Strings + nulls + { { { type dup /nulltype eq exch /stringtype eq or } isall } + { ({) ws dup (sa_) exch wsna + (\tcode = (*pprocs->string_array_create)\(i_ctx_p, &) ws exch wt + (, \(const char *\)sa_, ) ws dup length wt (, ) ws wpa (\);) wl + (\tif ( code < 0 ) return code;) wl + (}) wl true + } + } + % Names + { { { type /nametype eq } isall } + { ({) ws dup (na_) exch wsna + (\tcode = (*pprocs->name_array_create)\(i_ctx_p, &) ws 1 index wt + (, \(const char *\)na_, ) ws dup length wt (\);) wl + (\tif ( code < 0 ) return code;) wl + wap (}) wl true + } + } + % Procedure + { { iswproc } + { dup cvos + % Stack: name proc string + ({\tstatic const unsigned char s_[] = ) ws + dup dup can_wcs { wcs } { wcca } ifelse + (;) wl + (\tcode = (*pprocs->ref_from_string)\(i_ctx_p, &) ws 2 index wt + (, \(const char *\)s_, ) ws length wt (\);) wl + (\tif ( code < 0 ) return code;) wl + wap (}) wl true + wtempname deletefile + } + } + % Default + { { pop true } + { wother } + } + ] def + +% Write a named dictionary. We assume the ref is already declared. + /wd % wd - + { 3 1 roll + ({) ws + (\tref v_[) ws dup length wt (];) wl + dup [ exch + { counttomark 2 sub wtstring cvs + (v_[) exch concatstrings (]) concatstrings exch wo not + { (Skipping ) print ==only (....\n) print } + if + } forall + ] + % Stack: array of keys (names) + ({) ws dup (str_keys_) exch wsna + (\tstatic const cfont_dict_keys keys_ =) wl + (\t { 0, 0, ) ws length wt (, ) ws 3 -1 roll wt (, ) ws + dup wpa (, ) ws dup wva ( };) wl pop + (\tcode = \(*pprocs->ref_dict_create\)\(i_ctx_p, &) ws wt + (, &keys_, \(const char *\)str_keys_, v_\);) wl + (\tif ( code < 0 ) return code;) wl + (}) wl + (}) wl + } bind def + +% Write character dictionary keys. +% We save a lot of space by abbreviating keys which appear in +% StandardEncoding or ISOLatin1Encoding. +% Writes code to declare and initialize enc_keys_, str_keys, and keys_. +/wcdkeys % wcdkeys - + { % Write keys present in StandardEncoding or ISOLatin1Encoding, + % pushing other keys on the o-stack. + (static const charindex enc_keys_[] = {) wl + dup [ exch 0 exch + { pop decoding 1 index known + { decoding exch get ({) ws dup -8 bitshift wt + (,) ws 255 and wt (}, ) ws + 1 add dup 5 mod 0 eq { (\n) ws } if + } + { exch } + ifelse + } + forall pop + ] + ({0,0}\n};) wl + % Write other keys. + (str_keys_) exch wsna + % Write the declaration for keys_. + (static const cfont_dict_keys keys_ = {) wl + (\tenc_keys_, countof\(enc_keys_\) - 1,) wl + (\t) ws dup length wt ( - \(countof\(enc_keys_\) - 1\), 0, ) ws + dup wpa (, ) ws wva () wl + (};) wl + } bind def + +% Enumerate character dictionary values in the same order that +% the keys appear in enc_keys_ and str_keys_. +% is called with each value in turn. +/cdforall % cdforall - + { 2 copy + { decoding 3 index known + { 3 -1 roll pop exec } + { pop pop pop } + ifelse + } + /exec cvx 3 packedarray cvx + /forall cvx + 5 -2 roll + { decoding 3 index known + { pop pop pop } + { 3 -1 roll pop exec } + ifelse + } + /exec cvx 3 packedarray cvx + /forall cvx + 6 packedarray cvx exec + } bind def + +% ------ Writers for special objects ------ % + +/writespecial 10 dict dup begin + + /FontInfo { 0 wd } def + + /Private { 0 wd } def + + /CharStrings + { ({) wl + dup wcdkeys + (static const unsigned char values_[] = {) wl + { wsn } cdforall + (\t0\n};) wl + (\tcode = \(*pprocs->string_dict_create\)\(i_ctx_p, &) ws wt + (, &keys_, (const char *)str_keys_, \(const char *\)values_\);) wl + (\tif ( code < 0 ) return code;) wl + (}) wl + } bind def + + /Metrics + { ({) wl + dup wcdkeys + (static const ref_(float) values_[] = {) wl + dup { (\t) ws wnums () wl } cdforall + (\t0\n};) wl + (static const unsigned char lengths_[] = {) wl + { (\t) ws dup isnumber + { pop 0 } + { length 1 add } + ifelse wt (,) wl + } cdforall + (\t0\n};) wl + (\tcode = \(*pprocs->num_dict_create\)\(i_ctx_p, &) ws wt + (, &keys_, str_keys_, (const ref *)values_, lengths_\);) wl + (\tif ( code < 0 ) return code;) wl + (}) wl + } bind def + + /Metrics2 /Metrics load def + + /FDepVector pop % (converted to a list of font names) + +end def + +% ------ The main program ------ % + +% Construct an inverse dictionary of encodings. +[ /StandardEncoding /ISOLatin1Encoding + /SymbolEncoding /DingbatsEncoding + /KanjiSubEncoding +] +dup length dict begin + { mark exch dup { .findencoding exch def } stopped cleartomark + } forall +currentdict end /encodingnames exch def + +% Invert the StandardEncoding and ISOLatin1Encoding vectors. +512 dict begin + 0 1 255 { dup ISOLatin1Encoding exch get exch 256 add def } for + 0 1 255 { dup StandardEncoding exch get exch def } for +currentdict end /decoding exch def + +/writefont % cfilename procname -> [writes the current font] + { (gsf_) exch concatstrings + /fontprocname exch def + /cfname exch def + /cfile cfname (w) file def + +% Remove unwanted keys from the font. + currentfont dup length dict begin { def } forall + { /FID /MIDVector /CurMID } { currentdict exch undef } forall + /Font currentdict end def + +% Replace the FDepVector with a list of font names. + Font /FDepVector .knownget + { [ exch { /FontName get } forall ] + Font /FDepVector 3 -1 roll put + } + if + +% Find all the special objects we know about. +% wo uses this to write out references to otherwise intractable objects. + /otherobjs writespecial length dict dup begin + writespecial + { pop Font 1 index .knownget { exch def } { pop } ifelse + } + forall + end def + +% Define a dummy FontInfo, in case the font doesn't have one. + /FontInfo 0 dict def + +% Write out the boilerplate. + Font begin + (/****************************************************************) wl + ( Portions of this file are subject to the following notice(s):) wl + systemdict /copyright get wl + FontInfo /Notice .knownget + { (----------------------------------------------------------------) wl wl + } if + (****************************************************************/) wl + () wl + (/* ) ws cfname ws ( */) wl + (/* This file was created by the ) ws product ws ( font2c utility. */) wl + () wl + (#undef DEBUG) wl + (#include "ccfont.h") wl + () wl + +% Write the procedure prologue. + (#ifdef __PROTOTYPES__) wl + (ccfont_proc\() ws fontprocname ws (\);) wl + (int) wl + fontprocname ws ((i_ctx_t *i_ctx_p, const cfont_procs *pprocs, ref *pfont)) wl + (#else) wl + (int) wl + fontprocname ws ((i_ctx_p, pprocs, pfont) i_ctx_t *i_ctx_p; const cfont_procs *pprocs; ref *pfont;) wl + (#endif) wl + ({\tint code;) wl + (\tref Font;) wl + otherobjs + { exch pop (\tref ) ws wt (;) wl } + forall + +% Write out the special objects. + otherobjs + { exch writespecial 2 index get exec + } + forall + +% Write out the main font dictionary. +% If possible, substitute the encoding name for the encoding; +% PostScript code will fix this up. + { /Encoding /PrefEnc } + { Font 1 index .knownget + { encodingnames exch .knownget { def } { pop } ifelse } + { pop } + ifelse + } + forall + (Font) Font FontType 0 eq { 5 } { 1 } ifelse wd + +% Finish the procedural initialization code. + (\t*pfont = Font;) wl + (\treturn 0;) wl + (}) wl + end % Font + + cfile closefile + + } bind def + +end def % font2cdict + +% Compute the procedure name from the font name. +% Replace all non-alphanumeric characters with '_'. +/makefontprocnamemap 256 string + 0 1 255 { 2 copy 95 put pop } for + (0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz) + { 2 copy dup put pop } forall +readonly def +/makefontprocname % makefontprocname + { dup length string cvs + dup length 1 sub -1 0 + { % Stack: string index + 2 copy 2 copy get //makefontprocnamemap exch get put pop + } + for + } def + +/writefont { font2cdict begin writefont end } def + +% If the program was invoked from the command line, run it now. +[ shellarguments + { counttomark dup 2 eq exch 3 eq or + { counttomark -1 roll cvn + (Converting ) print dup =only ( font.\n) print flush + % Ensure that we get a clean copy of the font from the + % file system. + 2 { % do both local and global + currentglobal not setglobal + dup undefinefont + } repeat + findfont setfont + (FontName is ) print currentfont /FontName get ==only (.\n) print flush + counttomark 1 eq + { % Construct the procedure name from the file name. + currentfont /FontName get makefontprocname + } + if + writefont + (Done.\n) print flush + } + { cleartomark + (Usage: font2c fontname cfilename.c [shortname]\n) print + ( e.g.: font2c Courier cour.c\n) print flush + mark + } + ifelse + } +if pop diff --git a/Master/tlpkg/tlgs/lib/font2pcl.ps b/Master/tlpkg/tlgs/lib/font2pcl.ps old mode 100755 new mode 100644 index 8da03b0f85f..e5ee4e35a8a --- a/Master/tlpkg/tlgs/lib/font2pcl.ps +++ b/Master/tlpkg/tlgs/lib/font2pcl.ps @@ -1,603 +1,603 @@ -% Copyright (C) 1993, 1994, 1995, 1997 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: font2pcl.ps 6300 2005-12-28 19:56:24Z giles $ -% font2pcl.ps -% Write out a font as a PCL bitmap font. - -/pcldict 60 dict def - -% Write out the current font as a PCL bitmap font. -% The current transformation matrix defines the font size and orientation. - -/WriteResolution? false def % true=use "resolution bound font" format, - % false=use older format - -/LJ4 false def % true=use LJ4 Typeface code - % false=use LJIIP/IID/IIIx Typeface code - -pcldict begin % internal procedures - -/findstring % findstring - { search { pop pop pop true } { pop false } ifelse - } def - - % Determine which set of keywords is present in a string. - % The last keyword set must be empty. - -/keysearch % keysearch - { 0 1 2 index length 1 sub - { 2 copy get true exch - { % Stack: - 4 index exch findstring and - } - forall - { 0 exch getinterval exit - } - if pop - } - for - exch pop length % invalid index if missing - } def - - % Determine the device height of a string in quarter-dots. - -/charheight % charheight - { gsave newpath 0 0 moveto false charpath - pathbbox exch pop exch sub exch pop 0 exch grestore - dtransform add abs 4 mul cvi - } def - - % Compute an integer version of the transformed FontBBox. - -/inflate % inflate - { dup 0 gt { ceiling } { floor } ifelse - } def -/ixbbox % - ixbbox - { /FontBBox load aload pop % might be executable or literal - 4 2 roll transform exch truncate cvi exch truncate cvi - 4 2 roll transform exch inflate cvi exch inflate cvi - } def - - % Determine the original font of a possibly transformed font. - % Since some badly behaved PostScript files construct transformed - % fonts "by hand", we can't just rely on the OrigFont pointers. - % Instead, if a font with the given name exists, and if its - % entries for FontType and UniqueID match those of the font we - % obtain by following the OrigFont chain, we use that font. - -/origfont - { { dup /OrigFont known not { exit } if /OrigFont get } loop - FontDirectory 1 index /FontName get .knownget - { % Stack: origfont namedfont - 1 index /FontType get 1 index /FontType get eq - { 1 index /UniqueID .knownget - { 1 index /UniqueID .knownget - { eq { exch } if } - { pop } - ifelse - } - if - } - if pop - } - if - } def - - - % Determine the bounding box of the current device's image. - % Free variables: row, zerow. - -/devbbox % devbbox - { % Find top and bottom whitespace. - dup - { dup 0 eq { exit } if 1 sub - dup currentdevice exch row copyscanlines - zerow ne { 1 add exit } if - } - loop % ymax1 - 0 - { 2 copy eq { exit } if - dup currentdevice exch row copyscanlines - zerow ne { exit } if - 1 add - } - loop % ymin - exch - % Find left and right whitespace. - 3 index 0 - % Stack: rw rh ymin ymax1 xmin xmax1 - 3 index 1 4 index 1 sub - { currentdevice exch row copyscanlines .findzeros - exch 4 1 roll .max 3 1 roll .min exch - } - for % xmin xmax1 - % Special check: xmin > xmax1 if height = 0 - 2 copy gt { exch pop dup } if - 6 -2 roll pop pop - - } def - - % Write values on outfile. - - /w1 { 255 and outfile exch write } def - /w2 { dup -8 bitshift w1 w1 } def - /wbyte %