Remove GhostScript, use SumatraPDF only for printing
- Remove find_ghostscript() and print_pdf_with_ghostscript() from print_label.py - SumatraPDF is now the primary print method with -print-settings noscale - Fix SumatraPDF arg order: file_path moved to last position - Add -appdata-dir so SumatraPDF reads conf/SumatraPDF-settings.txt (PrintScale=noscale) - win32api ShellExecute kept as last-resort fallback - Remove GhostScript bundling from LabelPrinter.spec and build_exe.py - Add conf/ folder pre-flight check to build_exe.py - Rebuild dist/LabelPrinter.exe (41 MB, SumatraPDF-only)
This commit is contained in:
@@ -63,7 +63,7 @@ a = Analysis(
|
||||
'print_label', 'print_label_pdf',
|
||||
'svglib', 'cairosvg',
|
||||
'watchdog', 'watchdog.observers', 'watchdog.events',
|
||||
'pystray', 'win32timezone',
|
||||
'pystray', 'win32api', 'win32print', 'win32timezone',
|
||||
],
|
||||
hookspath=[],
|
||||
hooksconfig={},
|
||||
|
||||
112
build_exe.py
112
build_exe.py
@@ -11,91 +11,41 @@ To build for Windows:
|
||||
3. Run this script: python build_exe.py
|
||||
4. The Windows .exe will be created in the dist/ folder
|
||||
|
||||
GhostScript bundling
|
||||
--------------------
|
||||
If GhostScript is installed on this build machine the script will
|
||||
automatically copy the required files into conf\\ghostscript\\ before
|
||||
calling PyInstaller so they are embedded in LabelPrinter.exe.
|
||||
The target machine then needs NO separate GhostScript install.
|
||||
Printing method
|
||||
---------------
|
||||
SumatraPDF is bundled inside the exe and used for all printing.
|
||||
It sends the PDF at its exact 35x25 mm page size via -print-settings noscale.
|
||||
No GhostScript installation required on the build or target machine.
|
||||
"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
import subprocess
|
||||
import shutil
|
||||
|
||||
# Get the current directory
|
||||
script_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
|
||||
def prepare_ghostscript():
|
||||
def check_conf_folder():
|
||||
"""
|
||||
Find the system GhostScript installation and copy the minimum files
|
||||
needed for bundling into conf\\ghostscript\\.
|
||||
|
||||
Files copied:
|
||||
conf\\ghostscript\\bin\\gswin64c.exe (or 32-bit variant)
|
||||
conf\\ghostscript\\bin\\gsdll64.dll
|
||||
conf\\ghostscript\\lib\\*.ps (PostScript init files)
|
||||
|
||||
Returns True if GhostScript was found and prepared, False otherwise.
|
||||
Verify that required files are present in the conf\ folder before building.
|
||||
Returns True if all required files exist, False otherwise.
|
||||
"""
|
||||
import glob
|
||||
|
||||
gs_exe = None
|
||||
gs_dll = None
|
||||
gs_lib = None
|
||||
|
||||
for pf in [r"C:\Program Files", r"C:\Program Files (x86)"]:
|
||||
gs_base = os.path.join(pf, "gs")
|
||||
if not os.path.isdir(gs_base):
|
||||
continue
|
||||
# Iterate versions newest-first
|
||||
for ver_dir in sorted(os.listdir(gs_base), reverse=True):
|
||||
bin_dir = os.path.join(gs_base, ver_dir, "bin")
|
||||
lib_dir = os.path.join(gs_base, ver_dir, "lib")
|
||||
if os.path.exists(os.path.join(bin_dir, "gswin64c.exe")):
|
||||
gs_exe = os.path.join(bin_dir, "gswin64c.exe")
|
||||
gs_dll = os.path.join(bin_dir, "gsdll64.dll")
|
||||
gs_lib = lib_dir
|
||||
break
|
||||
if os.path.exists(os.path.join(bin_dir, "gswin32c.exe")):
|
||||
gs_exe = os.path.join(bin_dir, "gswin32c.exe")
|
||||
gs_dll = os.path.join(bin_dir, "gsdll32.dll")
|
||||
gs_lib = lib_dir
|
||||
break
|
||||
if gs_exe:
|
||||
break
|
||||
|
||||
if not gs_exe:
|
||||
print(" WARNING: GhostScript not found on this machine.")
|
||||
print(" The exe will still build but GhostScript will NOT be bundled.")
|
||||
print(" Install GhostScript from https://ghostscript.com/releases/gsdnld.html")
|
||||
print(" then rebuild for sharp vector-quality printing.")
|
||||
return False
|
||||
|
||||
dest_bin = os.path.join("conf", "ghostscript", "bin")
|
||||
dest_lib = os.path.join("conf", "ghostscript", "lib")
|
||||
os.makedirs(dest_bin, exist_ok=True)
|
||||
os.makedirs(dest_lib, exist_ok=True)
|
||||
|
||||
print(f" GhostScript found: {os.path.dirname(gs_exe)}")
|
||||
|
||||
shutil.copy2(gs_exe, dest_bin)
|
||||
print(f" Copied: {os.path.basename(gs_exe)}")
|
||||
|
||||
if os.path.exists(gs_dll):
|
||||
shutil.copy2(gs_dll, dest_bin)
|
||||
print(f" Copied: {os.path.basename(gs_dll)}")
|
||||
|
||||
count = 0
|
||||
for ps_file in glob.glob(os.path.join(gs_lib, "*.ps")):
|
||||
shutil.copy2(ps_file, dest_lib)
|
||||
count += 1
|
||||
print(f" Copied {count} .ps init files from lib/")
|
||||
|
||||
print(f" GhostScript prepared in conf\\ghostscript\\")
|
||||
return True
|
||||
required = [
|
||||
os.path.join('conf', 'SumatraPDF.exe'),
|
||||
os.path.join('conf', 'SumatraPDF-settings.txt'),
|
||||
os.path.join('conf', 'label_template_ok.svg'),
|
||||
os.path.join('conf', 'label_template_nok.svg'),
|
||||
os.path.join('conf', 'label_template.svg'),
|
||||
]
|
||||
all_ok = True
|
||||
for f in required:
|
||||
if os.path.exists(f):
|
||||
print(f" OK: {f}")
|
||||
else:
|
||||
print(f" MISSING: {f}")
|
||||
all_ok = False
|
||||
return all_ok
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
@@ -106,15 +56,14 @@ if __name__ == '__main__':
|
||||
# Change to script directory so relative paths work
|
||||
os.chdir(script_dir)
|
||||
|
||||
# Step 1: Prepare GhostScript for bundling (Windows only)
|
||||
if sys.platform == "win32":
|
||||
print("\n[1/2] Preparing GhostScript for bundling...")
|
||||
prepare_ghostscript()
|
||||
else:
|
||||
print("\n[1/2] Skipping GhostScript prep (non-Windows build machine)")
|
||||
# Step 1: Verify conf\ folder contents
|
||||
print("\n[1/2] Checking conf\\ folder...")
|
||||
if not check_conf_folder():
|
||||
print("\nERROR: One or more required conf\\ files are missing.")
|
||||
print("Place SumatraPDF.exe and the SVG templates in the conf\\ folder, then retry.")
|
||||
sys.exit(1)
|
||||
|
||||
# Step 2: Build with PyInstaller using the handcrafted spec file.
|
||||
# The spec's Python code auto-detects conf\\ghostscript\\ and includes it.
|
||||
print("\n[2/2] Building standalone executable via LabelPrinter.spec...")
|
||||
print("This may take a few minutes...\n")
|
||||
|
||||
@@ -130,8 +79,7 @@ if __name__ == '__main__':
|
||||
print("=" * 60)
|
||||
print("\nExecutable location: ./dist/LabelPrinter.exe")
|
||||
print("\nBundled components:")
|
||||
print(" - GhostScript (vector-quality printing)")
|
||||
print(" - SumatraPDF (fallback printing)")
|
||||
print(" - SumatraPDF (primary printing, noscale 35x25 mm)")
|
||||
print(" - SVG templates, conf files")
|
||||
print("\nYou can now:")
|
||||
print(" 1. Double-click LabelPrinter.exe to run")
|
||||
|
||||
BIN
dist/LabelPrinter.exe
vendored
BIN
dist/LabelPrinter.exe
vendored
Binary file not shown.
94
dist/conf/SumatraPDF-settings.txt
vendored
94
dist/conf/SumatraPDF-settings.txt
vendored
@@ -1,94 +0,0 @@
|
||||
# For documentation, see https://www.sumatrapdfreader.org/settings/settings3-5-1.html
|
||||
Theme = Light
|
||||
FixedPageUI [
|
||||
TextColor = #000000
|
||||
BackgroundColor = #ffffff
|
||||
SelectionColor = #f5fc0c
|
||||
WindowMargin = 2 4 2 4
|
||||
PageSpacing = 4 4
|
||||
InvertColors = false
|
||||
HideScrollbars = false
|
||||
]
|
||||
ComicBookUI [
|
||||
WindowMargin = 0 0 0 0
|
||||
PageSpacing = 4 4
|
||||
CbxMangaMode = false
|
||||
]
|
||||
ChmUI [
|
||||
UseFixedPageUI = false
|
||||
]
|
||||
|
||||
SelectionHandlers [
|
||||
]
|
||||
ExternalViewers [
|
||||
]
|
||||
|
||||
ZoomLevels = 8.33 12.5 18 25 33.33 50 66.67 75 100 125 150 200 300 400 600 800 1000 1200 1600 2000 2400 3200 4800 6400
|
||||
ZoomIncrement = 0
|
||||
|
||||
PrinterDefaults [
|
||||
PrintScale = noscale
|
||||
]
|
||||
ForwardSearch [
|
||||
HighlightOffset = 0
|
||||
HighlightWidth = 15
|
||||
HighlightColor = #6581ff
|
||||
HighlightPermanent = false
|
||||
]
|
||||
Annotations [
|
||||
HighlightColor = #ffff00
|
||||
UnderlineColor = #00ff00
|
||||
SquigglyColor = #ff00ff
|
||||
StrikeOutColor = #ff0000
|
||||
FreeTextColor =
|
||||
FreeTextSize = 12
|
||||
FreeTextBorderWidth = 1
|
||||
TextIconColor =
|
||||
TextIconType =
|
||||
DefaultAuthor =
|
||||
]
|
||||
|
||||
RememberOpenedFiles = true
|
||||
RememberStatePerDocument = true
|
||||
RestoreSession = true
|
||||
UiLanguage = en
|
||||
EnableTeXEnhancements = false
|
||||
DefaultDisplayMode = automatic
|
||||
DefaultZoom = fit page
|
||||
Shortcuts [
|
||||
]
|
||||
EscToExit = false
|
||||
ReuseInstance = false
|
||||
ReloadModifiedDocuments = true
|
||||
|
||||
MainWindowBackground = #80fff200
|
||||
FullPathInTitle = false
|
||||
ShowMenubar = true
|
||||
ShowToolbar = true
|
||||
ShowFavorites = false
|
||||
ShowToc = true
|
||||
NoHomeTab = false
|
||||
TocDy = 0
|
||||
SidebarDx = 0
|
||||
ToolbarSize = 18
|
||||
TabWidth = 300
|
||||
TreeFontSize = 0
|
||||
TreeFontWeightOffset = 0
|
||||
TreeFontName = automatic
|
||||
SmoothScroll = false
|
||||
ShowStartPage = false
|
||||
CheckForUpdates = true
|
||||
WindowState = 1
|
||||
WindowPos = 566 0 788 1020
|
||||
UseTabs = true
|
||||
UseSysColors = false
|
||||
CustomScreenDPI = 0
|
||||
|
||||
FileStates [
|
||||
]
|
||||
SessionData [
|
||||
]
|
||||
TimeOfLastUpdateCheck = 0 0
|
||||
OpenCountWeek = 790
|
||||
|
||||
# Settings below are not recognized by the current version
|
||||
BIN
dist/conf/SumatraPDF.exe
vendored
BIN
dist/conf/SumatraPDF.exe
vendored
Binary file not shown.
BIN
dist/conf/accepted.png
vendored
BIN
dist/conf/accepted.png
vendored
Binary file not shown.
|
Before Width: | Height: | Size: 16 KiB |
4
dist/conf/app.conf
vendored
4
dist/conf/app.conf
vendored
@@ -1,4 +0,0 @@
|
||||
[Settings]
|
||||
file_path = C:\temp\check.txt
|
||||
printer = PDF
|
||||
|
||||
BIN
dist/conf/ghostscript/bin/gsdll64.dll
vendored
BIN
dist/conf/ghostscript/bin/gsdll64.dll
vendored
Binary file not shown.
BIN
dist/conf/ghostscript/bin/gswin64c.exe
vendored
BIN
dist/conf/ghostscript/bin/gswin64c.exe
vendored
Binary file not shown.
91
dist/conf/ghostscript/lib/PDFA_def.ps
vendored
91
dist/conf/ghostscript/lib/PDFA_def.ps
vendored
@@ -1,91 +0,0 @@
|
||||
%!
|
||||
% This is a sample prefix file for creating a PDF/A document.
|
||||
% Users should modify entries marked with "Customize".
|
||||
% This assumes an ICC profile resides in the file (srgb.icc),
|
||||
% in the current directory unless the user modifies the corresponding line below.
|
||||
|
||||
% Define entries in the document Info dictionary :
|
||||
[ /Title (Title) % Customise
|
||||
/DOCINFO pdfmark
|
||||
|
||||
% Define an ICC profile :
|
||||
/ICCProfile (srgb.icc) % Customise
|
||||
def
|
||||
|
||||
[/_objdef {icc_PDFA} /type /stream /OBJ pdfmark
|
||||
|
||||
%% This code attempts to set the /N (number of components) key for the ICC colour space.
|
||||
%% To do this it checks the ColorConversionStrategy or the device ProcessColorModel if
|
||||
%% ColorConversionStrategy is not set.
|
||||
%% This is not 100% reliable. A better solution is for the user to edit this and replace
|
||||
%% the code between the ---8<--- lines with a simple declaration like:
|
||||
%% /N 3
|
||||
%% where the value of N is the number of components from the profile defined in /ICCProfile above.
|
||||
%%
|
||||
[{icc_PDFA}
|
||||
<<
|
||||
%% ----------8<--------------8<-------------8<--------------8<----------
|
||||
systemdict /ColorConversionStrategy known {
|
||||
systemdict /ColorConversionStrategy get cvn dup /Gray eq {
|
||||
pop /N 1 false
|
||||
}{
|
||||
dup /RGB eq {
|
||||
pop /N 3 false
|
||||
}{
|
||||
/CMYK eq {
|
||||
/N 4 false
|
||||
}{
|
||||
(\tColorConversionStrategy not a device space, falling back to ProcessColorModel, output may not be valid PDF/A.\n)=
|
||||
true
|
||||
} ifelse
|
||||
} ifelse
|
||||
} ifelse
|
||||
} {
|
||||
(\tColorConversionStrategy not set, falling back to ProcessColorModel, output may not be valid PDF/A.\n)=
|
||||
true
|
||||
} ifelse
|
||||
|
||||
{
|
||||
currentpagedevice /ProcessColorModel get
|
||||
dup /DeviceGray eq {
|
||||
pop /N 1
|
||||
}{
|
||||
dup /DeviceRGB eq {
|
||||
pop /N 3
|
||||
}{
|
||||
dup /DeviceCMYK eq {
|
||||
pop /N 4
|
||||
} {
|
||||
(\tProcessColorModel not a device space.)=
|
||||
/ProcessColorModel cvx /rangecheck signalerror
|
||||
} ifelse
|
||||
} ifelse
|
||||
} ifelse
|
||||
} if
|
||||
%% ----------8<--------------8<-------------8<--------------8<----------
|
||||
|
||||
>> /PUT pdfmark
|
||||
[
|
||||
{icc_PDFA}
|
||||
{ICCProfile (r) file} stopped
|
||||
{
|
||||
(\n\tFailed to open the supplied ICCProfile for reading. This may be due to\n) print
|
||||
(\t an incorrect filename or a failure to add --permit-file-read=<profile>\n) print
|
||||
(\t to the command line. This PostScript program needs to open the file\n) print
|
||||
(\t and you must explicitly grant it permission to do so.\n\n) print
|
||||
(\tPDF/A processing aborted, output may not be a PDF/A file.\n\n) print
|
||||
cleartomark
|
||||
}
|
||||
{
|
||||
/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 (sRGB) % Customize
|
||||
>> /PUT pdfmark
|
||||
[{Catalog} <</OutputIntents [ {OutputIntent_PDFA} ]>> /PUT pdfmark
|
||||
} ifelse
|
||||
126
dist/conf/ghostscript/lib/PDFX_def.ps
vendored
126
dist/conf/ghostscript/lib/PDFX_def.ps
vendored
@@ -1,126 +0,0 @@
|
||||
%!
|
||||
% This is a sample prefix file for creating a PDF/X-3 document.
|
||||
% Users should modify entries marked with "Customize".
|
||||
% This assumes an ICC profile resides in the file (ISO Coated sb.icc)
|
||||
% in the current directory unless the user modifies the corresponding line below.
|
||||
|
||||
% First up, attempt to ensure the user has set ColorConversionStrategy correctly.
|
||||
% PDF/X-3 only permits Gray or CMYK in the output.
|
||||
%
|
||||
systemdict /ColorConversionStrategy known {
|
||||
systemdict /ColorConversionStrategy get cvn dup /Gray ne exch /CMYK ne and
|
||||
} {
|
||||
(\nERROR: ColorConversionStrategy not set.)=
|
||||
true
|
||||
} ifelse
|
||||
{ (ERROR: ColorConversionStrategy must be /DeviceGray or /DeviceCMYK.)=
|
||||
/ColorConversionStrategy cvx /rangecheck signalerror
|
||||
} if
|
||||
|
||||
|
||||
% Define entries in the document Info dictionary :
|
||||
%
|
||||
systemdict /PDFX known {systemdict /PDFX get}{3} ifelse
|
||||
|
||||
dup 1 eq {
|
||||
[ /GTS_PDFXVersion (PDF/X-1a:2001) % Must be so (the standard requires).
|
||||
/Title (Title) % Customize.
|
||||
/Trapped /False % Must be so (Ghostscript doesn't provide other).
|
||||
/DOCINFO pdfmark
|
||||
} if
|
||||
dup 3 eq {
|
||||
[ /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
|
||||
} if
|
||||
4 eq {
|
||||
[ /GTS_PDFXVersion (PDF/X-4) % Must be so (the standard requires).
|
||||
/Title (Title) % Customize.
|
||||
/Trapped /False % Must be so (Ghostscript doesn't provide other).
|
||||
/DOCINFO pdfmark
|
||||
} if
|
||||
|
||||
|
||||
/ICCProfile (ISO Coated sb.icc) def % Customize or remove.
|
||||
|
||||
% Define an ICC profile in the output, if the user specified one.
|
||||
%
|
||||
currentdict /ICCProfile known {
|
||||
[/_objdef {icc_PDFX} /type /stream /OBJ pdfmark
|
||||
|
||||
% This code attempts to set the /N (number of components) key for the ICC colour space.
|
||||
% To do this it checks the ColorConversionStrategy or the device ProcessColorModel if
|
||||
% ColorConversionStrategy is not set.
|
||||
% This is not 100% reliable. A better solution is for the user to edit this and replace
|
||||
% the code between the ---8<--- lines with a simple declaration like:
|
||||
% /N 3
|
||||
% where the value of N is the number of components from the profile defined in /ICCProfile above.
|
||||
% Note, if you don't set ColorConversionStrategy, the output will likely be invalid anyway.
|
||||
[{icc_PDFX} <<
|
||||
% ----------8<--------------8<-------------8<--------------8<----------
|
||||
systemdict /ColorConversionStrategy known {
|
||||
systemdict /ColorConversionStrategy get cvn dup /Gray eq {
|
||||
pop /N 1 false
|
||||
}{
|
||||
dup /RGB eq {
|
||||
systemdict /PDFX known {systemdict /PDFX get}{3} ifelse
|
||||
4 lt {
|
||||
(RGB is not a valid ColorConversionStrategy for PDF/X output)=
|
||||
/ColorConversionStrategycvx /rangecheck signalerror
|
||||
} if
|
||||
}{
|
||||
/CMYK eq {
|
||||
/N 4 false
|
||||
}{
|
||||
(ColorConversionStrategy not a device space, falling back to ProcessColorModel, output may not be valid PDF/X.)=
|
||||
true
|
||||
} ifelse
|
||||
} ifelse
|
||||
} ifelse
|
||||
} {
|
||||
(ColorConversionStrategy not set, falling back to ProcessColorModel, output may not be valid PDF/X.)=
|
||||
true
|
||||
} ifelse
|
||||
|
||||
{
|
||||
currentpagedevice /ProcessColorModel get
|
||||
dup /DeviceGray eq {
|
||||
pop /N 1
|
||||
}{
|
||||
dup /DeviceRGB eq {
|
||||
systemdict /PDFX known {systemdict /PDFX get}{3} ifelse
|
||||
4 lt {
|
||||
(RGB is not a valid ProcessColorModel for PDF/X output)=
|
||||
/ColorConversionStrategycvx /rangecheck signalerror
|
||||
} if
|
||||
}{
|
||||
dup /DeviceCMYK eq {
|
||||
pop /N 4
|
||||
} {
|
||||
(ProcessColorModel not a device space.)=
|
||||
/ProcessColorModel cvx /rangecheck signalerror
|
||||
} ifelse
|
||||
} ifelse
|
||||
} ifelse
|
||||
} if
|
||||
% ----------8<--------------8<-------------8<--------------8<----------
|
||||
>> /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} <</OutputIntents [ {OutputIntent_PDFX} ]>> /PUT pdfmark
|
||||
99
dist/conf/ghostscript/lib/acctest.ps
vendored
99
dist/conf/ghostscript/lib/acctest.ps
vendored
@@ -1,99 +0,0 @@
|
||||
%!
|
||||
% Check that operators do their access tests correctly.
|
||||
|
||||
% 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
|
||||
72
dist/conf/ghostscript/lib/align.ps
vendored
72
dist/conf/ghostscript/lib/align.ps
vendored
@@ -1,72 +0,0 @@
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% 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.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% 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 /HWResolution get def
|
||||
( x = (1 - H) * ) show res 0 get =string cvs show
|
||||
(, y = (V - 1) * ) show res 1 get =string cvs show
|
||||
|
||||
showpage
|
||||
58
dist/conf/ghostscript/lib/caption.ps
vendored
58
dist/conf/ghostscript/lib/caption.ps
vendored
@@ -1,58 +0,0 @@
|
||||
%!
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% 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.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Add a "caption" to the bottom of each page.
|
||||
/captionsize 20 def
|
||||
/caption
|
||||
{ /Helvetica //captionsize selectfont
|
||||
(Printed by Artifex'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 [
|
||||
%%
|
||||
%% Only print the caption if 'reason' is not 2 (device deactivation)
|
||||
%%
|
||||
/dup load /exec load 2 /ne load /exec load [ /showcaption load /exec load ] cvx /if load /exec load
|
||||
currentpagedevice /EndPage get /exec load
|
||||
] cvx
|
||||
>> setpagedevice
|
||||
end
|
||||
74
dist/conf/ghostscript/lib/cat.ps
vendored
74
dist/conf/ghostscript/lib/cat.ps
vendored
@@ -1,74 +0,0 @@
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% 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.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
%
|
||||
% $Id: cat.ps 8331 2008-02-05 11:07:00Z kens $
|
||||
%
|
||||
% Appends one file to another. Primarily used to overcome the
|
||||
% 'copy' limitation of Windows command shell for ps2epsi
|
||||
%
|
||||
% the files to be appended are given by the environament
|
||||
% variables %infile% and %outfile%. %infile% is appended to
|
||||
% %outfile%
|
||||
%
|
||||
|
||||
/datastring 1024 string def
|
||||
|
||||
{
|
||||
(outfile) getenv
|
||||
{
|
||||
/outfilename exch def
|
||||
(infile) getenv
|
||||
{
|
||||
/infilename exch def
|
||||
|
||||
infilename status
|
||||
{
|
||||
pop pop pop pop outfilename status
|
||||
{
|
||||
pop pop pop pop
|
||||
infilename (r) file /infile exch def
|
||||
outfilename (a+) file /outfile exch def
|
||||
{
|
||||
infile datastring readstring
|
||||
{
|
||||
outfile exch writestring
|
||||
}
|
||||
{
|
||||
dup length 0 gt
|
||||
{outfile exch writestring} {pop} ifelse
|
||||
exit
|
||||
} ifelse
|
||||
} loop
|
||||
infile closefile
|
||||
outfile closefile
|
||||
}
|
||||
{
|
||||
(Failed to find file ) print outfilename ==
|
||||
} ifelse
|
||||
}
|
||||
{
|
||||
(Failed to find file ) print infilename ==
|
||||
} ifelse
|
||||
}
|
||||
{
|
||||
(Couldn't find %infile% environment variable) ==
|
||||
} ifelse
|
||||
}
|
||||
{
|
||||
(Couldn't find %outfile% environment variable) ==
|
||||
}
|
||||
ifelse
|
||||
} bind
|
||||
exec
|
||||
159
dist/conf/ghostscript/lib/cid2code.ps
vendored
159
dist/conf/ghostscript/lib/cid2code.ps
vendored
@@ -1,159 +0,0 @@
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% 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.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% 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 { % <int16> .printhex2 -
|
||||
(<) print
|
||||
16#10000 add 16 =string cvrs 1 4 getinterval print
|
||||
(>) print
|
||||
} def
|
||||
/.cid2code { % <cmaptemplate> <file> <column> .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
|
||||
219
dist/conf/ghostscript/lib/docie.ps
vendored
219
dist/conf/ghostscript/lib/docie.ps
vendored
@@ -1,219 +0,0 @@
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% 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.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% docie.ps
|
||||
% Emulate CIE algorithms in PostScript.
|
||||
|
||||
% ---------------- Auxiliary procedures ---------------- %
|
||||
|
||||
/r1default [0 1] def
|
||||
/r3default [0 1 0 1 0 1] def
|
||||
|
||||
/apply3 % <u> <v> <w> [<pu> <pv> <pw>] apply3 <u'> <v'> <w'>
|
||||
{ { 4 -1 roll exch exec } forall
|
||||
} bind def
|
||||
|
||||
/restrict % <u> <min> <max> restrict <u'>
|
||||
{ 3 1 roll .max .min
|
||||
} bind def
|
||||
|
||||
/restrict3 % <u> <v> <w> [<minu> ... <maxw>] restrict3 <u'> <v'> <w'>
|
||||
{ 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 % <u> <min> <max> rescale <u'>
|
||||
{ 1 index sub 3 1 roll sub exch div 0 .max 1 .min
|
||||
} bind def
|
||||
|
||||
/rescale3 % <u> <v> <w> [<minu> ... <maxw>] rescale3 <u'> <v'> <w'>
|
||||
{ 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 % <u> <v> <w> [<uu> <uv> ... <wv> <ww>] mmult3
|
||||
% <u'> <v'> <w'>
|
||||
{ 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 % [<uu> <uv> ... <wv> <ww>] minvert3
|
||||
% [<uu'> <uv'> ... <wv'> <ww'>]
|
||||
{ 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 % <csdict> <l> <m> <n> csmap <csdict> <x> <y> <z>
|
||||
{ 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 % <csdict> <a> csciea <csdict> <x> <y> <z>
|
||||
{ 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 % <csdict> <a> <b> <c> cscieabc <csdict> <x> <y> <z>
|
||||
{ 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 % <rtable> <a[0..1]> <b[0..1]> <c[0..1]> lookup3
|
||||
% <rtable> <bytes>
|
||||
{ 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 % <csdict> <crdict> <x> <y> <z> crmap <v1> ...
|
||||
{
|
||||
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 % <a> mapcie <v1> ...
|
||||
% <a> <b> <c> mapcie <v1> ...
|
||||
{ currentcolorspace dup 0 get //mapdict exch get exec
|
||||
} bind def
|
||||
606
dist/conf/ghostscript/lib/font2pcl.ps
vendored
606
dist/conf/ghostscript/lib/font2pcl.ps
vendored
@@ -1,606 +0,0 @@
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% 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.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% font2pcl.ps
|
||||
% Write out a font as a PCL bitmap font.
|
||||
% This program must be run with -dNOSAFER, as it uses the in-memory image device
|
||||
% which is unavailable with SAFER.
|
||||
|
||||
/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 % <string> <substring> findstring <bool>
|
||||
{ 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 % <string> <array of arrays of keywords> keysearch <index>
|
||||
{ 0 1 2 index length 1 sub
|
||||
{ 2 copy get true exch
|
||||
{ % Stack: <string> <a.a.k.> <index> <bool> <keyword>
|
||||
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 % <string> charheight <int>
|
||||
{ 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 % <num> inflate <num>
|
||||
{ dup 0 gt { ceiling } { floor } ifelse
|
||||
} def
|
||||
/ixbbox % - ixbbox <llx> <lly> <urx> <ury>
|
||||
{ /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 % <rw> <rh> devbbox <ymin> <ymax1> <xmin> <xmax1>
|
||||
{ % 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 % <byte> <label> wbyte
|
||||
{ VDEBUG { print ( =byte= ) print dup == flush } { pop } ifelse w1
|
||||
} def
|
||||
/wword % <word16> <label> wword
|
||||
{ VDEBUG { print ( =word= ) print dup == flush } { pop } ifelse w2
|
||||
} def
|
||||
/wdword % <word32> <label> wdword
|
||||
{ VDEBUG { print ( =dword= ) print dup == flush } { pop } ifelse
|
||||
dup -16 bitshift w2 w2
|
||||
} def
|
||||
|
||||
/style.posture.keys
|
||||
[ { (Italic) } { (Oblique) }
|
||||
{ }
|
||||
] def
|
||||
/style.posture.values <010100> def
|
||||
|
||||
/style.appearance.width.keys
|
||||
[ { (Ultra) (Compressed) }
|
||||
{ (Extra) (Compressed) }
|
||||
{ (Extra) (Condensed) }
|
||||
{ (Extra) (Extended) }
|
||||
{ (Extra) (Expanded) }
|
||||
{ (Compressed) }
|
||||
{ (Condensed) }
|
||||
{ (Extended) }
|
||||
{ (Expanded) }
|
||||
{ }
|
||||
] def
|
||||
/style.appearance.width.values <04030207070201060600> def
|
||||
|
||||
/width.type.keys
|
||||
[ { (Ultra) (Compressed) }
|
||||
{ (Extra) (Compressed) }
|
||||
{ (Extra) (Condensed) }
|
||||
{ (Extra) (Expanded) }
|
||||
{ (Compressed) }
|
||||
{ (Condensed) }
|
||||
{ (Expanded) }
|
||||
{ }
|
||||
] def
|
||||
/width.type.values <fbfcfd03fdfe0200> def
|
||||
|
||||
/stroke.weight.keys
|
||||
[ { (Ultra) (Thin) }
|
||||
{ (Ultra) (Black) }
|
||||
{ (Extra) (Thin) }
|
||||
{ (Extra) (Light) }
|
||||
{ (Extra) (Bold) }
|
||||
{ (Extra) (Black) }
|
||||
{ (Demi) (Light) }
|
||||
{ (Demi) (Bold) }
|
||||
{ (Semi) (Light) }
|
||||
{ (Semi) (Bold) }
|
||||
{ (Thin) }
|
||||
{ (Light) }
|
||||
{ (Bold) }
|
||||
{ (Black) }
|
||||
{ }
|
||||
] def
|
||||
/stroke.weight.values <f907fafc0406fe02ff01fbfd030500> def
|
||||
|
||||
/vendor.keys
|
||||
[ { (Agfa) }
|
||||
{ (Bitstream) }
|
||||
{ (Linotype) }
|
||||
{ (Monotype) }
|
||||
{ (Adobe) }
|
||||
{ }
|
||||
] def
|
||||
/vendor.default.index 4 def % might as well be Adobe
|
||||
/old.vendor.values <020406080a00> def
|
||||
/new.vendor.values <010203040500> def
|
||||
/vendor.initials (CBLMA\000) def
|
||||
|
||||
currentdict readonly end pop % pcldict
|
||||
|
||||
% Convert and write a PCL font for the current font and transformation.
|
||||
|
||||
% Write the font header. We split this off only to avoid overflowing
|
||||
% the limit on the maximum size of a procedure.
|
||||
% Free variables: outfile uury u0y rw rh orientation uh ully
|
||||
/writefontheader
|
||||
{ outfile (\033\)s) writestring
|
||||
outfile 64 WriteResolution? { 4 add } if
|
||||
Copyright length add write==only
|
||||
outfile (W) writestring
|
||||
WriteResolution? { 20 68 } { 0 64 } ifelse
|
||||
(Font Descriptor Size) wword
|
||||
(Header Format) wbyte
|
||||
1 (Font Type) wbyte
|
||||
FullName style.posture.keys keysearch style.posture.values exch get
|
||||
FullName style.appearance.width.keys keysearch
|
||||
style.appearance.width.values exch get 4 mul add
|
||||
PaintType 2 eq { 32 add } if
|
||||
/style exch def
|
||||
style -8 bitshift (Style MSB) wbyte
|
||||
0 (Reserved) wbyte
|
||||
/baseline uury 1 sub u0y sub def
|
||||
baseline (Baseline Position) wword
|
||||
rw (Cell Width) wword
|
||||
rh (Cell Height) wword
|
||||
orientation (Orientation) wbyte
|
||||
FontInfo /isFixedPitch .knownget not { false } if
|
||||
{ 0 } { 1 } ifelse (Spacing) wbyte
|
||||
% Use loop/exit to fake a multiple-exit block.
|
||||
{ Encoding StandardEncoding eq { 10 (J) exit } if
|
||||
Encoding ISOLatin1Encoding eq { 11 (J) exit } if
|
||||
Encoding SymbolEncoding eq { 19 (M) exit } if
|
||||
Encoding DingbatsEncoding eq { 10 (L) exit } if
|
||||
% (Warning: unknown Encoding, using ISOLatin1.\n) print flush
|
||||
11 (J) exit
|
||||
}
|
||||
loop
|
||||
0 get 64 sub exch 32 mul add (Symbol Set) wword
|
||||
( ) stringwidth pop 0 dtransform add abs 4 mul
|
||||
/pitch exch def
|
||||
pitch cvi (Pitch) wword
|
||||
uh 4 mul (Height) wword % Height
|
||||
(x) charheight (x-Height) wword
|
||||
FullName width.type.keys keysearch
|
||||
width.type.values exch get (Width Type) wbyte
|
||||
style 255 and (Style LSB) wbyte
|
||||
FullName stroke.weight.keys keysearch
|
||||
stroke.weight.values exch get (Stroke Weight) wbyte
|
||||
FullName vendor.keys keysearch
|
||||
dup vendor.initials exch get 0 eq
|
||||
{ % No vendor in FullName, try Notice
|
||||
pop Copyright vendor.keys keysearch
|
||||
dup vendor.initials exch get 0 eq { pop vendor.default.index } if
|
||||
}
|
||||
if
|
||||
/vendor.index exch def
|
||||
0 (Typeface LSB) wbyte % punt
|
||||
0 (Typeface MSB) wbyte % punt
|
||||
0 (Serif Style) wbyte % punt
|
||||
2 (Quality) wbyte
|
||||
0 (Placement) wbyte
|
||||
gsave FontMatrix concat rot neg rotate
|
||||
/ulwidth
|
||||
FontInfo /UnderlineThickness .knownget
|
||||
{ 0 exch dtransform exch pop abs }
|
||||
{ resolution 100 div }
|
||||
ifelse def
|
||||
FontInfo /UnderlinePosition .knownget
|
||||
{ 0 exch transform exch pop negY ulwidth 2 div add }
|
||||
{ ully ulwidth add }
|
||||
ifelse u0y sub
|
||||
round cvi 1 .max 255 .min (Underline Position) wbyte
|
||||
ulwidth round cvi 1 .max 255 .min (Underline Thickness) wbyte
|
||||
grestore
|
||||
uh 1.2 mul 4 mul cvi (Text Height) wword
|
||||
(average lowercase character) dup stringwidth
|
||||
pop 0 dtransform add abs
|
||||
exch length div 4 mul cvi (Text Width) wword
|
||||
0
|
||||
{ dup Encoding exch get /.notdef ne { exit } if
|
||||
1 add
|
||||
}
|
||||
loop (First Code) wword
|
||||
255
|
||||
{ dup Encoding exch get /.notdef ne { exit } if
|
||||
1 sub
|
||||
}
|
||||
loop (Last Code) wword
|
||||
pitch dup cvi sub 256 mul cvi (Pitch Extended) wbyte
|
||||
0 (Height Extended) wbyte
|
||||
0 (Cap Height) wword % (default)
|
||||
currentfont /UniqueID known { UniqueID } { 0 } ifelse
|
||||
16#c1000000 add (Font Number (Adobe UniqueID)) wdword
|
||||
FontName length 16 .max string
|
||||
dup FontName exch cvs pop
|
||||
outfile exch 0 16 getinterval writestring % Font Name
|
||||
WriteResolution?
|
||||
{ resolution dup (X Resolution) wword (Y Resolution) wword
|
||||
}
|
||||
if
|
||||
outfile Copyright writestring % Copyright
|
||||
} def
|
||||
|
||||
/writePCL % <fontfile> <resolution> writePCL -
|
||||
{
|
||||
save
|
||||
currentfont begin
|
||||
pcldict begin
|
||||
80 dict begin % allow for recursion
|
||||
/saved exch def
|
||||
/resolution exch def
|
||||
/outfile exch def
|
||||
matrix currentmatrix dup 4 0 put dup 5 0 put setmatrix
|
||||
|
||||
% Supply some default values so we don't have to check later.
|
||||
|
||||
currentfont /FontInfo known not { /FontInfo 1 dict def } if
|
||||
currentfont /FontName known not { /FontName () def } if
|
||||
/Copyright FontInfo /Notice .knownget not { () } if def
|
||||
/FullName
|
||||
FontInfo /FullName .knownget not
|
||||
{ FontName dup length string cvs }
|
||||
if def
|
||||
|
||||
% Determine the original font, and its relationship to this one.
|
||||
|
||||
/OrigFont currentfont origfont def
|
||||
/OrigMatrix OrigFont /FontMatrix get def
|
||||
/OrigMatrixInverse OrigMatrix matrix invertmatrix def
|
||||
/ScaleMatrix matrix currentfont OrigFont ne
|
||||
{ FontMatrix exch OrigMatrixInverse exch concatmatrix
|
||||
} if
|
||||
def
|
||||
/CurrentScaleMatrix
|
||||
matrix currentmatrix
|
||||
matrix defaultmatrix
|
||||
dup 0 get 1 index 3 get mul 0 lt
|
||||
1 index dup 1 get exch 2 get mul 0 gt or
|
||||
/flipY exch def
|
||||
dup invertmatrix
|
||||
dup concatmatrix
|
||||
def
|
||||
/negY flipY { {neg} } { {} } ifelse def
|
||||
|
||||
% Print debugging information.
|
||||
|
||||
/CDEBUG where { pop } { /CDEBUG false def } ifelse
|
||||
/VDEBUG where { pop } { /VDEBUG false def } ifelse
|
||||
CDEBUG { /VDEBUG true def } if
|
||||
DEBUG
|
||||
{ (currentmatrix: ) print matrix currentmatrix ==
|
||||
(defaultmatrix: ) print matrix defaultmatrix ==
|
||||
(flipY: ) print flipY ==
|
||||
(scaling matrix: ) print CurrentScaleMatrix ==
|
||||
(FontMatrix: ) print FontMatrix ==
|
||||
(FontBBox: ) print /FontBBox load ==
|
||||
currentfont OrigFont ne
|
||||
{ OrigFont /FontName .knownget { (orig FontName: ) print == } if
|
||||
(orig FontMatrix: ) print OrigMatrix ==
|
||||
} if
|
||||
currentfont /ScaleMatrix .knownget { (ScaleMatrix: ) print == } if
|
||||
gsave
|
||||
FontMatrix concat
|
||||
(combined matrix: ) print matrix currentmatrix ==
|
||||
grestore
|
||||
flush
|
||||
} if
|
||||
|
||||
% Determine the orientation.
|
||||
|
||||
ScaleMatrix matrix currentmatrix dup concatmatrix
|
||||
0 1 3
|
||||
{ 1 index 1 get 0 eq 2 index 2 get 0 eq and 2 index 0 get 0 gt and
|
||||
{ exit } if
|
||||
pop -90 matrix rotate exch dup concatmatrix
|
||||
}
|
||||
for
|
||||
dup type /integertype ne
|
||||
{ (Only rotations by multiples of 90 degrees are supported:\n) print
|
||||
== flush
|
||||
saved end end end restore stop
|
||||
}
|
||||
if
|
||||
/orientation exch def
|
||||
/rot orientation 90 mul def
|
||||
DEBUG { (orientation: ) print orientation == flush } if
|
||||
|
||||
dup dup 0 get exch 3 get negY sub abs 0.5 ge
|
||||
{ (Only identical scaling in X and Y is supported:\n) print
|
||||
exch flipY 3 array astore ==
|
||||
%
|
||||
% .devicename has been deprecated
|
||||
% currentdevice .devicename ==
|
||||
%
|
||||
currentpagedevice /Name get ==
|
||||
matrix defaultmatrix == flush
|
||||
saved end end end restore stop
|
||||
}
|
||||
if pop
|
||||
|
||||
% Determine the font metrics, in the PCL character coordinate system,
|
||||
% which has +Y going towards the top of the page.
|
||||
|
||||
gsave
|
||||
FontMatrix concat
|
||||
0 0 transform
|
||||
negY round cvi /r0y exch def
|
||||
round cvi /r0x exch def
|
||||
ixbbox
|
||||
negY /rury exch def /rurx exch def
|
||||
negY /rlly exch def /rllx exch def
|
||||
/rminx rllx rurx .min def
|
||||
/rminy rlly negY rury negY .min def
|
||||
/rw rurx rllx sub abs def
|
||||
/rh rury rlly sub abs def
|
||||
gsave rot neg rotate
|
||||
0 0 transform
|
||||
negY round cvi /u0y exch def
|
||||
round cvi /u0x exch def
|
||||
ixbbox
|
||||
negY /uury exch def /uurx exch def
|
||||
negY /ully exch def /ullx exch def
|
||||
/uw uurx ullx sub def
|
||||
/uh uury ully sub def
|
||||
grestore
|
||||
DEBUG
|
||||
{ (rmatrix: ) print matrix currentmatrix ==
|
||||
(rFontBBox: ) print [rllx rlly rurx rury] ==
|
||||
(uFontBBox: ) print [ullx ully uurx uury] ==
|
||||
flush
|
||||
} if
|
||||
grestore
|
||||
|
||||
% Disable the character cache, to avoid excessive allocation
|
||||
% and memory sandbars.
|
||||
|
||||
mark cachestatus /upper exch def
|
||||
cleartomark 0 setcachelimit
|
||||
|
||||
% Write the font header.
|
||||
|
||||
writefontheader
|
||||
|
||||
% Establish an image device for rasterizing characters.
|
||||
|
||||
matrix currentmatrix
|
||||
dup 4 rminx neg put
|
||||
dup 5 rminy neg put
|
||||
% Round the width up to a multiple of 8
|
||||
% so we don't get garbage bits in the last byte of each row.
|
||||
rw 7 add -8 and rh <ff 00> makeimagedevice
|
||||
/cdevice exch def
|
||||
nulldevice % prevent page device switching
|
||||
cdevice setdevice
|
||||
|
||||
% Rasterize each character in turn.
|
||||
|
||||
/raster rw 7 add 8 idiv def
|
||||
/row raster string def
|
||||
/zerow row length string def
|
||||
0 1 Encoding length 1 sub
|
||||
{ /cindex exch def
|
||||
Encoding cindex get /.notdef ne
|
||||
{ VDEBUG { Encoding cindex get == flush } if
|
||||
erasepage initgraphics
|
||||
0 0 moveto currentpoint transform add
|
||||
( ) dup 0 cindex put show
|
||||
currentpoint transform add exch sub round cvi
|
||||
/cwidth exch abs def
|
||||
rw rh devbbox
|
||||
VDEBUG
|
||||
{ (image bbox: ) print 4 copy 4 2 roll 4 array astore == flush
|
||||
} if
|
||||
% Save the device bounding box.
|
||||
% Note that this is in current device coordinates,
|
||||
% not PCL (right-handed) coordinates.
|
||||
/bqx exch def /bpx exch def /bqy exch def /bpy exch def
|
||||
% Re-render with the character justified to (0,0).
|
||||
% This may be either the lower left or the upper left corner.
|
||||
bpx neg bpy neg idtransform moveto
|
||||
erasepage
|
||||
VDEBUG { (show point: ) print [ currentpoint transform ] == flush } if
|
||||
( ) dup 0 cindex put show
|
||||
% Find the bounding box. Note that xmin and ymin are now 0,
|
||||
% xmax1 = xw, and ymax1 = yh.
|
||||
rw rh devbbox
|
||||
/xw exch def
|
||||
% xmin or ymin can be non-zero only if the character is blank.
|
||||
xw 0 eq
|
||||
{ pop }
|
||||
{ dup 0 ne { (Non-zero xmin! ) print = } { pop } ifelse }
|
||||
ifelse
|
||||
/yh exch def
|
||||
yh 0 eq
|
||||
{ pop }
|
||||
{ dup 0 ne { (Non-zero ymin! ) print = } { pop } ifelse }
|
||||
ifelse
|
||||
|
||||
/xbw xw 7 add 8 idiv def
|
||||
/xright raster 8 mul xw sub def
|
||||
% Write the Character Code command.
|
||||
outfile (\033*c) writestring
|
||||
outfile cindex write==only
|
||||
outfile (E) writestring
|
||||
% Write the Character Definition command.
|
||||
outfile (\033\(s) writestring
|
||||
yh xbw mul 16 add
|
||||
outfile exch write=only
|
||||
% Record the character position for the .PCM file.
|
||||
/cfpos outfile fileposition 1 add def
|
||||
outfile (W\004\000\016\001) writestring
|
||||
orientation (Orientation) wbyte 0 (Reserved) wbyte
|
||||
rminx bpx add r0x sub (Left Offset) wword
|
||||
flipY { rminy bpy add neg } { rminy bqy add } ifelse r0y sub
|
||||
(Top Offset) wword
|
||||
xw (Character Width) wword
|
||||
yh (Character Height) wword
|
||||
cwidth orientation 2 ge { neg } if 4 mul (Delta X) wword
|
||||
% Write the character data.
|
||||
flipY { 0 1 yh 1 sub } { yh 1 sub -1 0 } ifelse
|
||||
{ cdevice exch row copyscanlines
|
||||
0 xbw getinterval
|
||||
CDEBUG
|
||||
{ dup
|
||||
{ 8
|
||||
{ dup 128 ge { (+) } { (.) } ifelse print
|
||||
127 and 1 bitshift
|
||||
}
|
||||
repeat pop
|
||||
}
|
||||
forall (\n) print
|
||||
}
|
||||
if
|
||||
outfile exch writestring
|
||||
}
|
||||
for
|
||||
}
|
||||
{ /bpx 0 def /bpy 0 def /bqx 0 def /bqy 0 def
|
||||
/cwidth 0 def
|
||||
/cfpos 0 def
|
||||
}
|
||||
ifelse
|
||||
|
||||
}
|
||||
for
|
||||
|
||||
% Wrap up.
|
||||
|
||||
upper setcachelimit
|
||||
outfile closefile
|
||||
|
||||
nulldevice % prevent page device switching
|
||||
saved end end end restore
|
||||
|
||||
} def
|
||||
|
||||
% Provide definitions for testing with older or non-custom interpreters.
|
||||
|
||||
/.findzeros where { pop (%END) .skipeof } if
|
||||
/.findzeros
|
||||
{ userdict begin /zs exch def /zl zs length def
|
||||
0 { dup zl ge { exit } if dup zs exch get 0 ne { exit } if 1 add } loop
|
||||
zl { dup 0 eq { exit } if dup 1 sub zs exch get 0 ne { exit } if 1 sub } loop
|
||||
exch 3 bitshift exch 3 bitshift
|
||||
2 copy lt
|
||||
{ exch zs 1 index -3 bitshift get
|
||||
{ dup 16#80 and 0 ne { exit } if exch 1 add exch 1 bitshift } loop pop
|
||||
exch zs 1 index -3 bitshift 1 sub get
|
||||
{ dup 1 and 0 ne { exit } if exch 1 sub exch -1 bitshift } loop pop
|
||||
}
|
||||
if end
|
||||
} bind def
|
||||
%END
|
||||
|
||||
/write=only where { pop (%END) .skipeof } if
|
||||
/w=s 128 string def
|
||||
/write=only
|
||||
{ w=s cvs writestring
|
||||
} bind def
|
||||
%END
|
||||
|
||||
%**************** Test
|
||||
/PCLTEST where {
|
||||
pop
|
||||
/DEBUG true def
|
||||
/CDEBUG true def
|
||||
/VDEBUG true def
|
||||
/Times-Roman findfont 10 scalefont setfont
|
||||
(t.pcf) (w) file
|
||||
300 72 div dup scale
|
||||
300 writePCL
|
||||
flush quit
|
||||
} if
|
||||
46
dist/conf/ghostscript/lib/gs_ce_e.ps
vendored
46
dist/conf/ghostscript/lib/gs_ce_e.ps
vendored
@@ -1,46 +0,0 @@
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% 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.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Define the Adobe CE (Central European) encoding vector.
|
||||
% We define it by differences from the ISOLatin1Encoding vector.
|
||||
/CEEncoding
|
||||
ISOLatin1Encoding 0 39 getinterval aload pop
|
||||
% 047
|
||||
/quotesingle
|
||||
ISOLatin1Encoding 40 56 getinterval aload pop
|
||||
% 140
|
||||
/grave
|
||||
ISOLatin1Encoding 97 31 getinterval aload pop
|
||||
% 20x
|
||||
/.notdef /.notdef /quotesinglbase /.notdef /quotedblbase /ellipsis /dagger /daggerdbl
|
||||
/.notdef /perthousand /Scaron /guilsinglleft /Sacute /Tcaron /Zcaron /Zacute
|
||||
/.notdef /grave /acute /circumflex /tilde /bullet /endash /emdash
|
||||
/.notdef /trademark /scaron /guilsinglright /sacute /tcaron /zcaron /zacute
|
||||
% 24x
|
||||
/space /caron /breve /Lslash /currency /Aogonek /brokenbar /section
|
||||
/dieresis /copyright /Scommaaccent /guillemotleft /logicalnot /hyphen /registered /Zdotaccent
|
||||
/degree /plusminus /ogonek /lslash /acute /mu /paragraph /periodcentered
|
||||
/cedilla /aogonek /scommaaccent /guillemotright /Lcaron /hungarumlaut /lcaron /zdotaccent
|
||||
% 30x
|
||||
/Racute /Aacute /Acircumflex /Abreve /Adieresis /Lacute /Cacute /Ccedilla
|
||||
/Ccaron /Eacute /Eogonek /Edieresis /Ecaron /Iacute /Icircumflex /Dcaron
|
||||
/Dcroat /Nacute /Ncaron /Oacute /Ocircumflex /Ohungarumlaut /Odieresis /multiply
|
||||
/Rcaron /Uring /Uacute /Uhungarumlaut /Udieresis /Yacute /Tcommaaccent /germandbls
|
||||
% 34x
|
||||
/racute /aacute /acircumflex /abreve /adieresis /lacute /cacute /ccedilla
|
||||
/ccaron /eacute /eogonek /edieresis /ecaron /iacute /icircumflex /dcaron
|
||||
/dcroat /nacute /ncaron /oacute /ocircumflex /ohungarumlaut /odieresis /divide
|
||||
/rcaron /uring /uacute /uhungarumlaut /udieresis /yacute /tcommaaccent /dotaccent
|
||||
256 packedarray .defineencoding
|
||||
117
dist/conf/ghostscript/lib/gs_css_e.ps
vendored
117
dist/conf/ghostscript/lib/gs_css_e.ps
vendored
@@ -1,117 +0,0 @@
|
||||
% Copyright (C) 2001-2021 Artifex Software, Inc.
|
||||
% 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.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134, San Rafael,
|
||||
% CA 94903, U.S.A., +1(415)492-9861, for further information.
|
||||
%
|
||||
|
||||
% Define the CFF StandardStrings that represent characters.
|
||||
% This is a pseudo-encoding.
|
||||
/currentglobal where
|
||||
{ pop currentglobal { setglobal } //true setglobal }
|
||||
{ { } }
|
||||
ifelse
|
||||
/CFFStandardStrings mark
|
||||
|
||||
% 0
|
||||
/.notdef /space /exclam /quotedbl /numbersign
|
||||
/dollar /percent /ampersand /quoteright /parenleft
|
||||
/parenright /asterisk /plus /comma /hyphen
|
||||
/period /slash /zero /one /two
|
||||
/three /four /five /six /seven
|
||||
/eight /nine /colon /semicolon /less
|
||||
/equal /greater /question /at /A
|
||||
/B /C /D /E /F
|
||||
/G /H /I /J /K
|
||||
/L /M /N /O /P
|
||||
% 50
|
||||
/Q /R /S /T /U
|
||||
/V /W /X /Y /Z
|
||||
/bracketleft /backslash /bracketright /asciicircum /underscore
|
||||
/quoteleft /a /b /c /d
|
||||
/e /f /g /h /i
|
||||
/j /k /l /m /n
|
||||
/o /p /q /r /s
|
||||
/t /u /v /w /x
|
||||
/y /z /braceleft /bar /braceright
|
||||
/asciitilde /exclamdown /cent /sterling /fraction
|
||||
% 100
|
||||
/yen /florin /section /currency /quotesingle
|
||||
/quotedblleft /guillemotleft /guilsinglleft /guilsinglright /fi
|
||||
/fl /endash /dagger /daggerdbl /periodcentered
|
||||
/paragraph /bullet /quotesinglbase /quotedblbase /quotedblright
|
||||
/guillemotright /ellipsis /perthousand /questiondown /grave
|
||||
/acute /circumflex /tilde /macron /breve
|
||||
/dotaccent /dieresis /ring /cedilla /hungarumlaut
|
||||
/ogonek /caron /emdash /AE /ordfeminine
|
||||
/Lslash /Oslash /OE /ordmasculine /ae
|
||||
/dotlessi /lslash /oslash /oe /germandbls
|
||||
% 150
|
||||
/onesuperior /logicalnot /mu /trademark /Eth
|
||||
/onehalf /plusminus /Thorn /onequarter /divide
|
||||
/brokenbar /degree /thorn /threequarters /twosuperior
|
||||
/registered /minus /eth /multiply /threesuperior
|
||||
/copyright /Aacute /Acircumflex /Adieresis /Agrave
|
||||
/Aring /Atilde /Ccedilla /Eacute /Ecircumflex
|
||||
/Edieresis /Egrave /Iacute /Icircumflex /Idieresis
|
||||
/Igrave /Ntilde /Oacute /Ocircumflex /Odieresis
|
||||
/Ograve /Otilde /Scaron /Uacute /Ucircumflex
|
||||
/Udieresis /Ugrave /Yacute /Ydieresis /Zcaron
|
||||
% 200
|
||||
/aacute /acircumflex /adieresis /agrave /aring
|
||||
/atilde /ccedilla /eacute /ecircumflex /edieresis
|
||||
/egrave /iacute /icircumflex /idieresis /igrave
|
||||
/ntilde /oacute /ocircumflex /odieresis /ograve
|
||||
/otilde /scaron /uacute /ucircumflex /udieresis
|
||||
/ugrave /yacute /ydieresis /zcaron /exclamsmall
|
||||
/Hungarumlautsmall /dollaroldstyle /dollarsuperior /ampersandsmall /Acutesmall
|
||||
/parenleftsuperior /parenrightsuperior /twodotenleader /onedotenleader /zerooldstyle
|
||||
/oneoldstyle /twooldstyle /threeoldstyle /fouroldstyle /fiveoldstyle
|
||||
/sixoldstyle /sevenoldstyle /eightoldstyle /nineoldstyle /commasuperior
|
||||
% 250
|
||||
/threequartersemdash /periodsuperior /questionsmall /asuperior /bsuperior
|
||||
/centsuperior /dsuperior /esuperior /isuperior /lsuperior
|
||||
/msuperior /nsuperior /osuperior /rsuperior /ssuperior
|
||||
/tsuperior /ff /ffi /ffl /parenleftinferior
|
||||
/parenrightinferior /Circumflexsmall /hyphensuperior /Gravesmall /Asmall
|
||||
/Bsmall /Csmall /Dsmall /Esmall /Fsmall
|
||||
/Gsmall /Hsmall /Ismall /Jsmall /Ksmall
|
||||
/Lsmall /Msmall /Nsmall /Osmall /Psmall
|
||||
/Qsmall /Rsmall /Ssmall /Tsmall /Usmall
|
||||
/Vsmall /Wsmall /Xsmall /Ysmall /Zsmall
|
||||
% 300
|
||||
/colonmonetary /onefitted /rupiah /Tildesmall /exclamdownsmall
|
||||
/centoldstyle /Lslashsmall /Scaronsmall /Zcaronsmall /Dieresissmall
|
||||
/Brevesmall /Caronsmall /Dotaccentsmall /Macronsmall /figuredash
|
||||
/hypheninferior /Ogoneksmall /Ringsmall /Cedillasmall /questiondownsmall
|
||||
/oneeighth /threeeighths /fiveeighths /seveneighths /onethird
|
||||
/twothirds /zerosuperior /foursuperior /fivesuperior /sixsuperior
|
||||
/sevensuperior /eightsuperior /ninesuperior /zeroinferior /oneinferior
|
||||
/twoinferior /threeinferior /fourinferior /fiveinferior /sixinferior
|
||||
/seveninferior /eightinferior /nineinferior /centinferior /dollarinferior
|
||||
/periodinferior /commainferior /Agravesmall /Aacutesmall /Acircumflexsmall
|
||||
% 350
|
||||
/Atildesmall /Adieresissmall /Aringsmall /AEsmall /Ccedillasmall
|
||||
/Egravesmall /Eacutesmall /Ecircumflexsmall /Edieresissmall /Igravesmall
|
||||
/Iacutesmall /Icircumflexsmall /Idieresissmall /Ethsmall /Ntildesmall
|
||||
/Ogravesmall /Oacutesmall /Ocircumflexsmall /Otildesmall /Odieresissmall
|
||||
/OEsmall /Oslashsmall /Ugravesmall /Uacutesmall /Ucircumflexsmall
|
||||
/Udieresissmall /Yacutesmall /Thornsmall /Ydieresissmall
|
||||
% 379
|
||||
/001.000 /001.001 /001.002 /001.003
|
||||
/Black /Bold /Book /Light /Medium
|
||||
/Regular /Roman /Semibold
|
||||
%391 = end
|
||||
|
||||
counttomark packedarray exch pop
|
||||
10 1 index .registerencoding
|
||||
.defineencoding
|
||||
exec
|
||||
62
dist/conf/ghostscript/lib/gs_il2_e.ps
vendored
62
dist/conf/ghostscript/lib/gs_il2_e.ps
vendored
@@ -1,62 +0,0 @@
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% 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.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Define the ISO Latin-2 (8859-2) encoding vector.
|
||||
|
||||
% The original version of this encoding vector used Unicode names, rather
|
||||
% than Adobe names, for many characters. Here are the names that appeared
|
||||
% in the original version:
|
||||
% \047 /quoteright /apostrophe
|
||||
% \056 /period /fullstop
|
||||
% \137 /underscore /lowline
|
||||
% \140 /quoteleft /grave
|
||||
% \055 is /hyphen in StandardEncoding, but /minus in 8859-1; we follow
|
||||
% 8859-1 here. In addition, the following substitutions were made:
|
||||
% /Lstroke => /Lslash
|
||||
% /Dstroke => /Dcroat
|
||||
% /*diaeresis => /*dieresis
|
||||
% /softhyphen => /hyphen
|
||||
% /*abovedot => /*dotaccent
|
||||
% /*doubleacute => /*hungarumlaut
|
||||
% /division => /divide
|
||||
% /ssharp => /germandbls
|
||||
|
||||
/currentglobal where
|
||||
{ pop currentglobal { setglobal } true setglobal }
|
||||
{ { } }
|
||||
ifelse
|
||||
/ISOLatin2Encoding
|
||||
% The first 144 entries are the same as the ISO Latin-1 encoding.
|
||||
ISOLatin1Encoding 0 144 getinterval aload pop
|
||||
% \22x
|
||||
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
|
||||
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
|
||||
% \24x
|
||||
/nbspace /Aogonek /breve /Lslash /currency /Lcaron /Sacute /section
|
||||
/dieresis /Scaron /Scedilla /Tcaron /Zacute /hyphen /Zcaron /Zdotaccent
|
||||
/degree /aogonek /ogonek /lslash /acute /lcaron /sacute /caron
|
||||
/cedilla /scaron /scedilla /tcaron /zacute /hungarumlaut /zcaron /zdotaccent
|
||||
% \30x
|
||||
/Racute /Aacute /Acircumflex /Abreve /Adieresis /Lacute /Cacute /Ccedilla
|
||||
/Ccaron /Eacute /Eogonek /Edieresis /Ecaron /Iacute /Icircumflex /Dcaron
|
||||
/Dcroat /Nacute /Ncaron /Oacute /Ocircumflex /Ohungarumlaut /Odieresis /multiply
|
||||
/Rcaron /Uring /Uacute /Uhungarumlaut /Udieresis /Yacute /Tcedilla /germandbls
|
||||
% \34x
|
||||
/racute /aacute /acircumflex /abreve /adieresis /lacute /cacute /ccedilla
|
||||
/ccaron /eacute /eogonek /edieresis /ecaron /iacute /icircumflex /dcaron
|
||||
/dcroat /nacute /ncaron /oacute /ocircumflex /ohungarumlaut /odieresis /divide
|
||||
/rcaron /uring /uacute /uhungarumlaut /udieresis /yacute /tcedilla /dotaccent
|
||||
256 packedarray .defineencoding
|
||||
exec
|
||||
157
dist/conf/ghostscript/lib/gs_kanji.ps
vendored
157
dist/conf/ghostscript/lib/gs_kanji.ps
vendored
@@ -1,157 +0,0 @@
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% 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.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Scaffolding for Kanji fonts. This is based on the Wadalab free font
|
||||
% from the University of Tokyo; it may not be appropriate for other
|
||||
% Kanji fonts.
|
||||
|
||||
/currentglobal where
|
||||
{ pop currentglobal { setglobal } true setglobal }
|
||||
{ { } }
|
||||
ifelse
|
||||
|
||||
% Define the encoding for the root font.
|
||||
|
||||
/KanjiEncoding
|
||||
% \x00
|
||||
0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 0 0
|
||||
% \x20
|
||||
0 1 2 3 4 5 6 7
|
||||
8 0 0 0 0 0 0 0
|
||||
9 10 11 12 13 14 15 16
|
||||
17 18 19 20 21 22 23 24
|
||||
% \x40
|
||||
25 26 27 28 29 30 31 32
|
||||
33 34 35 36 37 38 39 40
|
||||
41 42 43 44 45 46 47 48
|
||||
49 50 51 52 53 54 55 56
|
||||
% \x60
|
||||
57 58 59 60 61 62 63 64
|
||||
65 66 67 68 69 70 71 72
|
||||
73 74 75 76 77 0 0 0
|
||||
0 0 0 0 0 0 0 0
|
||||
% \x80
|
||||
0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 0 0
|
||||
% \xA0
|
||||
0 1 2 3 4 5 6 7
|
||||
8 0 0 0 0 0 0 0
|
||||
9 10 11 12 13 14 15 16
|
||||
17 18 19 20 21 22 23 24
|
||||
% \xC0
|
||||
25 26 27 28 29 30 31 32
|
||||
33 34 35 36 37 38 39 40
|
||||
41 42 43 44 45 46 47 48
|
||||
49 50 51 52 53 54 55 56
|
||||
% \xE0
|
||||
57 58 59 60 61 62 63 64
|
||||
65 66 67 68 69 70 71 72
|
||||
73 74 75 76 77 0 0 0
|
||||
0 0 0 0 0 0 0 0
|
||||
256 packedarray def
|
||||
|
||||
% Define a stub for the base font encoding.
|
||||
|
||||
/KanjiSubEncoding { /KanjiSubEncoding .findencoding } bind def
|
||||
%% Replace 3 (gs_ksb_e.ps)
|
||||
EncodingDirectory /KanjiSubEncoding
|
||||
{ (gs_ksb_e.ps) //systemdict begin runlibfile KanjiSubEncoding end }
|
||||
bind put
|
||||
|
||||
% Support procedures and data.
|
||||
|
||||
/T1FontInfo 8 dict begin
|
||||
/version (001.001) readonly def
|
||||
/FullName (KanjiBase) readonly def
|
||||
/FamilyName (KanjiBase) readonly def
|
||||
/Weight (Medium) readonly def
|
||||
/ItalicAngle 0 def
|
||||
/isFixedPitch false def
|
||||
/UnderlinePosition 0 def
|
||||
/UnderlineThickness 0 def
|
||||
currentdict end readonly def
|
||||
|
||||
/T1NF % <fontname> T1NF <font>
|
||||
{
|
||||
20 dict begin
|
||||
/FontName exch def
|
||||
/FontType 1 def
|
||||
/FontInfo T1FontInfo def
|
||||
/FontMatrix [.001 0 0 .001 0 0] def
|
||||
/FontBBox [0 0 1000 1000] def
|
||||
/Encoding KanjiSubEncoding def
|
||||
/CharStrings 150 dict def
|
||||
/PaintType 0 def
|
||||
/Private 2 dict def
|
||||
Private begin
|
||||
/BlueValues [] def
|
||||
/password 5839 def
|
||||
end
|
||||
FontName currentdict end definefont
|
||||
} def
|
||||
|
||||
/T0NF % <fontname> T0NF <font>
|
||||
{
|
||||
20 dict begin
|
||||
/FontName exch def
|
||||
/FDepVector exch def
|
||||
/FontType 0 def
|
||||
/FontMatrix [1 0 0 1 0 0] def
|
||||
/FMapType 2 def
|
||||
/Encoding KanjiEncoding def
|
||||
FontName currentdict end definefont
|
||||
} def
|
||||
|
||||
% Define the composite font and all the base fonts.
|
||||
|
||||
/CompNF % <fontname> CompNF <font>
|
||||
{
|
||||
/newname1 exch def
|
||||
newname1 dup length string cvs /str exch def
|
||||
str length /len exch def
|
||||
/fdepvector 78 array def
|
||||
/j 1 def
|
||||
16#21 1 16#74 {
|
||||
/i exch def
|
||||
KanjiEncoding i get 0 gt {
|
||||
len 4 add string /newstr exch def
|
||||
newstr 0 str putinterval
|
||||
newstr len (.r) putinterval
|
||||
newstr len 2 add i 16 2 string cvrs putinterval
|
||||
newstr cvn /newlit exch def
|
||||
newlit T1NF /newfont exch def
|
||||
fdepvector j newfont put
|
||||
/j j 1 add def
|
||||
} if
|
||||
} for
|
||||
fdepvector 0 fdepvector 1 get put
|
||||
/j 0 def
|
||||
fdepvector newname1 T0NF
|
||||
} def
|
||||
|
||||
% Define an individual character in a composite font.
|
||||
/CompD % <charstring> <(HL)> CompD -
|
||||
{ currentfont /Encoding get 1 index 0 get get % FDepVector index
|
||||
currentfont /FDepVector get exch get % base font
|
||||
dup /Encoding get 3 -1 roll 1 get get % base font character name
|
||||
exch /CharStrings get exch 3 -1 roll put
|
||||
} bind def
|
||||
|
||||
exec
|
||||
63
dist/conf/ghostscript/lib/gs_ksb_e.ps
vendored
63
dist/conf/ghostscript/lib/gs_ksb_e.ps
vendored
@@ -1,63 +0,0 @@
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% 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.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Define the KanjiSub encoding vector.
|
||||
/currentglobal where
|
||||
{ pop currentglobal { setglobal } true setglobal }
|
||||
{ { } }
|
||||
ifelse
|
||||
/KanjiSubEncoding
|
||||
%\x00
|
||||
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
|
||||
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
|
||||
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
|
||||
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
|
||||
%\x20
|
||||
/.notdef /c21 /c22 /c23 /c24 /c25 /c26 /c27
|
||||
/c28 /c29 /c2A /c2B /c2C /c2D /c2E /c2F
|
||||
/c30 /c31 /c32 /c33 /c34 /c35 /c36 /c37
|
||||
/c38 /c39 /c3A /c3B /c3C /c3D /c3E /c3F
|
||||
%\x40
|
||||
/c40 /c41 /c42 /c43 /c44 /c45 /c46 /c47
|
||||
/c48 /c49 /c4A /c4B /c4C /c4D /c4E /c4F
|
||||
/c50 /c51 /c52 /c53 /c54 /c55 /c56 /c57
|
||||
/c58 /c59 /c5A /c5B /c5C /c5D /c5E /c5F
|
||||
%\x60
|
||||
/c60 /c61 /c62 /c63 /c64 /c65 /c66 /c67
|
||||
/c68 /c69 /c6A /c6B /c6C /c6D /c6E /c6F
|
||||
/c70 /c71 /c72 /c73 /c74 /c75 /c76 /c77
|
||||
/c78 /c79 /c7A /c7B /c7C /c7D /c7E /.notdef
|
||||
%\x80
|
||||
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
|
||||
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
|
||||
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
|
||||
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
|
||||
%\xA0
|
||||
/.notdef /c21 /c22 /c23 /c24 /c25 /c26 /c27
|
||||
/c28 /c29 /c2A /c2B /c2C /c2D /c2E /c2F
|
||||
/c30 /c31 /c32 /c33 /c34 /c35 /c36 /c37
|
||||
/c38 /c39 /c3A /c3B /c3C /c3D /c3E /c3F
|
||||
%\xC0
|
||||
/c40 /c41 /c42 /c43 /c44 /c45 /c46 /c47
|
||||
/c48 /c49 /c4A /c4B /c4C /c4D /c4E /c4F
|
||||
/c50 /c51 /c52 /c53 /c54 /c55 /c56 /c57
|
||||
/c58 /c59 /c5A /c5B /c5C /c5D /c5E /c5F
|
||||
%\xE0
|
||||
/c60 /c61 /c62 /c63 /c64 /c65 /c66 /c67
|
||||
/c68 /c69 /c6A /c6B /c6C /c6D /c6E /c6F
|
||||
/c70 /c71 /c72 /c73 /c74 /c75 /c76 /c77
|
||||
/c78 /c79 /c7A /c7B /c7C /c7D /c7E /.notdef
|
||||
256 packedarray .defineencoding
|
||||
exec
|
||||
90
dist/conf/ghostscript/lib/gs_lgo_e.ps
vendored
90
dist/conf/ghostscript/lib/gs_lgo_e.ps
vendored
@@ -1,90 +0,0 @@
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% 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.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Define the Adobe "original" Latin glyph set.
|
||||
% This is not an Encoding strictly speaking, but we treat it like one.
|
||||
/currentglobal where
|
||||
{ pop currentglobal { setglobal } true setglobal }
|
||||
{ { } }
|
||||
ifelse
|
||||
/AdobeLatinOriginalGlyphEncoding mark
|
||||
|
||||
/.notdef
|
||||
/A /AE /Aacute /Acircumflex /Adieresis /Agrave /Aring /Atilde
|
||||
/B
|
||||
/C /Ccedilla
|
||||
/D
|
||||
/E /Eacute /Ecircumflex /Edieresis /Egrave /Eth
|
||||
/F
|
||||
/G
|
||||
/H
|
||||
/I /Iacute /Icircumflex /Idieresis /Igrave
|
||||
/J
|
||||
/K
|
||||
/L /Lslash
|
||||
/M
|
||||
/N /Ntilde
|
||||
/O /OE /Oacute /Ocircumflex /Odieresis /Ograve /Oslash /Otilde
|
||||
/P
|
||||
/Q
|
||||
/R
|
||||
/S /Scaron
|
||||
/T /Thorn
|
||||
/U /Uacute /Ucircumflex /Udieresis /Ugrave
|
||||
/V
|
||||
/W
|
||||
/X
|
||||
/Y /Yacute /Ydieresis
|
||||
/Z /Zcaron
|
||||
/a /aacute /acircumflex /acute /adieresis /ae /agrave /ampersand /aring
|
||||
/asciicircum /asciitilde /asterisk /at /atilde
|
||||
/b /backslash /bar /braceleft /braceright /bracketleft /bracketright /breve
|
||||
/brokenbar /bullet
|
||||
/c /caron /ccedilla /cedilla /cent /circumflex /colon /comma /copyright
|
||||
/currency
|
||||
/d /dagger /daggerdbl /degree /dieresis /divide /dollar /dotaccent /dotlessi
|
||||
/e /eacute /ecircumflex /edieresis /egrave /eight /ellipsis /emdash /endash
|
||||
/equal /eth /exclam /exclamdown
|
||||
/f /fi /five /fl /florin /four /fraction
|
||||
/g /germandbls /grave /greater /guillemotleft /guillemotright /guilsinglleft
|
||||
/guilsinglright
|
||||
/h /hungarumlaut /hyphen
|
||||
/i /iacute /icircumflex /idieresis /igrave
|
||||
/j
|
||||
/k
|
||||
/l /less /logicalnot /lslash
|
||||
/m /macron /minus /mu /multiply
|
||||
/n /nine /ntilde /numbersign
|
||||
/o /oacute /ocircumflex /odieresis /oe /ogonek /ograve /one /onehalf
|
||||
/onequarter /onesuperior /ordfeminine /ordmasculine /oslash /otilde
|
||||
/p /paragraph /parenleft /parenright /percent /period /periodcentered
|
||||
/perthousand /plus /plusminus
|
||||
/q /question /questiondown /quotedbl /quotedblbase /quotedblleft
|
||||
/quotedblright /quoteleft /quoteright /quotesinglbase /quotesingle
|
||||
/r /registered /ring
|
||||
/s /scaron /section /semicolon /seven /six /slash /space /sterling
|
||||
/t /thorn /three /threequarters /threesuperior /tilde /trademark /two
|
||||
/twosuperior
|
||||
/u /uacute /ucircumflex /udieresis /ugrave /underscore
|
||||
/v
|
||||
/w
|
||||
/x
|
||||
/y /yacute /ydieresis /yen
|
||||
/z /zcaron /zero
|
||||
|
||||
counttomark packedarray exch pop
|
||||
8 1 index .registerencoding
|
||||
.defineencoding
|
||||
exec
|
||||
59
dist/conf/ghostscript/lib/gs_lgx_e.ps
vendored
59
dist/conf/ghostscript/lib/gs_lgx_e.ps
vendored
@@ -1,59 +0,0 @@
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% 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.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Define the Adobe "extension" Latin glyph set.
|
||||
% This is not an Encoding strictly speaking, but we treat it like one.
|
||||
/currentglobal where
|
||||
{ pop currentglobal { setglobal } true setglobal }
|
||||
{ { } }
|
||||
ifelse
|
||||
/AdobeLatinExtensionGlyphEncoding mark
|
||||
|
||||
/Abreve /Amacron /Aogonek
|
||||
/Cacute /Ccaron /Dcaron
|
||||
/Dcroat /Delta
|
||||
/Ecaron /Edotaccent /Emacron /Eogonek
|
||||
/Gbreve /Gcommaaccent
|
||||
/Idotaccent /Imacron /Iogonek
|
||||
/Kcommaaccent
|
||||
/Lacute /Lcaron /Lcommaaccent
|
||||
/Nacute /Ncaron /Ncommaaccent
|
||||
/Ohungarumlaut /Omacron
|
||||
/Racute /Rcaron /Rcommaaccent
|
||||
/Sacute /Scedilla /Scommaaccent
|
||||
/Tcaron /Tcommaaccent
|
||||
/Uhungarumlaut /Umacron /Uogonek /Uring
|
||||
/Zacute /Zdotaccent
|
||||
/abreve /amacron /aogonek
|
||||
/cacute /ccaron /commaaccent
|
||||
/dcaron /dcroat
|
||||
/ecaron /edotaccent /emacron /eogonek
|
||||
/gbreve /gcommaaccent /greaterequal
|
||||
/imacron /iogonek
|
||||
/kcommaaccent
|
||||
/lacute /lcaron /lcommaaccent /lessequal /lozenge
|
||||
/nacute /ncaron /ncommaaccent /notequal
|
||||
/ohungarumlaut /omacron
|
||||
/partialdiff
|
||||
/racute /radical /rcaron /rcommaaccent
|
||||
/sacute /scedilla /scommaaccent /summation
|
||||
/tcaron /tcommaaccent
|
||||
/uhungarumlaut /umacron /uogonek /uring
|
||||
/zacute /zdotaccent
|
||||
|
||||
counttomark packedarray exch pop
|
||||
9 1 index .registerencoding
|
||||
.defineencoding
|
||||
exec
|
||||
65
dist/conf/ghostscript/lib/gs_wl1_e.ps
vendored
65
dist/conf/ghostscript/lib/gs_wl1_e.ps
vendored
@@ -1,65 +0,0 @@
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% 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.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Define the Windows 3.1 Latin 1 encoding vector (H-P Symbol set 19U).
|
||||
/currentglobal where
|
||||
{ pop currentglobal { setglobal } true setglobal }
|
||||
{ { } }
|
||||
ifelse
|
||||
/Win31Latin1Encoding
|
||||
ISOLatin1Encoding 0 39 getinterval aload pop
|
||||
/quotesingle
|
||||
ISOLatin1Encoding 40 5 getinterval aload pop
|
||||
/hyphen
|
||||
ISOLatin1Encoding 46 50 getinterval aload pop
|
||||
/grave
|
||||
ISOLatin1Encoding 97 30 getinterval aload pop
|
||||
/graybox
|
||||
% \20x
|
||||
/.notdef /.notdef /quotesinglbase /florin
|
||||
/quotedblbase /ellipsis /dagger /daggerdbl
|
||||
/circumflex /perthousand /Scaron /guilsinglleft
|
||||
/OE /.notdef /.notdef /.notdef
|
||||
/.notdef /quoteleft /quoteright /quotedblleft
|
||||
/quotedblright /bullet /endash /emdash
|
||||
/tilde /trademark /scaron /guilsinglright
|
||||
/oe /.notdef /.notdef /Ydieresis
|
||||
/.notdef /exclamdown /cent /sterling
|
||||
/currency /yen /brokenbar /section
|
||||
/dieresis /copyright /ordfeminine /guillemotleft
|
||||
/logicalnot /softhyphen /registered /overscore
|
||||
/degree /plusminus /twosuperior /threesuperior
|
||||
/acute /mu /paragraph /periodcentered
|
||||
/cedilla /onesuperior /ordmasculine /guillemotright
|
||||
/onequarter /onehalf /threequarters /questiondown
|
||||
% \30x
|
||||
/Agrave /Aacute /Acircumflex /Atilde
|
||||
/Adieresis /Aring /AE /Ccedilla
|
||||
/Egrave /Eacute /Ecircumflex /Edieresis
|
||||
/Igrave /Iacute /Icircumflex /Idieresis
|
||||
/Eth /Ntilde /Ograve /Oacute
|
||||
/Ocircumflex /Otilde /Odieresis /multiply
|
||||
/Oslash /Ugrave /Uacute /Ucircumflex
|
||||
/Udieresis /Yacute /Thorn /germandbls
|
||||
/agrave /aacute /acircumflex /atilde
|
||||
/adieresis /aring /ae /ccedilla
|
||||
/egrave /eacute /ecircumflex /edieresis
|
||||
/igrave /iacute /icircumflex /idieresis
|
||||
/eth /ntilde /ograve /oacute
|
||||
/ocircumflex /otilde /odieresis /divide
|
||||
/oslash /ugrave /uacute /ucircumflex
|
||||
/udieresis /yacute /thorn /ydieresis
|
||||
256 packedarray .defineencoding
|
||||
exec
|
||||
65
dist/conf/ghostscript/lib/gs_wl2_e.ps
vendored
65
dist/conf/ghostscript/lib/gs_wl2_e.ps
vendored
@@ -1,65 +0,0 @@
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% 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.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Define the Windows 3.1 Latin 2 encoding vector (H-P Symbol set 9E).
|
||||
/currentglobal where
|
||||
{ pop currentglobal { setglobal } true setglobal }
|
||||
{ { } }
|
||||
ifelse
|
||||
/Win32Latin2Encoding
|
||||
ISOLatin1Encoding 0 39 getinterval aload pop
|
||||
/quotesingle
|
||||
ISOLatin1Encoding 40 5 getinterval aload pop
|
||||
/hyphen
|
||||
ISOLatin1Encoding 46 50 getinterval aload pop
|
||||
/grave
|
||||
ISOLatin1Encoding 97 30 getinterval aload pop
|
||||
/graybox
|
||||
% \20x
|
||||
/.notdef /.notdef /quotesinglbase /.notdef
|
||||
/quotedblbase /ellipsis /dagger /daggerdbl
|
||||
/.notdef /perthousand /Scaron /guilsinglleft
|
||||
/Sacute /Tcaron /Zcaron /Zacute
|
||||
/.notdef /quoteleft /quoteright /quotedblleft
|
||||
/quotedblright /bullet /endash /emdash
|
||||
/.notdef /trademark /scaron /guilsinglright
|
||||
/sacute /tcaron /zcaron /zacute
|
||||
/.notdef /caron /breve /Lslash
|
||||
/currency /Aogonek /brokenbar /section
|
||||
/dieresis /copyright /Scedilla /guillemotleft
|
||||
/logicalnot /softhyphen /registered /Zdotaccent
|
||||
/degree /plusminus /ogonek /lslash
|
||||
/acute /mu /paragraph /periodcentered
|
||||
/cedilla /aogonek /scedilla /guillemotright
|
||||
/Lcaron /hungarumlaut /lcaron /zdotaccent
|
||||
% \30x
|
||||
/Racute /Aacute /Acircumflex /Abreve
|
||||
/Adieresis /Lacute /Cacute /Ccedilla
|
||||
/Ccaron /Eacute /Eogonek /Edieresis
|
||||
/Ecaron /Iacute /Icircumflex /Dcaron
|
||||
/Dcroat /Nacute /Ncaron /Oacute
|
||||
/Ocircumflex /Ohungarumlaut /Odieresis /multiply
|
||||
/Rcaron /Uring /Uacute /Uhungarumlaut
|
||||
/Udieresis /Yacute /Tcommaaccent /germandbls
|
||||
/racute /aacute /acircumflex /abreve
|
||||
/adieresis /lacute /cacute /ccedilla
|
||||
/ccaron /eacute /eogonek /edieresis
|
||||
/ecaron /iacute /icircumflex /dcaron
|
||||
/dcroat /nacute /ncaron /oacute
|
||||
/ocircumflex /ohungarumlaut /odieresis /divide
|
||||
/rcaron /uring /uacute /uhungarumlaut
|
||||
/udieresis /yacute /tcommaaccent /dotaccent
|
||||
256 packedarray .defineencoding
|
||||
exec
|
||||
65
dist/conf/ghostscript/lib/gs_wl5_e.ps
vendored
65
dist/conf/ghostscript/lib/gs_wl5_e.ps
vendored
@@ -1,65 +0,0 @@
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% 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.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Define the Windows 3.1 Latin 5 encoding vector (H-P Symbol set 5T).
|
||||
/currentglobal where
|
||||
{ pop currentglobal { setglobal } true setglobal }
|
||||
{ { } }
|
||||
ifelse
|
||||
/Win32Latin5Encoding
|
||||
ISOLatin1Encoding 0 39 getinterval aload pop
|
||||
/quotesingle
|
||||
ISOLatin1Encoding 40 5 getinterval aload pop
|
||||
/hyphen
|
||||
ISOLatin1Encoding 46 50 getinterval aload pop
|
||||
/grave
|
||||
ISOLatin1Encoding 97 30 getinterval aload pop
|
||||
/graybox
|
||||
% \20x
|
||||
/.notdef /.notdef /quotesinglbase /florin
|
||||
/quotedblbase /ellipsis /dagger /daggerdbl
|
||||
/circumflex /perthousand /Scaron /guilsinglleft
|
||||
/OE /.notdef /.notdef /.notdef
|
||||
/.notdef /quoteleft /quoteright /quotedblleft
|
||||
/quotedblright /bullet /endash /emdash
|
||||
/tilde /trademark /scaron /guilsinglright
|
||||
/oe /.notdef /.notdef /Ydieresis
|
||||
/.notdef /exclamdown /cent /sterling
|
||||
/currency /yen /brokenbar /section
|
||||
/dieresis /copyright /ordfeminine /guillemotleft
|
||||
/logicalnot /softhyphen /registered /overscore
|
||||
/degree /plusminus /twosuperior /threesuperior
|
||||
/acute /mu /paragraph /periodcentered
|
||||
/cedilla /onesuperior /ordmasculine /guillemotright
|
||||
/onequarter /onehalf /threequarters /questiondown
|
||||
% \30x
|
||||
/Agrave /Aacute /Acircumflex /Atilde
|
||||
/Adieresis /Aring /AE /Ccedilla
|
||||
/Egrave /Eacute /Ecircumflex /Edieresis
|
||||
/Igrave /Iacute /Icircumflex /Idieresis
|
||||
/Gbreve /Ntilde /Ograve /Oacute
|
||||
/Ocircumflex /Otilde /Odieresis /multiply
|
||||
/Oslash /Ugrave /Uacute /Ucircumflex
|
||||
/Udieresis /Idotaccent /Scedilla /germandbls
|
||||
/agrave /aacute /acircumflex /atilde
|
||||
/adieresis /aring /ae /ccedilla
|
||||
/egrave /eacute /ecircumflex /edieresis
|
||||
/igrave /iacute /icircumflex /idieresis
|
||||
/gbreve /ntilde /ograve /oacute
|
||||
/ocircumflex /otilde /odieresis /divide
|
||||
/oslash /ugrave /uacute /ucircumflex
|
||||
/udieresis /dotlessi /scedilla /ydieresis
|
||||
256 packedarray .defineencoding
|
||||
exec
|
||||
760
dist/conf/ghostscript/lib/gslp.ps
vendored
760
dist/conf/ghostscript/lib/gslp.ps
vendored
@@ -1,760 +0,0 @@
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% 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.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% gslp.ps - format and print text
|
||||
|
||||
% This utility provides functionality approximately equivalent to the Unix
|
||||
% `enscript' program. It prints plain text files using a single font.
|
||||
% It currently handles tabs and formfeeds, but not backspaces.
|
||||
% It will line-wrap when using fixed-pitch fonts.
|
||||
% It will also do kerning and width adjustment.
|
||||
% Standard switches implemented:
|
||||
% -12BclqRr -b<header> -f<font> -F<hfont> -L<lines> -p<outfile>
|
||||
% Sun switches implemented:
|
||||
% -T<n> set tab width
|
||||
% Switches ignored:
|
||||
% -GghKkmow -# -C -d -J -n -P -S -s -t -v
|
||||
% Switches added:
|
||||
% --add-to-space <units>
|
||||
% add the given number of 1/72" units to the width of each
|
||||
% space (may be negative)
|
||||
% --add-to-width <units>
|
||||
% add the given number of 1/72" units to the width of each
|
||||
% character (may be negative)
|
||||
% --columns <n>
|
||||
% print in <n> columns
|
||||
% --detect
|
||||
% treat the file as PostScript if it starts with %!
|
||||
% --first-page <n>
|
||||
% --duplex(|-long-edge|-short-edge)
|
||||
% use duplex if available; if not specified, select long edge
|
||||
% for portrait printing, short edge for landscape
|
||||
% start printing at page <n>
|
||||
% --encoding <encodingname> default ISOLatin1Encoding
|
||||
% Note this only takes effect during -f or -F option thus the
|
||||
% body text and header text can use different encodings.
|
||||
% --kern <file.afm>
|
||||
% kern using information from the given .AFM file
|
||||
% --last-page <n>
|
||||
% stop printing after page <n>
|
||||
% --(heading|footing)-(left|center|right) <string>
|
||||
% set the heading/footing fields; use -B first to clear
|
||||
% --margin-(top|bottom|left|right) <inches>
|
||||
% set a margin
|
||||
% --no-eject-(file|formfeed)
|
||||
% end-of-file/FF only starts a new column, not a new sheet
|
||||
% --spacing <n>
|
||||
% use double (n=2), triple (n=3), etc. spacing
|
||||
% Also, the string %# in a heading or footing is replaced with the page #.
|
||||
/PageNumberString (%#) def
|
||||
|
||||
/lpdict 150 dict def
|
||||
lpdict begin
|
||||
|
||||
/encoding /ISOLatin1Encoding def % the default encoding
|
||||
|
||||
% build a version of the font with the requested encoding (default ISOLatin1)
|
||||
/font-to-encoding { % <font> font-to-encoding <font>
|
||||
%% reencode for iso latin1; from the 2nd edition red book, sec 5.6.1
|
||||
dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall
|
||||
/Encoding encoding /Encoding findresource readonly def
|
||||
currentdict end
|
||||
% strip off the "Encoding" part of the encoding (if present)
|
||||
dup /FontName get 80 string cvs
|
||||
encoding 256 string cvs (Encoding) search {
|
||||
exch pop exch pop
|
||||
} if
|
||||
exch (-) concatstrings exch
|
||||
concatstrings cvn
|
||||
exch definefont
|
||||
} def
|
||||
|
||||
/find-latin-font { % <name> find-latin-font <font>
|
||||
findfont font-to-encoding
|
||||
} def
|
||||
|
||||
% Define the initial values of the printing parameters.
|
||||
|
||||
/AddToSpace 0 def
|
||||
/AddToWidth 0 def
|
||||
/BodyFont null def % use default
|
||||
/defaultBodyFontPortrait
|
||||
/Courier find-latin-font 10 scalefont def
|
||||
/defaultBodyFontLandscape
|
||||
/Courier find-latin-font 7 scalefont def
|
||||
/defaultBodyFont
|
||||
{ Landscape { defaultBodyFontLandscape } { defaultBodyFontPortrait } ifelse } def
|
||||
/Columns 1 def
|
||||
/DetectFileType false def
|
||||
/Duplex null def
|
||||
/EjectEOF true def
|
||||
/EjectFF true def
|
||||
/Footers false def
|
||||
/FootingLeft () def
|
||||
/FootingCenter () def
|
||||
/FootingRight () def
|
||||
/Headers true def
|
||||
/HeadingLeft () def
|
||||
/HeadingCenter () def
|
||||
/HeadingRight (page ) PageNumberString concatstrings def
|
||||
/HeadingFont null def % use default
|
||||
/defaultHeadingFont
|
||||
/Courier-Bold find-latin-font 10 scalefont def
|
||||
/Kern 0 dict def % no kerning
|
||||
/Landscape false def
|
||||
/MarginBottom 36 def % 1/2"
|
||||
/MarginLeft 36 def % 1/2"
|
||||
/MarginRight 36 def % 1/2"
|
||||
/MarginTop 36 def % 1/2"
|
||||
/MaxLines 9999 def % max lines per page
|
||||
/Noisy true def % i.e., not quiet
|
||||
/OutFile null def % null = write directly to device
|
||||
/PageFirst 1 def
|
||||
/PageLast 99999 def
|
||||
/Spacing 1 def
|
||||
/Tab 8 def
|
||||
/Truncate false def % wrap long lines, don't truncate
|
||||
|
||||
% When writing to a file, we want to write out PostScript;
|
||||
% when writing to the printer, we want to execute it;
|
||||
% some commands should be executed regardless.
|
||||
% lpexec provides for all this.
|
||||
|
||||
/lpdef { % <name> <value> lpdef -
|
||||
/def 2 true lpexec
|
||||
} def
|
||||
|
||||
/lpexec { % <arg1> ... <argn> </op> <n> <do_always> lpexec -
|
||||
OutFile null eq {
|
||||
pop 1 add true
|
||||
} {
|
||||
/t exch def 1 add /n exch def cvx
|
||||
n -1 roll dup wo
|
||||
n 1 sub { n -1 roll dup wosp } repeat
|
||||
(\n) ws n t
|
||||
} ifelse
|
||||
{ pop load exec }
|
||||
{ { pop } repeat }
|
||||
ifelse
|
||||
} def
|
||||
|
||||
/lpmoveto { % <x> <y> lpmoveto -
|
||||
% Round the coordinates for smaller output.
|
||||
2 {
|
||||
exch 100 mul round 100 div
|
||||
dup dup cvi eq { cvi } if
|
||||
} repeat
|
||||
1 index X eq { neg exch pop /V 1 } { neg /M 2 } ifelse true lpexec
|
||||
} def
|
||||
/lpshow { % <string> lpshow -
|
||||
dup length 0 ne {
|
||||
addspace 0 ne {
|
||||
addspace 0 32
|
||||
addwidth 0 ne {
|
||||
addwidth 0 6 -1 roll /awidthshow 6 true lpexec
|
||||
} {
|
||||
4 -1 roll /widthshow 4 true lpexec
|
||||
} ifelse
|
||||
} {
|
||||
addwidth 0 ne {
|
||||
addwidth 0 3 -1 roll /ashow 3 true lpexec
|
||||
} {
|
||||
OutFile null ne {
|
||||
dup dup length =string length gt {
|
||||
/show 1 false lpexec
|
||||
} {
|
||||
(S ) ws ws (\n) ws
|
||||
} ifelse
|
||||
} if show
|
||||
} ifelse
|
||||
} ifelse
|
||||
} {
|
||||
pop
|
||||
} ifelse
|
||||
} def
|
||||
/lpsetmyfont {
|
||||
dup load setfont
|
||||
OutFile null ne { cvx /setfont 1 false lpexec } { pop } ifelse
|
||||
} def
|
||||
|
||||
% Define some utility procedures.
|
||||
|
||||
/banner % ypos left center right
|
||||
{ /HFont lpsetmyfont
|
||||
/addspace 0 def /addwidth 0 def
|
||||
/pairkern 0 dict def
|
||||
3 -1 roll bannerstring pop 0 4 index pwidth showline2 pop
|
||||
exch bannerstring pwidth exch sub 2 div 3 index pwidth showline2 pop
|
||||
bannerstring
|
||||
% Prevent the last character of the heading from grazing
|
||||
% the right margin.
|
||||
% ****** WHY DOES IT REQUIRE SO MUCH PADDING? ******
|
||||
( ) stringwidth pop 2 mul add
|
||||
pwidth exch sub
|
||||
3 -1 roll pwidth showline2 pop
|
||||
} def
|
||||
|
||||
/bannerstring % string -> string width
|
||||
{ PageNumberString search
|
||||
{ exch pop pindex 4 string cvs concatstrings exch concatstrings
|
||||
}
|
||||
if dup stringwidth pop
|
||||
} def
|
||||
|
||||
/beginpage
|
||||
{ /lindex 0 def
|
||||
/skipping pindex PageFirst ge pindex PageLast le and not def
|
||||
pagex pagey Landscape {/BL} {/B} ifelse 2 true lpexec
|
||||
/pagesave exch def
|
||||
skipping { nulldevice /OutFile null def } if
|
||||
Headers
|
||||
{ lheight hdescent add
|
||||
HeadingLeft HeadingCenter HeadingRight banner
|
||||
} if
|
||||
/BFont lpsetmyfont
|
||||
/pairkern Kern def
|
||||
/addspace AddToSpace def /addwidth AddToWidth def
|
||||
pairkern length 0 ne {
|
||||
/addspace AddToSpace lpdef /addwidth AddToWidth lpdef
|
||||
} if
|
||||
} def
|
||||
|
||||
/endpage {
|
||||
lindex 0 ne {
|
||||
Footers {
|
||||
topskip plength sub hdescent add
|
||||
FootingLeft FootingCenter FootingRight banner
|
||||
} if
|
||||
/E
|
||||
} {
|
||||
/restore
|
||||
} ifelse
|
||||
pagesave exch 0 true lpexec
|
||||
/pindex pindex 1 add def
|
||||
} def
|
||||
|
||||
/endcolumn
|
||||
{ lindex colines 1 sub add colines idiv colines mul
|
||||
dup llength ge { pop endpage beginpage } { /lindex exch def } ifelse
|
||||
} def
|
||||
|
||||
/fontheight % <font> fontheight <ascent> <height>
|
||||
{ gsave setfont
|
||||
newpath 0 0 moveto
|
||||
(|^_j) false charpath
|
||||
pathbbox exch pop dup 2 index sub 4 -2 roll pop pop
|
||||
grestore exch 1.25 mul exch 1.25 mul
|
||||
} def
|
||||
|
||||
/wdict {
|
||||
dup length wosp ( dict\n) ws
|
||||
{ (dup) ws exch wosp wosp ( put\n) ws } forall
|
||||
} def
|
||||
/wosp { ( ) ws wo } def
|
||||
/wo {
|
||||
dup type /dicttype eq { wdict } { OutFile exch write==only } ifelse
|
||||
} def
|
||||
/ws {
|
||||
OutFile exch writestring
|
||||
} def
|
||||
|
||||
/outfont { % <name> <font> outfont -
|
||||
OutFile null ne {
|
||||
exch wo
|
||||
dup /FontName get
|
||||
dup wosp (-ISOLatin1) ws wosp ( RE) ws
|
||||
/FontMatrix get 0 get 1000 mul round cvi wosp
|
||||
( scalefont def\n) ws
|
||||
} {
|
||||
pop pop
|
||||
}ifelse
|
||||
} def
|
||||
|
||||
/StringFF (\f) def
|
||||
/CharFF StringFF 0 get def
|
||||
/StringTAB (\t) def
|
||||
/CharTAB StringTAB 0 get def
|
||||
|
||||
/showline { % line -> leftover_line (handles \f)
|
||||
{ showline1 dup length 0 eq { exit } if
|
||||
dup 0 get CharFF ne {
|
||||
Truncate { pop () } if
|
||||
exit
|
||||
} if
|
||||
EjectFF { endpage beginpage } { endcolumn } ifelse
|
||||
skip1
|
||||
}
|
||||
loop
|
||||
} def
|
||||
|
||||
/showline1 % line -> leftover_line (handles page break)
|
||||
{ lindex llength eq { endpage beginpage } if
|
||||
lindex colines idiv cowidth mul % x
|
||||
lindex colines mod 1 add lheight mul neg fascent sub % y
|
||||
1 index cowidth add
|
||||
showline2
|
||||
/lindex lindex 1 add def
|
||||
} def
|
||||
|
||||
/setxy {
|
||||
/ty exch def /tx exch def
|
||||
} def
|
||||
|
||||
/showline2 { % string x y xlimit -> leftover_string (handles tabs)
|
||||
2 index exch 5 2 roll setxy {
|
||||
% Stack: xinit xlimit string
|
||||
showline3 dup length 0 eq { exit } if
|
||||
dup 0 get CharTAB ne { exit } if
|
||||
tx 3 index sub tabwx div
|
||||
0.05 add ceiling tabwx mul 3 index add ty setxy
|
||||
skip1
|
||||
tx 2 index ge { exit } if
|
||||
} loop exch pop exch pop
|
||||
} def
|
||||
|
||||
/showline3 { % xlimit string -> xlimit leftover_string
|
||||
% (finds line break / tab / formfeed)
|
||||
1 index tx sub
|
||||
cwx div 0.1 add cvi 0 .max 1 index length .min
|
||||
1 index 0 3 -1 roll getinterval
|
||||
% look for \f or \t
|
||||
StringFF search { exch pop exch pop } if
|
||||
StringTAB search { exch pop exch pop } if
|
||||
dup length 0 ne {
|
||||
tx ty lpmoveto
|
||||
dup pairkern length 0 eq {
|
||||
lpshow
|
||||
} {
|
||||
{ kproc } exch /kshow 2 true lpexec
|
||||
} ifelse
|
||||
currentpoint setxy
|
||||
} if
|
||||
length dup 2 index length exch sub getinterval
|
||||
} def
|
||||
|
||||
/kproc { % <char1> <char2> kproc -
|
||||
pairkern currentfont /Encoding get 3 index get
|
||||
2 copy known {
|
||||
get currentfont /Encoding get 2 index get
|
||||
2 copy known {
|
||||
get currentfont /FontMatrix get 0 get mul
|
||||
} {
|
||||
pop pop 0
|
||||
} ifelse
|
||||
} {
|
||||
pop pop 0
|
||||
} ifelse
|
||||
addwidth add 2 index 32 eq { addspace add } if
|
||||
dup 0 eq { pop } { 0 rmoveto } ifelse
|
||||
pop pop
|
||||
} def
|
||||
|
||||
/skip1
|
||||
{ dup length 1 sub 1 exch getinterval
|
||||
} def
|
||||
|
||||
/e== { % <object> e== - -- print an object to stderr
|
||||
(%stderr) (w) file dup 3 -1 roll write==only flushfile
|
||||
} def
|
||||
|
||||
/eprint { % <string> eprint - -- print a string to stderr
|
||||
(%stderr) (w) file dup 3 -1 roll writestring flushfile
|
||||
} def
|
||||
|
||||
% Read kerning information from a .AFM file.
|
||||
|
||||
/readkern { % <afmfile> readkern <pairkerndict>
|
||||
/mfilename 1 index def
|
||||
(r) file /mfile exch def
|
||||
mfile =string readline pop
|
||||
(StartFontMetrics ) anchorsearch {
|
||||
pop pop
|
||||
/kdict 256 dict def
|
||||
{ mfile =string readline pop
|
||||
(EndFontMetrics) anchorsearch { pop pop exit } if
|
||||
(KPX ) anchorsearch {
|
||||
pop token pop cvlit /char1 exch def
|
||||
token pop cvlit /char2 exch def
|
||||
token pop /kern exch def pop
|
||||
kdict char1 .knownget not {
|
||||
5 dict kdict char1 2 index .growput
|
||||
} if
|
||||
char2 kern .growput
|
||||
} {
|
||||
pop
|
||||
} ifelse
|
||||
} loop kdict
|
||||
} {
|
||||
pop
|
||||
mfilename eprint ( does not begin with StartFontMetrics.\n) eprint
|
||||
0 dict
|
||||
} ifelse
|
||||
mfile closefile
|
||||
} def
|
||||
|
||||
% The main printing procedure
|
||||
|
||||
/doFirst true def
|
||||
/prevBFont null def
|
||||
/prevHFont null def
|
||||
|
||||
/lpfirst { % - lpfirst -
|
||||
% If writing to file we need to emit the definition of 'encoding' or it will
|
||||
% produce non-working PostScript. If we are executing directly then encoding is
|
||||
% already defined. This defines encoding as an array instead of a name, but it will work OK
|
||||
% and avoids changing the /RE procedure.
|
||||
OutFile null eq not {
|
||||
OutFile (/encoding /) writestring
|
||||
OutFile encoding 256 string cvs writestring
|
||||
OutFile ( /Encoding findresource def\n) writestring
|
||||
} if
|
||||
% Define some abbreviating procedures.
|
||||
/B {save 3 1 roll translate /X 0 def} lpdef
|
||||
/BL {save 3 1 roll 90 rotate translate /X 0 def} lpdef
|
||||
/P {/setpagedevice where {pop % <key> <value> P
|
||||
5 dict begin 2 copy def
|
||||
/Policies 2 dict dup 4 index 1 put def currentdict end setpagedevice
|
||||
} {pop pop} ifelse} lpdef
|
||||
/E {showpage restore} lpdef
|
||||
/V {neg X exch moveto} lpdef
|
||||
/M {/X 2 index def neg moveto} lpdef
|
||||
/S {currentfile =string readline pop show} lpdef
|
||||
/RE { % <isoname> <fontname> RE <font>
|
||||
findfont
|
||||
%% reencode for current 'encoding' from the 2nd edition red book, sec 5.6.1
|
||||
dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall
|
||||
/Encoding encoding def currentdict end
|
||||
definefont
|
||||
} lpdef
|
||||
} def
|
||||
|
||||
/lp { % file initial_chars ->
|
||||
/lpline exch def
|
||||
/lpfile exch def
|
||||
|
||||
doFirst { lpfirst /doFirst false def } if
|
||||
|
||||
% Initialize the device and fonts.
|
||||
/BFont
|
||||
BodyFont null eq { defaultBodyFont } { BodyFont } ifelse def
|
||||
BFont prevBFont ne {
|
||||
/BFont BFont outfont
|
||||
/prevBFont BFont def
|
||||
} if
|
||||
Headers Footers or {
|
||||
/HFont
|
||||
HeadingFont null eq { defaultHeadingFont } { HeadingFont } ifelse def
|
||||
HFont prevHFont ne {
|
||||
/HFont HFont outfont
|
||||
/prevHFont HFont def
|
||||
} if
|
||||
} if
|
||||
save
|
||||
|
||||
% Get the layout parameters.
|
||||
clippath
|
||||
gsave % for possible rotation
|
||||
Landscape { 90 rotate } if
|
||||
BFont setfont ( ) stringwidth pop /cwx exch def
|
||||
cwx Tab mul /tabwx exch def
|
||||
BFont fontheight /fheight exch def /fascent exch def
|
||||
Headers Footers or { HFont fontheight } { 0 0 } ifelse
|
||||
/hheight exch def /hascent exch def
|
||||
/hdescent hheight hascent sub def
|
||||
fheight Spacing mul /lheight exch def
|
||||
Headers { hheight lheight add } { 0 } ifelse
|
||||
/topskip exch def
|
||||
Footers { hheight lheight add } { 0 } ifelse
|
||||
/botskip exch def
|
||||
/pskip topskip botskip add def
|
||||
% Translate the page so that (0,0) corresponds to
|
||||
% the top of the topmost body line.
|
||||
pathbbox
|
||||
2 index sub MarginBottom MarginTop add sub /plength exch def
|
||||
2 index sub MarginLeft MarginRight add sub /pwidth exch def
|
||||
pwidth Columns div /cowidth exch def
|
||||
exch MarginLeft add
|
||||
exch MarginBottom add plength add topskip sub
|
||||
/pagey exch def /pagex exch def
|
||||
plength pskip sub lheight div cvi MaxLines .min
|
||||
dup /colines exch def
|
||||
Columns mul /llength exch def
|
||||
grestore
|
||||
OutFile null ne { nulldevice } if
|
||||
|
||||
% Print layout
|
||||
Noisy
|
||||
{ (Page height = ) eprint llength e==
|
||||
(.\n) eprint flush
|
||||
} if
|
||||
|
||||
colines 1 lt cowidth 1 lt or
|
||||
{
|
||||
(Page too small, it must be large to hold at least one line of text\n) eprint
|
||||
(please specify a page size using for example -sPAPERSIZE=(a4|letter)\n) eprint
|
||||
/gslp.ps cvx /limitcheck signalerror
|
||||
} if
|
||||
|
||||
|
||||
% Set duplex if requested.
|
||||
Duplex null ne {
|
||||
/Duplex true /P 2 false lpexec
|
||||
/Tumble Duplex /P 2 false lpexec
|
||||
} if
|
||||
|
||||
% Write the kerning table, if relevant.
|
||||
OutFile null ne Kern length 0 ne and {
|
||||
(/kproc) ws /kproc load wosp ( def\n) ws
|
||||
(/pairkern) ws Kern wosp ( def\n) ws
|
||||
} if
|
||||
|
||||
% Disable stack recording so we can use stopped with readline.
|
||||
$error /recordstacks false put
|
||||
|
||||
% Initialize for the first page.
|
||||
/lbuf 64000 string def
|
||||
/pindex 1 def
|
||||
beginpage
|
||||
|
||||
% Iterate through the file.
|
||||
lpline
|
||||
% First handle new-lines in the initial string (--detect mode)
|
||||
(\n) search {
|
||||
showline % output up to the first new-line
|
||||
pop pop % done with that string and the new-line
|
||||
(\n) search {
|
||||
showline % output the second new-line
|
||||
pop pop % done
|
||||
} if
|
||||
} if
|
||||
{ dup length /pos exch def
|
||||
lbuf exch 0 exch putinterval
|
||||
{ lpfile lbuf pos lbuf length pos sub getinterval readline } stopped
|
||||
{ % Filled the line before a CR or EOF.
|
||||
exch pop showline
|
||||
}
|
||||
{ % Reached CR and/or EOF first.
|
||||
exch length pos add lbuf exch 0 exch getinterval
|
||||
1 index { showline } if % omit final empty line
|
||||
{ dup length 0 eq { pop () exit } if
|
||||
showline
|
||||
} loop
|
||||
exch not { exit } if
|
||||
} ifelse
|
||||
pindex PageLast gt { exit } if
|
||||
} loop
|
||||
pop
|
||||
|
||||
% Wrap up.
|
||||
%**************** WHY IS THIS COMMENTED OUT? ****************
|
||||
% EjectEOF { endpage } { endcolumn } ifelse
|
||||
endpage
|
||||
restore
|
||||
|
||||
} def
|
||||
|
||||
end
|
||||
|
||||
% Usage: <file> lp
|
||||
% prints <file> using the current parameter settings.
|
||||
% Usage: [ <arg1> ... <argn> ] lpcommand
|
||||
% interprets args like a command line.
|
||||
|
||||
/lp { save lpdict begin () lp end restore } def
|
||||
|
||||
lpdict begin
|
||||
|
||||
/splitfn % (FontNN.NN) -> <font>
|
||||
{ dup /arg exch def length
|
||||
{ dup 0 le { exit } if
|
||||
dup 1 sub arg exch get dup 48 ge 1 index 59 le and exch 46 eq or not { exit } if
|
||||
1 sub
|
||||
} loop
|
||||
arg exch 0 exch getinterval dup cvn find-latin-font
|
||||
exch arg exch anchorsearch pop pop cvr scalefont
|
||||
} def
|
||||
|
||||
% Parse the command line switches.
|
||||
|
||||
/doswitch % argn ... arg1 (-?) restofswitch ->
|
||||
{ exch dup cvn lpdict exch known
|
||||
{ cvn load exec }
|
||||
{ exch pop (Unknown switch: ) eprint eprint (\n) eprint }
|
||||
ifelse
|
||||
} def
|
||||
|
||||
/more % argn ... arg1 restofswitch ->
|
||||
{ dup length 0 ne
|
||||
{ (- ) dup 1 3 index 0 get put
|
||||
exch dup length 1 sub 1 exch getinterval
|
||||
doswitch
|
||||
}
|
||||
{ pop
|
||||
}
|
||||
ifelse
|
||||
} def
|
||||
|
||||
/-- { (--) exch concatstrings
|
||||
dup cvn lpdict exch known
|
||||
{ cvn load exec }
|
||||
{ (Unknown switch: ) eprint eprint (\n) eprint }
|
||||
ifelse
|
||||
} def
|
||||
/--add-to-space { cvr /AddToSpace exch def } def
|
||||
/--add-to-width { cvr /AddToWidth exch def } def
|
||||
/--columns { cvi 1 .max /Columns exch def } def
|
||||
/--detect { /DetectFileType true def } def
|
||||
/--duplex { /Duplex {Landscape} def } def
|
||||
/--duplex-long-edge { /Duplex false def } def
|
||||
/--duplex-short-edge { /Duplex true def } def
|
||||
/--encoding {
|
||||
cvn /encoding exch def
|
||||
%% If we changed the encoding, then we need to remake the default fonts with the correct encoding
|
||||
/defaultBodyFontPortrait
|
||||
/Courier find-latin-font 10 scalefont def
|
||||
/defaultBodyFontLandscape
|
||||
/Courier find-latin-font 7 scalefont def
|
||||
/defaultBodyFont
|
||||
{ Landscape { defaultBodyFontLandscape } { defaultBodyFontPortrait } ifelse } def
|
||||
} def
|
||||
/--first-page { cvi /PageFirst exch def } def
|
||||
/--footing-center { /FootingCenter exch def /Footers true def } def
|
||||
/--footing-left { /FootingLeft exch def /Footers true def } def
|
||||
/--footing-right { /FootingRight exch def /Footers true def} def
|
||||
/--heading-center { /HeadingCenter exch def /Headers true def } def
|
||||
/--heading-left { /HeadingLeft exch def /Headers true def } def
|
||||
/--heading-right { /HeadingRight exch def /Headers true def } def
|
||||
/--kern { readkern /Kern exch def } def
|
||||
/--last-page { cvi /PageLast exch def } def
|
||||
/--margin-bottom { cvr 72.0 mul /MarginBottom exch def } def
|
||||
/--margin-left { cvr 72.0 mul /MarginLeft exch def } def
|
||||
/--margin-right { cvr 72.0 mul /MarginRight exch def } def
|
||||
/--margin-top { cvr 72.0 mul /MarginTop exch def } def
|
||||
/--no-eject-file { /EjectEOF false def } def
|
||||
/--no-eject-formfeed { /EjectFF false def } def
|
||||
/--spacing { cvr /Spacing exch def } def
|
||||
|
||||
/-# { pop } def % ignore
|
||||
/-+ { -- } def
|
||||
(-1)cvn { /Columns 1 def more } def
|
||||
(-2)cvn { /Columns 2 def more } def
|
||||
/-b { /HeadingLeft exch def /HeadingCenter () def /HeadingRight PageNumberString def
|
||||
/Headers true def
|
||||
/break true def
|
||||
} def
|
||||
/-B { /HeadingLeft () def /HeadingCenter () def /HeadingRight () def
|
||||
/Headers false def
|
||||
/FootingLeft () def /FootingCenter () def /FootingRight () def
|
||||
/Footers false def
|
||||
/break true def
|
||||
more
|
||||
} def
|
||||
/-C { pop } def % ignore
|
||||
/-c { /Truncate true def more } def
|
||||
/-d { pop } def % ignore
|
||||
/-f { splitfn /BodyFont exch def } def
|
||||
/-F { splitfn /HeadingFont exch def } def
|
||||
/-G { more } def % ignore
|
||||
/-g { more } def % ignore
|
||||
/-h { more } def % ignore
|
||||
/-J { pop } def % ignore
|
||||
/-K { more } def % ignore
|
||||
/-k { more } def % ignore
|
||||
/-l { 66 -L -B } def
|
||||
/-L { cvi /MaxLines exch def } def
|
||||
/-m { more } def % ignore
|
||||
/-n { pop } def % ignore
|
||||
/-o { more } def % ignore
|
||||
/-p { (w) file /OutFile exch def OutFile (%!\n) writestring } def
|
||||
/-P { pop } def % ignore
|
||||
/-q { /Noisy false def more } def
|
||||
/-r { /Landscape true def more } def
|
||||
/-R { /Landscape false def more } def
|
||||
/-S { pop } def % ignore
|
||||
/-s { pop } def % ignore
|
||||
/-T { cvi /Tab exch def } def
|
||||
/-v { pop } def % ignore
|
||||
/-w { more } def % ignore
|
||||
|
||||
/lp1 % filename ->
|
||||
{ break not { dup /HeadingLeft exch def } if
|
||||
Noisy
|
||||
{ (Printing ) eprint dup eprint (\n) eprint
|
||||
} if
|
||||
(r) file
|
||||
% If requested, check for a PostScript file.
|
||||
DetectFileType
|
||||
{ dup 2 string readstring pop dup (%!) eq
|
||||
{ % Yes, it's a PostScript file.
|
||||
pop dup 80 string readline pop pop cvx exec
|
||||
}
|
||||
{ lp
|
||||
}
|
||||
ifelse
|
||||
}
|
||||
{ () lp
|
||||
}
|
||||
ifelse
|
||||
} bind def
|
||||
|
||||
/lpcstring 8192 string def
|
||||
|
||||
end
|
||||
|
||||
/lpcommand % <[arg1 ... argn]> lpcommand <any_printed>
|
||||
{ % Push the commands on the stack in reverse order
|
||||
mark exch
|
||||
dup length 1 sub -1 0 { 1 index exch get exch } for pop
|
||||
lpdict begin
|
||||
/any false def
|
||||
/break false def
|
||||
{ dup mark eq { pop exit } if
|
||||
dup length 2 ge { dup 0 get (-) 0 get eq } { false } ifelse
|
||||
{ dup 0 2 getinterval
|
||||
exch dup length 2 sub 2 exch getinterval
|
||||
doswitch
|
||||
}
|
||||
{ dup /matched false def
|
||||
{ /matched true def /any true def lp1 } lpcstring filenameforall
|
||||
matched { pop } { lp1 } ifelse % let the error happen
|
||||
}
|
||||
ifelse
|
||||
} loop
|
||||
OutFile null ne
|
||||
{ OutFile (%stdout) (w) file ne { OutFile closefile } if
|
||||
/OutFile null def
|
||||
} if
|
||||
any
|
||||
end
|
||||
} def
|
||||
|
||||
[ .shellarguments
|
||||
{ ] dup length 0 ne { lpcommand } { false } ifelse not
|
||||
{ (%stderr) (w) file
|
||||
[ (Usage: )
|
||||
/PROGNAME where { pop PROGNAME } { (gslp) } ifelse
|
||||
( [-12BclqRr] [-b<header>] [-f<font>] [-F<hfont>]\n)
|
||||
( [-L<lines>] [-p<outfile>] [-T<tabwidth>]\n)
|
||||
( [--add-to-(space|width) <units>] [--columns <n>]\n)
|
||||
( [--detect] [--first-page <page#>] [--last-page <page#>]\n)
|
||||
( [--(heading|footing)-(left|right|center) <string>]\n)
|
||||
( [--kern <afmfile>] [--margin-(top|bottom|left|right) <inches>]\n)
|
||||
( [--no-eject-(file|formfeed)] [--spacing <n>] file1 ... filen\n)
|
||||
] { 2 copy writestring pop } forall dup flushfile closefile
|
||||
}
|
||||
if
|
||||
}
|
||||
{ pop }
|
||||
ifelse
|
||||
92
dist/conf/ghostscript/lib/gsnup.ps
vendored
92
dist/conf/ghostscript/lib/gsnup.ps
vendored
@@ -1,92 +0,0 @@
|
||||
%!
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% 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.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Prefix this to very well-behaved PostScript files for n-up printing.
|
||||
|
||||
/cdef { 1 index where { pop pop } { def } ifelse } def
|
||||
|
||||
%%%%%%%%%%%%%%%% Begin parameters %%%%%%%%%%%%%%%%
|
||||
|
||||
% All parameters are also settable from the command line with -d, e.g.,
|
||||
% -d.Nx=3
|
||||
|
||||
/.Nx 2 cdef % # of pages across the physical page
|
||||
/.Ny 2 cdef % # of pages down the physical page
|
||||
/.Landscape false cdef % if true, rotate page by 90 degrees
|
||||
|
||||
%%%%%%%%%%%%%%%% End parameters %%%%%%%%%%%%%%%%
|
||||
|
||||
vmstatus pop pop 0 eq { save pop } if
|
||||
.Landscape {
|
||||
currentpagedevice /PageSize get aload pop
|
||||
exch 2 array astore
|
||||
1 dict dup /PageSize 4 -1 roll put
|
||||
setpagedevice
|
||||
} if
|
||||
/.BP currentpagedevice /BeginPage get def
|
||||
/.EP currentpagedevice /EndPage get def
|
||||
/.Ps 1 string def % survive save/restore
|
||||
/.Pn { .Ps 0 get } def
|
||||
true setglobal % protect from restore
|
||||
/.ELevel [0] def
|
||||
/.Rmat matrix def
|
||||
false setglobal
|
||||
/.max { 2 copy lt { exch } if pop } cdef
|
||||
% Work around the common save ... showpage ... restore locution.
|
||||
/restore {
|
||||
.Rmat currentmatrix pop restore
|
||||
vmstatus pop pop .ELevel 0 get lt { .Rmat setmatrix } if
|
||||
} bind def
|
||||
<<
|
||||
/BeginPage {
|
||||
.Nx .Ny .max
|
||||
gsave
|
||||
initclip clippath pathbbox exch 4 -1 roll sub 3 1 roll exch sub
|
||||
grestore
|
||||
2 copy exch .Nx div exch .Ny div
|
||||
.Pn dup .Nx mod exch .Nx idiv .Ny 1 sub exch sub
|
||||
% Stack: nmax pw ph pw/nx ph/ny ix iy
|
||||
exch 3 index mul exch 2 index mul
|
||||
translate
|
||||
% Stack: nmax pw ph pw/nx ph/ny
|
||||
4 -1 roll 4 index div 4 -1 roll 4 index div
|
||||
% Stack: nmax pw/nx ph/ny pw/nmax ph/nmax
|
||||
exch 4 -1 roll exch sub 2 div
|
||||
3 1 roll sub 2 div
|
||||
translate
|
||||
% Stack: nmax
|
||||
1 exch div dup scale
|
||||
.BP
|
||||
}
|
||||
/EndPage {
|
||||
dup 2 lt {
|
||||
.ELevel 0 vmstatus pop pop put
|
||||
.Ps 0 .Pn 1 add .Nx .Ny mul mod put
|
||||
.Pn 0 eq {
|
||||
.EP
|
||||
} {
|
||||
pop pop false
|
||||
} ifelse
|
||||
} {
|
||||
pop pop false
|
||||
} ifelse
|
||||
}
|
||||
>> setpagedevice
|
||||
/.EOJ {
|
||||
{ .Pn 0 eq { exit } if showpage } loop
|
||||
} def
|
||||
|
||||
{ currentfile cvx exec .EOJ } exec
|
||||
3552
dist/conf/ghostscript/lib/ht_ccsto.ps
vendored
3552
dist/conf/ghostscript/lib/ht_ccsto.ps
vendored
File diff suppressed because it is too large
Load Diff
1817
dist/conf/ghostscript/lib/image-qa.ps
vendored
1817
dist/conf/ghostscript/lib/image-qa.ps
vendored
File diff suppressed because it is too large
Load Diff
26
dist/conf/ghostscript/lib/jispaper.ps
vendored
26
dist/conf/ghostscript/lib/jispaper.ps
vendored
@@ -1,26 +0,0 @@
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% 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.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Select JIS B paper sizes for b0...b6.
|
||||
|
||||
userdict begin
|
||||
/b0 /jisb0 load def
|
||||
/b1 /jisb1 load def
|
||||
/b2 /jisb2 load def
|
||||
/b3 /jisb3 load def
|
||||
/b4 /jisb4 load def
|
||||
/b5 /jisb5 load def
|
||||
/b6 /jisb6 load def
|
||||
end
|
||||
3
dist/conf/ghostscript/lib/jobseparator.ps
vendored
3
dist/conf/ghostscript/lib/jobseparator.ps
vendored
@@ -1,3 +0,0 @@
|
||||
% Execute the "real" system version of the ^D to separate jobs
|
||||
% when -dJOBDSERVER is being used.
|
||||
<04> cvn .systemvar exec
|
||||
30
dist/conf/ghostscript/lib/landscap.ps
vendored
30
dist/conf/ghostscript/lib/landscap.ps
vendored
@@ -1,30 +0,0 @@
|
||||
%!
|
||||
% landscap.ps
|
||||
%
|
||||
% This file can be prepended to most PostScript pages to force
|
||||
% rotation to "landscape" mode.
|
||||
%
|
||||
% There are (at least) four possible ways to reasonably position a
|
||||
% page after rotation. Any of the four old corners (llx,lly e.g.)
|
||||
% can be moved to match the corresonding new corner.
|
||||
% By uncommmenting the appropriate line below (i.e., remove the
|
||||
% leading '%'), any such positioning can be chosen for positive or
|
||||
% negative rotation. The comments at the end of each "rotate" line
|
||||
% indicate the ORIGINAL corner to be aligned. For example, as given
|
||||
% below, the lower left hand corner is aligned. When viewed, this
|
||||
% corner will have moved to the urx,lly corner.
|
||||
%
|
||||
% originally by James E. Burns, 3/8/93, burns@nova.bellcore.com
|
||||
%
|
||||
gsave clippath pathbbox grestore
|
||||
4 dict begin
|
||||
/ury exch def /urx exch def /lly exch def /llx exch def
|
||||
%90 rotate llx neg ury neg translate % llx,ury
|
||||
90 rotate llx neg llx urx sub lly sub translate % llx,lly
|
||||
%90 rotate ury lly sub urx sub ury neg translate % urx,ury
|
||||
%90 rotate ury lly sub urx sub llx urx sub lly sub translate % urx,lly
|
||||
%-90 rotate urx neg lly neg translate % urx,lly
|
||||
%-90 rotate urx neg urx llx sub ury sub translate % urx,ury
|
||||
%-90 rotate llx lly add ury sub urx llx sub ury sub translate % llx,ury
|
||||
%-90 rotate llx lly add ury sub lly neg translate % llx,lly
|
||||
end
|
||||
164
dist/conf/ghostscript/lib/lines.ps
vendored
164
dist/conf/ghostscript/lib/lines.ps
vendored
@@ -1,164 +0,0 @@
|
||||
%!
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% 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.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Test line rendering (stroke).
|
||||
|
||||
% Exercise the miter limit. The left column of lines should bevel at
|
||||
% 90 degrees, the right column at 60 degrees.
|
||||
|
||||
gsave
|
||||
1.8 setlinewidth
|
||||
0 setgray
|
||||
15 15 scale
|
||||
-5 5 translate
|
||||
[1.415 2.0]
|
||||
{ setmiterlimit 12 0 translate 0 0 moveto
|
||||
10 30 360
|
||||
{ gsave 5 0 rlineto rotate 2.5 0 rlineto
|
||||
gsave 0 setlinewidth 1 0 0 setrgbcolor stroke grestore
|
||||
strokepath 0 setlinewidth stroke
|
||||
grestore
|
||||
0 4 rmoveto
|
||||
} for
|
||||
} forall
|
||||
|
||||
showpage
|
||||
grestore
|
||||
|
||||
% Exercise all the combinations of cap and join styles
|
||||
% for one-line, two-line, and closed paths.
|
||||
|
||||
gsave
|
||||
|
||||
/drawlines {
|
||||
gsave
|
||||
2.0 setmiterlimit
|
||||
2.0 setlinewidth
|
||||
6 6 scale
|
||||
5 20 translate
|
||||
{0 1 2} % line cap
|
||||
{ setlinecap gsave
|
||||
{0 1 2} % line join
|
||||
{ setlinejoin gsave
|
||||
{ {currentpoint lineto}
|
||||
{3 7 lineto}
|
||||
{3 7 lineto 5 1 lineto}
|
||||
{3 7 lineto 6 3 lineto closepath}
|
||||
}
|
||||
{ gsave 0 0 moveto exec
|
||||
gsave stroke grestore
|
||||
0.5 setlinewidth 1 0 0 setrgbcolor stroke
|
||||
grestore 8 0 translate
|
||||
} forall
|
||||
grestore 35 0 translate
|
||||
} forall
|
||||
grestore 0 20 translate
|
||||
} forall
|
||||
grestore
|
||||
} def
|
||||
/xflip
|
||||
{ 8.5 72 mul 0 translate -1 1 scale
|
||||
} def
|
||||
/rot90
|
||||
{ 90 rotate 0 -9.75 72 mul translate
|
||||
} def
|
||||
/rot180
|
||||
{ rot90 rot90
|
||||
} def
|
||||
/rot270
|
||||
{ rot180 rot90
|
||||
} def
|
||||
|
||||
drawlines showpage
|
||||
gsave xflip drawlines grestore showpage
|
||||
gsave rot90 drawlines grestore showpage
|
||||
gsave rot90 xflip drawlines grestore showpage
|
||||
gsave drawlines rot180 showpage
|
||||
gsave rot180 xflip drawlines grestore showpage
|
||||
gsave rot270 drawlines grestore showpage
|
||||
gsave rot270 xflip drawlines grestore showpage
|
||||
grestore
|
||||
|
||||
% Here are some boundary conditions, contributed by Mark Rawling.
|
||||
|
||||
gsave
|
||||
1 setlinecap
|
||||
2.6 setmiterlimit
|
||||
3.0 setlinewidth
|
||||
|
||||
5 5 scale
|
||||
10 20 translate
|
||||
|
||||
% [ 0.5 sqrt dup dup dup neg exch 0 0 ] concat % 45 rotate
|
||||
|
||||
{0 1 2} % line join
|
||||
{
|
||||
setlinejoin gsave
|
||||
0 0 moveto 0 10 lineto 10 0 lineto gsave stroke grestore
|
||||
15 0 translate
|
||||
0 0 moveto 0 10 lineto 10 20 lineto gsave stroke grestore
|
||||
15 0 translate
|
||||
10 0 moveto 10 10 lineto 0 20 lineto gsave stroke grestore
|
||||
15 0 translate
|
||||
10 0 moveto 10 10 lineto 0 0 lineto gsave stroke grestore
|
||||
grestore
|
||||
gsave
|
||||
0 20 translate
|
||||
0 20 moveto 0 10 lineto 10 20 lineto gsave stroke grestore
|
||||
15 0 translate
|
||||
0 20 moveto 0 10 lineto 10 0 lineto gsave stroke grestore
|
||||
15 0 translate
|
||||
10 20 moveto 10 10 lineto 0 0 lineto gsave stroke grestore
|
||||
15 0 translate
|
||||
10 20 moveto 10 10 lineto 0 20 lineto gsave stroke grestore
|
||||
grestore 60 0 translate
|
||||
} forall
|
||||
|
||||
showpage
|
||||
grestore
|
||||
|
||||
% Test narrow lines at a variety of angles.
|
||||
|
||||
gsave
|
||||
|
||||
/rad 120 def
|
||||
/ray { gsave rotate 0 0 moveto rad 0 rlineto stroke grestore } def
|
||||
/star
|
||||
{ newpath gsave
|
||||
gsave 0.5 setgray 0 0 rad 0 360 arc stroke grestore
|
||||
0 90 359
|
||||
{ rotate
|
||||
0 3 14 { ray } for
|
||||
15 15 89 { ray } for
|
||||
} for
|
||||
grestore
|
||||
} def
|
||||
|
||||
0 setgray
|
||||
150 150 translate
|
||||
[ [ 0 0.5 1 ] [ 1.5 2 2.5 ] [ 3 3.5 4 ] ]
|
||||
{ gsave
|
||||
{ setlinewidth star
|
||||
250 0 translate
|
||||
} forall
|
||||
grestore 0 250 translate
|
||||
} forall
|
||||
|
||||
grestore showpage
|
||||
|
||||
% End
|
||||
|
||||
quit
|
||||
771
dist/conf/ghostscript/lib/mkcidfm.ps
vendored
771
dist/conf/ghostscript/lib/mkcidfm.ps
vendored
@@ -1,771 +0,0 @@
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% 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.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
|
||||
% Generate a cidfmap file for substituting CID fonts with TrueType
|
||||
% fonts, based on fonts found in the directory FONTDIR.
|
||||
%
|
||||
% The directory FONTDIR is searched for fonts whose filename
|
||||
% matches a Path in the cidsubs dictionary.
|
||||
% Any matches are written out as a CID font substitution.
|
||||
%
|
||||
% For each fontname and alias in the fontaliases dictionary,
|
||||
% write out each alias that matches a substituted font.
|
||||
% Where multiple aliases are possible, use the first match.
|
||||
%
|
||||
% Note that the substitutions and aliases in this file were created
|
||||
% by someone who doesn't understand Chinese, Japanese or Korean.
|
||||
% The initial list contains only font files found in Windows XP.
|
||||
% Please submit corrections and additions.
|
||||
%
|
||||
% See the end of file for references and further information.
|
||||
%
|
||||
% Font filenames must match case.
|
||||
% All font filenames are currently lower case.
|
||||
%
|
||||
% Usage: gswin32c -q -dBATCH -sFONTDIR=c:/windows/fonts
|
||||
% -sCIDFMAP=c:/gs/cidfmap mkcidfm.ps
|
||||
|
||||
systemdict /FONTDIR known not { /FONTDIR (c:/windows/fonts) def } if
|
||||
|
||||
systemdict /CIDFMAP known { CIDFMAP } { (%stdout) } ifelse
|
||||
/cidfmap exch (w) file def
|
||||
|
||||
% Directory separator as used by filenameforall
|
||||
/dirsep (/) def
|
||||
|
||||
% This dictionary contains a list of font substitutions.
|
||||
% The first matching substitution in the array will be used.
|
||||
/fontaliases
|
||||
<<
|
||||
% otf's /AdobeMingStd-Light /AdobeHeitiStd-Regular /AdobeSongStd-Light
|
||||
% /KozMinPr6N-Regular /AdobeMyungjoStd-Medium came with Acroread 9 unix CJK pack.
|
||||
|
||||
% ArialUnicode and a common font are used as a last-resort catch-all
|
||||
% in most cases.
|
||||
|
||||
% Traditional Chinese
|
||||
% Mingliu and Kaiu are known to use patented TT instructions
|
||||
/MSung-Light [ /MingLiU /ArialUnicodeMS-CNS ]
|
||||
/MSung-Medium [ /MingLiU /ArialUnicodeMS-CNS ]
|
||||
/MHei-Medium [ /MicrosoftJhengHeiRegular /ArialUnicodeMS-CNS /MingLiU ]
|
||||
/MKai-Medium [ /DFKaiShu-SB-Estd-BF /Arial-Unicode-MS /MingLiU /ArialUnicodeMS-CNS ]
|
||||
/AdobeMingStd-Light [ /MingLiU /ArialUnicodeMS-CNS ]
|
||||
|
||||
% Simplified Chinese
|
||||
/STSong-Light [ /SimSun /SimSun-18030 /ArialUnicodeMS-GB ]
|
||||
/STFangsong-Light [ /FangSong /SimSun /ArialUnicodeMS-GB ]
|
||||
/STHeiti-Regular [ /MicrosoftYaHei /SimHei /ArialUnicodeMS-GB ]
|
||||
/STKaiti-Regular [ /KaiTi /SimHei /ArialUnicodeMS-GB ]
|
||||
/AdobeHeitiStd-Regular [ /MicrosoftYaHei /SimHei /ArialUnicodeMS-GB ]
|
||||
/AdobeSongStd-Light [ /SimSun /ArialUnicodeMS-GB ]
|
||||
|
||||
% Japanese
|
||||
/Ryumin-Light [ /MS-Mincho04 /MS-Mincho /ArialUnicodeMS-JP ]
|
||||
/Ryumin-Medium [ /MS-Mincho04 /MS-Mincho /ArialUnicodeMS-JP ]
|
||||
/GothicBBB-Medium [ /MS-Gothic04 /MS-Gothic /Meiryo /ArialUnicodeMS-JP ]
|
||||
/HeiseiMin-W3 [ /MS-Mincho04 /MS-Mincho /ArialUnicodeMS-JP ]
|
||||
/HeiseiKakuGo-W5 [ /MS-Gothic04 /MS-Gothic /Meiryo /ArialUnicodeMS-JP ]
|
||||
/KozMinPr6N-Regular [ /MS-Mincho04 /MS-Mincho /ArialUnicodeMS-JP ]
|
||||
|
||||
% Korean
|
||||
% Malgun seems to have a full set of Hangu but not much of Kanji glyphs
|
||||
% "Gulim Old Hangul Jamo" has Hangu but no Kanji, and PMmy has Kanji but
|
||||
% no Hangu. Neither are useful for Korean users.
|
||||
/HYSMyeongJo-Medium [ /Batang /NewBatang /GulimChe /ArialUnicodeMS-KR /MalgunGothicRegular ]
|
||||
/HYRGoThic-Medium [ /Gulim /NewGulim /GulimChe /ArialUnicodeMS-KR /MalgunGothicRegular ]
|
||||
/HYGoThic-Medium [ /Dotum /NewGulim /GulimChe /ArialUnicodeMS-KR /MalgunGothicRegular ]
|
||||
/AdobeMyungjoStd-Medium [ /Batang /NewBatang /GulimChe /ArialUnicodeMS-KR /MalgunGothicRegular ]
|
||||
>>
|
||||
def
|
||||
|
||||
% This dictionary contains a list of CID substitutions
|
||||
% Many ttc's have an older ttf version - be sure to put the ttf entries later.
|
||||
/cidsubs
|
||||
<<
|
||||
% Simplified Chinese
|
||||
/SimHei
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (simhei.ttf)
|
||||
/SubfontID 0
|
||||
/CSI [(GB1) 2]
|
||||
>>
|
||||
|
||||
/SimSun
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (simsun.ttc)
|
||||
/SubfontID 0
|
||||
/CSI [(GB1) 2]
|
||||
>>
|
||||
|
||||
/NSimSun
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (simsun.ttc)
|
||||
/SubfontID 1
|
||||
/CSI [(GB1) 2]
|
||||
>>
|
||||
|
||||
/SimSun-oldttf
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (simsun.ttf)
|
||||
/SubfontID 0
|
||||
/CSI [(GB1) 2]
|
||||
>>
|
||||
|
||||
/KaiTi
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (simkai.ttf)
|
||||
/SubfontID 0
|
||||
/CSI [(GB1) 2]
|
||||
>>
|
||||
|
||||
/LiSu
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (simli.ttf)
|
||||
/SubfontID 0
|
||||
/CSI [(GB1) 2]
|
||||
>>
|
||||
|
||||
/SimSun-18030
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (simsun18030.ttc)
|
||||
/SubfontID 0
|
||||
/CSI [(GB1) 2]
|
||||
>>
|
||||
|
||||
/NSimSun-18030
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (simsun18030.ttc)
|
||||
/SubfontID 1
|
||||
/CSI [(GB1) 2]
|
||||
>>
|
||||
|
||||
/YouYuan
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (simyou.ttf)
|
||||
/SubfontID 0
|
||||
/CSI [(GB1) 2]
|
||||
>>
|
||||
|
||||
/FangSong
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (simfang.ttf)
|
||||
/SubfontID 0
|
||||
/CSI [(GB1) 2]
|
||||
>>
|
||||
|
||||
/MicrosoftYaHei
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (msyh.ttf)
|
||||
/SubfontID 0
|
||||
/CSI [(GB1) 2]
|
||||
>>
|
||||
|
||||
/MicrosoftYaHeiBold
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (msyhbd.ttf)
|
||||
/SubfontID 0
|
||||
/CSI [(GB1) 2]
|
||||
>>
|
||||
|
||||
/MS-Song
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (mssong.ttf)
|
||||
/SubfontID 0
|
||||
/CSI [(GB1) 2]
|
||||
>>
|
||||
|
||||
/MS-Hei
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (mshei.ttf)
|
||||
/SubfontID 0
|
||||
/CSI [(GB1) 2]
|
||||
>>
|
||||
|
||||
/ArialUnicodeMS-GB
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (arialuni.ttf)
|
||||
/SubfontID 0
|
||||
/CSI [(GB1) 2]
|
||||
>>
|
||||
|
||||
% Traditional Chinese
|
||||
/MingLiU
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (mingliu.ttc)
|
||||
/SubfontID 0
|
||||
/CSI [(CNS1) 2]
|
||||
>>
|
||||
|
||||
/PMingLiU
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (mingliu.ttc)
|
||||
/SubfontID 1
|
||||
/CSI [(CNS1) 2]
|
||||
>>
|
||||
|
||||
% It probably should be ttf (ttc a typo), but we'll keep this entry just in case.
|
||||
/Arial-Unicode-MS
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (arialuni.ttc)
|
||||
/SubfontID 0
|
||||
/CSI [(CNS1) 2]
|
||||
>>
|
||||
|
||||
/MicrosoftJhengHeiRegular
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (msjh.ttf)
|
||||
/SubfontID 0
|
||||
/CSI [(CNS1) 2]
|
||||
>>
|
||||
|
||||
/MicrosoftJhengHeiBold
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (msjhbd.ttf)
|
||||
/SubfontID 0
|
||||
/CSI [(CNS1) 2]
|
||||
>>
|
||||
|
||||
/MingLiU-oldttf
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (mingliu.ttf)
|
||||
/SubfontID 0
|
||||
/CSI [(CNS1) 2]
|
||||
>>
|
||||
|
||||
/DFKaiShu-SB-Estd-BF
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (kaiu.ttf)
|
||||
/SubfontID 0
|
||||
/CSI [(CNS1) 2]
|
||||
>>
|
||||
|
||||
/ArialUnicodeMS-CNS
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (arialuni.ttf)
|
||||
/SubfontID 0
|
||||
/CSI [(CNS1) 2]
|
||||
>>
|
||||
|
||||
% Japanese
|
||||
/MS-Gothic
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (msgothic.ttc)
|
||||
/SubfontID 0
|
||||
/CSI [(Japan1) 3]
|
||||
>>
|
||||
|
||||
/MS-PGothic
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (msgothic.ttc)
|
||||
/SubfontID 1
|
||||
/CSI [(Japan1) 3]
|
||||
>>
|
||||
|
||||
/MS-UI-Gothic
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (msgothic.ttc)
|
||||
/SubfontID 2
|
||||
/CSI [(Japan1) 3]
|
||||
>>
|
||||
|
||||
/MS-Mincho
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (msmincho.ttc)
|
||||
/SubfontID 0
|
||||
/CSI [(Japan1) 3]
|
||||
>>
|
||||
|
||||
/MS-PMincho
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (msmincho.ttc)
|
||||
/SubfontID 1
|
||||
/CSI [(Japan1) 3]
|
||||
>>
|
||||
|
||||
% An XP update ships the Vista (JIS2004) version of msgothic.ttc/msmincho.ttc renamed
|
||||
/MS-Gothic04
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (msgoth04.ttc)
|
||||
/SubfontID 0
|
||||
/CSI [(Japan1) 3]
|
||||
>>
|
||||
|
||||
/MS-PGothic04
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (msgoth04.ttc)
|
||||
/SubfontID 1
|
||||
/CSI [(Japan1) 3]
|
||||
>>
|
||||
|
||||
/MS-UI-Gothic04
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (msgoth04.ttc)
|
||||
/SubfontID 2
|
||||
/CSI [(Japan1) 3]
|
||||
>>
|
||||
|
||||
/MS-Mincho04
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (msmin04.ttc)
|
||||
/SubfontID 0
|
||||
/CSI [(Japan1) 3]
|
||||
>>
|
||||
|
||||
/MS-PMincho04
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (msmin04.ttc)
|
||||
/SubfontID 1
|
||||
/CSI [(Japan1) 3]
|
||||
>>
|
||||
|
||||
/MS-Mincho-oldttf
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (msmincho.ttf)
|
||||
/SubfontID 0
|
||||
/CSI [(Japan1) 3]
|
||||
>>
|
||||
|
||||
/MS-Gothic-oldttf
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (msgothic.ttf)
|
||||
/SubfontID 0
|
||||
/CSI [(Japan1) 3]
|
||||
>>
|
||||
|
||||
% Newer meiryo.ttc and meiryob.ttc have subfont 2,3. Leave those out for the time being
|
||||
/Meiryo
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (meiryo.ttc)
|
||||
/SubfontID 0
|
||||
/CSI [(Japan1) 3]
|
||||
>>
|
||||
|
||||
/Meiryo-Italic
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (meiryo.ttc)
|
||||
/SubfontID 1
|
||||
/CSI [(Japan1) 3]
|
||||
>>
|
||||
|
||||
/Meiryo-Bold
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (meiryob.ttc)
|
||||
/SubfontID 0
|
||||
/CSI [(Japan1) 3]
|
||||
>>
|
||||
|
||||
/Meiryo-BoldItalic
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (meiryob.ttc)
|
||||
/SubfontID 1
|
||||
/CSI [(Japan1) 3]
|
||||
>>
|
||||
|
||||
/ArialUnicodeMS-JP
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (arialuni.ttf)
|
||||
/SubfontID 0
|
||||
/CSI [(Japan1) 3]
|
||||
>>
|
||||
|
||||
% Korean
|
||||
/Batang
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (batang.ttc)
|
||||
/SubfontID 0
|
||||
/CSI [(Korea1) 3]
|
||||
>>
|
||||
|
||||
/BatangChe
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (batang.ttc)
|
||||
/SubfontID 1
|
||||
/CSI [(Korea1) 3]
|
||||
>>
|
||||
|
||||
/Gungsuh
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (batang.ttc)
|
||||
/SubfontID 2
|
||||
/CSI [(Korea1) 3]
|
||||
>>
|
||||
|
||||
/GungsuhChe
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (batang.ttc)
|
||||
/SubfontID 3
|
||||
/CSI [(Korea1) 3]
|
||||
>>
|
||||
|
||||
/Gulim
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (gulim.ttc)
|
||||
/SubfontID 0
|
||||
/CSI [(Korea1) 3]
|
||||
>>
|
||||
|
||||
/GulimChe
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (gulim.ttc)
|
||||
/SubfontID 1
|
||||
/CSI [(Korea1) 3]
|
||||
>>
|
||||
|
||||
/Dotum
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (gulim.ttc)
|
||||
/SubfontID 2
|
||||
/CSI [(Korea1) 3]
|
||||
>>
|
||||
|
||||
/DotumChe
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (gulim.ttc)
|
||||
/SubfontID 3
|
||||
/CSI [(Korea1) 3]
|
||||
>>
|
||||
|
||||
/MalgunGothicRegular
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (malgun.ttf)
|
||||
/SubfontID 0
|
||||
/CSI [(Korea1) 3]
|
||||
>>
|
||||
|
||||
/MalgunGothicBold
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (malgunbd.ttf)
|
||||
/SubfontID 0
|
||||
/CSI [(Korea1) 3]
|
||||
>>
|
||||
|
||||
/NewBatang
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (nbatang.ttf)
|
||||
/SubfontID 0
|
||||
/CSI [(Korea1) 3]
|
||||
>>
|
||||
|
||||
/NewGulim
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (ngulim.ttf)
|
||||
/SubfontID 0
|
||||
/CSI [(Korea1) 3]
|
||||
>>
|
||||
|
||||
/GulimChe-oldttf
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (gulimche.ttf)
|
||||
/SubfontID 0
|
||||
/CSI [(Korea1) 3]
|
||||
>>
|
||||
|
||||
/ArialUnicodeMS-KR
|
||||
<<
|
||||
/FileType /TrueType
|
||||
/Path (arialuni.ttf)
|
||||
/SubfontID 0
|
||||
/CSI [(Korea1) 3]
|
||||
>>
|
||||
>>
|
||||
def
|
||||
|
||||
% A dictionary for storing the names and paths of found fonts
|
||||
/foundfonts 50 dict def
|
||||
|
||||
% Get the basename of a path
|
||||
% For example, (c:/windows/fonts/msmincho.ps) --> (msmincho.ps)
|
||||
/basename { % path -- subpath
|
||||
{ dirsep search
|
||||
{pop pop}
|
||||
{exit}
|
||||
ifelse
|
||||
} loop
|
||||
} def
|
||||
|
||||
% Convert string (font file name) to lowercase, take care not to touch
|
||||
% non-upper case letters. There are a few similiar routines elsewhere
|
||||
% for reference:
|
||||
% /.ToLower in lib/pdf2dsc.ps
|
||||
% /toupper in lib/printafm.ps
|
||||
% /.lowerstring in Resource/Init/gs_fonts.ps
|
||||
/lowercase {
|
||||
dup length 1 sub -1 0 {
|
||||
1 index exch 2 copy
|
||||
get
|
||||
dup dup 65 ge exch 90 le and {
|
||||
2#00100000 or
|
||||
} if
|
||||
put
|
||||
} for
|
||||
} def
|
||||
|
||||
% Check if a font basename matches one of the possible cid substitutions.
|
||||
% If it does, add the font and full path to the foundfonts dictionary
|
||||
/checkfont {
|
||||
dup basename
|
||||
lowercase
|
||||
cidsubs
|
||||
{
|
||||
/Path get
|
||||
2 index eq % Match case only
|
||||
{
|
||||
foundfonts exch
|
||||
3 index dup length string copy put
|
||||
}
|
||||
{
|
||||
pop
|
||||
}
|
||||
ifelse
|
||||
}
|
||||
forall
|
||||
pop pop
|
||||
} def
|
||||
|
||||
% Add all matching fonts to foundfonts dictionary
|
||||
/findfonts { % path --
|
||||
dup length 2 add string dup 3 1 roll copy pop
|
||||
dup dup length 2 sub dirsep 0 get put
|
||||
dup dup length 1 sub (*) 0 get put
|
||||
/checkfont load 256 string filenameforall
|
||||
} def
|
||||
|
||||
% Write out a cid substition, using the full font path
|
||||
% name is the font name, e.g. /MS-Mincho
|
||||
% path is the full path to the font file, e.g. (c:\windows\fonts\msmincho.ttc)
|
||||
% subs is the dictionary for CID font substition, from cidsubs
|
||||
/emitsubs { % name path subs --
|
||||
3 -1 roll cidfmap exch write==only % name
|
||||
cidfmap ( << ) writestring
|
||||
% path subs
|
||||
{
|
||||
1 index /Path eq {pop 1 index} if % use full path, not basename
|
||||
exch cidfmap exch write==only cidfmap ( ) writestring
|
||||
cidfmap exch write==only cidfmap ( ) writestring
|
||||
} forall
|
||||
cidfmap (>> ;\n) writestring
|
||||
pop
|
||||
} def
|
||||
|
||||
% Write out all known cid substitutions.
|
||||
/writesubs { % ---
|
||||
cidfmap (% Substitutions\n) writestring
|
||||
foundfonts
|
||||
{
|
||||
1 index cidsubs exch known
|
||||
{
|
||||
1 index cidsubs exch get % name path subs
|
||||
emitsubs
|
||||
}
|
||||
{
|
||||
pop pop
|
||||
}
|
||||
ifelse
|
||||
}
|
||||
forall
|
||||
} def
|
||||
|
||||
% Write out aliases for which the cid substituted font exists.
|
||||
/writealiases { % --
|
||||
cidfmap (\n% Aliases\n) writestring
|
||||
fontaliases
|
||||
{
|
||||
% name aliasarray
|
||||
{
|
||||
% name alias
|
||||
foundfonts 1 index known
|
||||
{
|
||||
1 index cidfmap exch write==only cidfmap ( ) writestring
|
||||
cidfmap exch write==only cidfmap ( ;\n) writestring
|
||||
exit % after first match
|
||||
}
|
||||
{
|
||||
pop % didn't find this name
|
||||
}
|
||||
ifelse
|
||||
} forall
|
||||
% name
|
||||
pop
|
||||
}
|
||||
forall
|
||||
} def
|
||||
|
||||
% Write out a new cidfmap file to stdout
|
||||
/writecidfmap { % path --
|
||||
cidfmap (%!\n% cidfmap generated automatically by mkcidfm.ps from fonts found in\n) writestring
|
||||
cidfmap (% ) writestring
|
||||
dup cidfmap exch writestring cidfmap (\n\n) writestring
|
||||
findfonts
|
||||
writesubs
|
||||
writealiases
|
||||
} def
|
||||
|
||||
FONTDIR writecidfmap
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%
|
||||
% For what fonts ship with which microsoft product, see:
|
||||
% http://www.microsoft.com/typography/Fonts/product.aspx
|
||||
%
|
||||
% A reasonably clean Vista box comes with:
|
||||
% ARIALUNI.TTF meiryob.ttc msjh.ttf simhei.ttf
|
||||
% batang.ttc meiryo.ttc msmincho.ttc simkai.ttf
|
||||
% gulim.ttc mingliub.ttc MSMINCHO.TTF simsunb.ttf
|
||||
% kaiu.ttf mingliu.ttc msyhbd.ttf simsun.ttc
|
||||
% malgunbd.ttf msgothic.ttc msyh.ttf
|
||||
% malgun.ttf msjhbd.ttf simfang.ttf
|
||||
%
|
||||
% Here is a non-exhaustive list of CJK fonts found on various MS systems for reference:
|
||||
% File Size Version Glyphs Charmaps Postscript Name Codepage
|
||||
% ======================================================================================================================
|
||||
% arialuni.ttf 24172892 0.86 51180 (1,0)(3,1) ArialUnicodeMS
|
||||
% arialuni.ttf 23275812 1.01 50377 (3,1) ArialUnicodeMS 932,936,949,950
|
||||
% batang.ttc 16258580 2.21 39680 (3,1) Batang/BatangChe/Gungsuh/GungsuhChe
|
||||
% batang.ttc 16265128 2.21 39680 (3,1) Batang/BatangChe/Gungsuh/GungsuhChe
|
||||
% batang.ttc 16264732 5.00 39680 (3,1) Batang/BatangChe/Gungsuh/GungsuhChe 949
|
||||
% gulimche.ttf 5512432 1.00 20792 (3,1) GulimChe
|
||||
% gulim.ttc 13518660 2.21 40194 (3,1) Gulim/GulimChe/Dotum/DotumChe
|
||||
% gulim.ttc 13525204 2.21 40194 (3,1) Gulim/GulimChe/Dotum/DotumChe
|
||||
% gulim.ttc 13524720 5.00 40194 (3,1) Gulim/GulimChe/Dotum/DotumChe 949
|
||||
% kaiu.ttf 4282984 2.00 18193 (1,0)(3,1) DFKaiShu-SB-Estd-BF
|
||||
% kaiu.ttf 4279576 2.10 18193 (1,0)(3,1) DFKaiShu-SB-Estd-BF
|
||||
% kaiu.ttf 5172084 3.00 22134 (1,0)(3,1) DFKaiShu-SB-Estd-BF
|
||||
% kaiu.ttf 5178844 5.00 22134 (1,0)(3,1) DFKaiShu-SB-Estd-BF 950
|
||||
% malgun.ttf 4337480 0.85 12747 (0,3)(3,1) MalgunGothicRegular
|
||||
% malgun.ttf 4337080 1.00 12747 (0,3)(3,1) MalgunGothicRegular
|
||||
% malgun.ttf 4337104 5.00 12747 (0,3)(3,1) MalgunGothicRegular
|
||||
% malgun.ttf 4337296 6.11 12747 (0,3)(3,1) MalgunGothicRegular 949
|
||||
% malgunbd.ttf 4514980 0.85 12740 (0,3)(3,1) MalgunGothicBold
|
||||
% malgunbd.ttf 4513504 1.00 12740 (0,3)(3,1) MalgunGothicBold
|
||||
% malgunbd.ttf 4513520 5.00 12740 (0,3)(3,1) MalgunGothicBold
|
||||
% malgunbd.ttf 4515044 6.00 12740 (0,3)(3,1) MalgunGothicBold
|
||||
% meiryo.ttc 7682568 0.97 20682 (0,3)(3,1)(3,10) Meiryo/Meiryo-Italic 932
|
||||
% meiryo.ttc 7815292 5.00 20684 (0,3)(3,1)(3,10) Meiryo/Meiryo-Italic
|
||||
% meiryo.ttc 9533888 6.02 23942 (0,3)(3,1)(3,10) Meiryo/Meiryo-Italic/MeiryoUI/MeiryoUI-Italic
|
||||
% meiryob.ttc 7924644 0.97 20682 (0,3)(3,1)(3,10) Meiryo-Bold/Meiryo-BoldItalic
|
||||
% meiryob.ttc 8054096 5.00 20684 (0,3)(3,1)(3,10) Meiryo-Bold/Meiryo-BoldItalic
|
||||
% meiryob.ttc 9749256 6.02 23942 (0,3)(3,1)(3,10) Meiryo-Bold/Meiryo-BoldItalic/MeiryoUI-Bold/MeiryoUI-BoldItalic
|
||||
% mingliu.ttf 6272080 2.00 18362 (1,0)(3,1) MingLiU
|
||||
% mingliu.ttc 8823308 3.21 22753 (1,0)(3,1) MingLiU/PMingLiU
|
||||
% mingliu.ttc 8829856 3.21 22753 (1,0)(3,1) MingLiU/PMingLiU
|
||||
% mingliu.ttc 27496184 6.02 33987 (3,1) MingLiU/PMingLiU/Ming-Lt-HKSCS-UNI-H
|
||||
% mingliu.ttc 32217124 7.00 34046 (3,1) MingLiU/PMingLiU/Ming-Lt-HKSCS-UNI-H 950
|
||||
% mingliub.ttc 33791880 5.00 44857 (3,1)(3,10) MingLiU-ExtB/PMingLiU-ExtB/Ming-Lt-HKSCS-ExtB
|
||||
% mingliub.ttc 33805700 7.00 44875 (3,1)(3,10) MingLiU-ExtB/PMingLiU-ExtB/Ming-Lt-HKSCS-ExtB
|
||||
% msgothic.ttf 4170144 2.00 13104 (1,0)(3,1) MS-Gothic
|
||||
% msgothic.ttc 8272028 2.30 20458 (1,0)(3,1) MS-Gothic/MS-PGothic/MS-UIGothic
|
||||
% msgothic.ttc 8278584 2.30 20458 (1,0)(3,1) MS-Gothic/MS-PGothic/MS-UIGothic
|
||||
% msgothic.ttc 9165480 5.00 22213 (3,1)(3,10) MS-Gothic/MS-PGothic/MS-UIGothic
|
||||
% msgothic.ttc 9176636 5.01 22213 (3,1)(3,10) MS-Gothic/MS-PGothic/MS-UIGothic 932
|
||||
% mshei.ttf 1902464 1.00 26272 (1,0)(3,1) MS Hei
|
||||
% mshei.ttf 1902556 1.00 26272 (1,0)(3,1) MS Hei
|
||||
% msjh.ttf 14698792 0.71 28969 (0,3)(3,1) MicrosoftJhengHeiRegular 950
|
||||
% msjh.ttf 14713712 0.75 28969 (0,3)(3,1) MicrosoftJhengHeiRegular
|
||||
% msjh.ttf 14713760 5.00 28969 (0,3)(3,1) MicrosoftJhengHeiRegular
|
||||
% msjh.ttf 21663376 6.02 29220 (0,3)(3,1) MicrosoftJhengHeiRegular
|
||||
% msjhbd.ttf 14498048 0.71 28961 (0,3)(3.1) MicrosoftJhengHeiBold
|
||||
% msjhbd.ttf 14509708 0.75 28961 (0,3)(3.1) MicrosoftJhengHeiBold
|
||||
% msjhbd.ttf 14509756 5.00 28961 (0,3)(3.1) MicrosoftJhengHeiBold
|
||||
% msmincho.ttf 5151192 2.00 13104 (1,0)(3,1) MS-Mincho
|
||||
% msmincho.ttc 9136456 2.30 17807 (1,0)(3,1) MS-Mincho/MS-PMincho
|
||||
% msmincho.ttc 9135960 2.31 17807 (1,0)(3,1) MS-Mincho/MS-PMincho
|
||||
% msmincho.ttc 9142516 2.31 17807 (1,0)(3,1) MS-Mincho/MS-PMincho
|
||||
% msmincho.ttc 10056872 5.00 19321 (3,1)(3,10) MS-Mincho/MS-PMincho
|
||||
% msmincho.ttc 10057108 5.01 19321 (3,1)(3,10) MS-Mincho/MS-PMincho 932
|
||||
% mssong.ttf 2569040 1.00 26304 (1,0)(3,1) MS Song
|
||||
% mssong.ttf 2569116 1.00 26304 (1,0)(3,1) MS Song
|
||||
% msyh.ttf 12263452 6.01 22562 (0,3)(3,1)(3,10) MSYH
|
||||
% msyh.ttf 15067744 0.71 29207 (0,3)(3,1)(3,10) MicrosoftYaHei
|
||||
% msyh.ttf 15043584 0.75 29126 (0,3)(3,1)(3,10) MicrosoftYaHei
|
||||
% msyh.ttf 15044440 5.00 29126 (0,3)(3,1)(3,10) MicrosoftYaHei
|
||||
% msyh.ttf 21767952 6.02 29354 (0,3)(3,1) MicrosoftYaHei 936
|
||||
% msyhbd.ttf 14707012 0.71 29240 (0,3)(3,1)(3,10) MicrosoftYaHei
|
||||
% msyhbd.ttf 14685876 5.00 29126 (0,3)(3,1)(3,10) MicrosoftYaHei
|
||||
% nbatang.ttf 32472240 3.00 49636 (3,1) New Batang
|
||||
% ngulim.ttf 8862844 2.00 23181 (3,1) New Gulim
|
||||
% ngulim.ttf 25719724 3.10 49284 (3,1) New Gulim
|
||||
% ogulim.ttf 830340 1.00 2921 (3,1) Gulim Old Hangul Jamo
|
||||
% palmm.ttf 13816928 001.003 27560 (3,1) PMmy
|
||||
% simfang.ttf 3996872 2.00 7580 (1,0)(3,1) FangSong_GB2312
|
||||
% simfang.ttf 10576012 5.01 28562 (3,1) FangSong 936
|
||||
% simhei.ttf 10044356 3.02 22021 (1,0)(3,1) SimHei
|
||||
% simhei.ttf 10050868 3.02 22021 (1,0)(3,1) SimHei
|
||||
% simhei.ttf 9751960 5.01 28562 (3,1) SimHei 936
|
||||
% simkai.ttf 4135804 2.00 7580 (1,0)(3,1) KaiTi_GB2312
|
||||
% simkai.ttf 11785184 5.01 28562 (3,1) KaiTi 936
|
||||
% simli.ttf 9317908 3.00 21992 (1,0)(3,1) LiSu
|
||||
% simsun.ttc 10500792 3.03 22141 (1,0)(3,1) SimSun/NSimSun
|
||||
% simsun.ttc 10507340 3.03 22141 (1,0)(3,1) SimSun/NSimSun
|
||||
% simsun.ttc 13747080 5.00 28762 (1,0)(3,1) SimSun/NSimSun
|
||||
% simsun.ttc 15323200 5.03 28762 (1,0)(3,1) SimSun/NSimSun 936
|
||||
% simsun18030.ttc 12642204 2.06 30533 (1,0)(3,1) SimSun-18030/NSimSun-18030
|
||||
% simsunb.ttf 15406216 0.90 42809 (1,0)(3,1)(3,10) SimSun-ExtB
|
||||
% simsunb.ttf 15406288 5.00 42809 (1,0)(3,1)(3,10) SimSun-ExtB
|
||||
% simyou.ttf 6794984 3.00 21991 (1,0)(3,1) YouYuan
|
||||
% simyou.ttf 6788204 3.00 21991 (1,0)(3,1) YouYuan
|
||||
258
dist/conf/ghostscript/lib/pdf2dsc.ps
vendored
258
dist/conf/ghostscript/lib/pdf2dsc.ps
vendored
@@ -1,258 +0,0 @@
|
||||
% Copyright (C) 2001-2025 Artifex Software, Inc.
|
||||
% 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.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% pdf2dsc.ps
|
||||
% read pdf file and produce DSC "index" file.
|
||||
%
|
||||
% Input file is named PDFname
|
||||
% Output file is named DSCname
|
||||
%
|
||||
% Run using:
|
||||
% gs -dNODISPLAY -sPDFname=pdffilename -sDSCname=tempfilename pdf2dsc.ps
|
||||
% Then display the PDF file with
|
||||
% gs tempfilename
|
||||
%
|
||||
% This program does not form part of the Ghostscript product, it is a utility which users may find
|
||||
% useful.
|
||||
%
|
||||
% The program uses code based on the original written-in-PostScript PDF interpreter and depends
|
||||
% heavily on that interpreter for its functioning. Since version 10.x that old PDF interpreter
|
||||
% has been removed and replaced with a new written-in-C PDF interpreter. Some effort was made to
|
||||
% ensure that old functionality was preserved, however it is not the same code.
|
||||
%
|
||||
% Users may find that some portion of the original functionality no longer works as expected, and
|
||||
% there is no guarantee that future changes to the interpreter will not cause this program to
|
||||
% cease working altogether. The code here is not supported by the Ghostscript maintainers.
|
||||
%
|
||||
% Modified by Jason McCarty, bug 688071
|
||||
% Add PageLabels support.
|
||||
% Modified by Geoff Keating <geoffk@ozemail.com.au> 21/12/98:
|
||||
% Add DocumentMedia, PageMedia comments
|
||||
% Use inherited BoundingBox and Orientation
|
||||
% Reformat, add new macro 'puts', generally clean up
|
||||
% Modified by Johannes Plass <plass@dipmza.physik.uni-mainz.de> 1996-11-05:
|
||||
% Adds BoundingBox and Orientation if available.
|
||||
% Modified by rjl/lpd 9/19/96
|
||||
% Updates for compatibility with modified pdf_*.ps code for handling
|
||||
% page ranges (i.e., partial files) better.
|
||||
% Modified by Geoff Keating <Geoff.Keating@anu.edu.au> 7/3/96:
|
||||
% include Title and CreationDate DSC comments (these are displayed by
|
||||
% Ghostview);
|
||||
% reduce the size of typical output files by a factor of about 3.
|
||||
% Modified by L. Peter Deutsch 3/18/96:
|
||||
% Removes unnecessary and error-prone code duplicated from pdf_main.ps
|
||||
% Modified by L. Peter Deutsch for GS 3.33
|
||||
% Originally by Russell Lang 1995-04-26
|
||||
|
||||
/PDFfile PDFname (r) file def
|
||||
/DSCfile DSCname (w) file def
|
||||
systemdict /.setsafe known { .setsafe } if
|
||||
|
||||
/puts { DSCfile exch writestring } bind def
|
||||
/DSCstring 255 string def
|
||||
/MediaTypes 10 dict def
|
||||
|
||||
PDFfile runpdfbegin
|
||||
/FirstPage where { pop } { /FirstPage 1 def } ifelse
|
||||
/LastPage where { pop } { /LastPage pdfpagecount def } ifelse
|
||||
|
||||
% scan through for media sizes, keep them in the dictionary
|
||||
FirstPage 1 LastPage {
|
||||
pdfgetpage /MediaBox pget pop % MediaBox is a required attribute
|
||||
aload pop
|
||||
3 -1 roll sub 3 1 roll exch sub exch
|
||||
2 array astore
|
||||
aload 3 1 roll 10 string cvs exch 10 string cvs
|
||||
(x) 3 -1 roll concatstrings concatstrings cvn
|
||||
MediaTypes 3 1 roll exch put
|
||||
} for
|
||||
|
||||
% write header and prolog
|
||||
(%!PS-Adobe-3.0\n) puts
|
||||
Trailer /Info knownoget
|
||||
{
|
||||
dup /Title knownoget
|
||||
{
|
||||
(%%Title: ) puts
|
||||
DSCfile exch write==
|
||||
}
|
||||
if
|
||||
/CreationDate knownoget
|
||||
{
|
||||
(%%CreationDate: ) puts
|
||||
DSCfile exch write==
|
||||
}
|
||||
if
|
||||
}
|
||||
if
|
||||
% This is really supposed to be sorted by frequency of usage...
|
||||
(%%DocumentMedia: )
|
||||
MediaTypes {
|
||||
exch pop
|
||||
1 index puts
|
||||
(y) puts dup 1 get DSCstring cvs puts
|
||||
(x) puts dup 0 get DSCstring cvs puts
|
||||
( ) puts dup 0 get DSCstring cvs puts
|
||||
( ) puts 1 get DSCstring cvs puts
|
||||
( 70 white ()\n) puts
|
||||
pop (%%+ )
|
||||
} forall
|
||||
pop
|
||||
|
||||
(%%Pages: ) puts
|
||||
LastPage FirstPage sub 1 add DSCstring cvs puts
|
||||
(\n%%EndComments\n) puts
|
||||
(%%BeginProlog\n) puts
|
||||
(/Page null def\n/Page# 0 def\n/PDFSave null def\n) puts
|
||||
(/DSCPageCount 0 def\n) puts
|
||||
(/DoPDFPage {dup /Page# exch store dup dopdfpages } def\n) puts
|
||||
(%%EndProlog\n) puts
|
||||
(%%BeginSetup\n) puts
|
||||
DSCfile PDFname write==only
|
||||
( \(r\) file { DELAYSAFER { .setsafe } if } stopped pop\n) puts
|
||||
( runpdfbegin\n) puts
|
||||
( process_trailer_attrs\n) puts
|
||||
(%%EndSetup\n) puts
|
||||
|
||||
/.hasPageLabels false def % see "Page Labels" in the PDF Reference
|
||||
Trailer /Root knownoget {
|
||||
/PageLabels knownoget {
|
||||
/PageLabels exch def
|
||||
/.pageCounter 1 def
|
||||
/.pageCounterType /D def
|
||||
/.pagePrefix () def
|
||||
|
||||
% (TEXT) .ToLower (text) -- convert text to lowercase -- only letters!
|
||||
/.ToLower {
|
||||
dup length 1 sub -1 0 {
|
||||
1 index exch 2 copy get 2#00100000 or put
|
||||
} for
|
||||
} def
|
||||
|
||||
% int .CvAlpha (int in alphabetic base 26) -- convert a positive
|
||||
% integer to base 26 in capital letters, with 1=A; i.e. A..Z, AA..AZ, ...
|
||||
/.CvAlpha { % using cvrs seems futile since this isn't zero-based ...
|
||||
[ exch % construct an array of ASCII values, in reverse
|
||||
{ % the remainder stays on the top of stack
|
||||
dup 0 eq { pop exit } if % quit if the value is zero
|
||||
dup 26 mod dup 0 eq { 26 add } if % so that the division is correct
|
||||
dup 64 add 3 1 roll sub 26 idiv % save the ASCII value and iterate
|
||||
} loop ]
|
||||
dup length dup string 3 1 roll
|
||||
dup -1 1 { % put the letters in a string
|
||||
4 copy sub exch 4 -1 roll 1 sub get put
|
||||
} for pop pop
|
||||
} def
|
||||
|
||||
% int .CvRoman (int in capital Roman numerals)
|
||||
% convert a positive integer to capital Roman numerals
|
||||
% return a decimal string if >= 4000
|
||||
/.CvRoman {
|
||||
dup DSCstring cvs % start with the decimal representation
|
||||
exch 4000 lt { % convert only if Roman numerals can represent this
|
||||
dup length
|
||||
[ [ () (I) (II) (III) (IV) (V) (VI) (VII) (VIII) (IX) ]
|
||||
[ () (X) (XX) (XXX) (XL) (L) (LX) (LXX) (LXXX) (XC) ]
|
||||
[ () (C) (CC) (CCC) (CD) (D) (DC) (DCC) (DCCC) (CM) ]
|
||||
[ () (M) (MM) (MMM) ] ] % Roman equivalents
|
||||
() % append the Roman equivalent of each decimal digit to this string
|
||||
2 index -1 1 {
|
||||
2 index 1 index 1 sub get
|
||||
5 index 5 index 4 -1 roll sub get
|
||||
48 sub get concatstrings
|
||||
} for
|
||||
4 1 roll pop pop pop
|
||||
} if
|
||||
} def
|
||||
|
||||
/PageToString <<
|
||||
/D { DSCstring cvs }
|
||||
/R { .CvRoman }
|
||||
/r { .CvRoman .ToLower }
|
||||
/A { .CvAlpha }
|
||||
/a { .CvAlpha .ToLower }
|
||||
>> def
|
||||
/.hasPageLabels true def
|
||||
} if
|
||||
} if
|
||||
|
||||
% process each page
|
||||
FirstPage 1 LastPage {
|
||||
(%%Page: ) puts
|
||||
|
||||
.hasPageLabels {
|
||||
dup 1 sub PageLabels exch numoget dup null ne {
|
||||
% page labels changed at this page, reset the values
|
||||
dup /S known { dup /S get } { null } ifelse
|
||||
/.pageCounterType exch def
|
||||
|
||||
dup /P known { dup /P get } { () } ifelse
|
||||
/.pagePrefix exch def
|
||||
|
||||
dup /St known { /St get } { pop 1 } ifelse
|
||||
/.pageCounter exch def
|
||||
} { pop } ifelse
|
||||
|
||||
% output the page label
|
||||
(\() .pagePrefix
|
||||
.pageCounterType //null ne dup {
|
||||
PageToString .pageCounterType known and
|
||||
} if { % format the page number
|
||||
.pageCounter dup 0 gt { % don't try to format nonpositive numbers
|
||||
PageToString .pageCounterType get exec
|
||||
} {
|
||||
DSCstring cvs
|
||||
} ifelse
|
||||
} { () } ifelse
|
||||
(\)) concatstrings concatstrings concatstrings puts
|
||||
|
||||
/.pageCounter .pageCounter 1 add def
|
||||
} {
|
||||
dup DSCstring cvs puts
|
||||
} ifelse
|
||||
( ) puts
|
||||
dup DSCstring cvs puts
|
||||
(\n) puts
|
||||
|
||||
dup pdfgetpage
|
||||
dup /MediaBox pget pop
|
||||
(%%PageMedia: y) puts
|
||||
aload pop 3 -1 roll sub DSCstring cvs puts
|
||||
(x) puts exch sub DSCstring cvs puts
|
||||
(\n) puts
|
||||
dup /CropBox pget {
|
||||
(%%PageBoundingBox: ) puts
|
||||
{DSCfile exch write=only ( ) puts} forall
|
||||
(\n) puts
|
||||
} if
|
||||
/Rotate pget {
|
||||
(%%PageOrientation: ) puts
|
||||
90 div cvi 4 mod dup 0 lt {4 add} if
|
||||
[(Portrait) (Landscape) (UpsideDown) (Seascape)] exch get puts
|
||||
(\n) puts
|
||||
} if
|
||||
|
||||
DSCfile exch DSCstring cvs writestring
|
||||
( DoPDFPage\n) puts
|
||||
} for
|
||||
runpdfend
|
||||
% write trailer
|
||||
(%%Trailer\n) puts
|
||||
(runpdfend\n) puts
|
||||
(%%EOF\n) puts
|
||||
% close output file and exit
|
||||
DSCfile closefile
|
||||
quit
|
||||
% end of pdf2dsc.ps
|
||||
323
dist/conf/ghostscript/lib/pdf_info.ps
vendored
323
dist/conf/ghostscript/lib/pdf_info.ps
vendored
@@ -1,323 +0,0 @@
|
||||
%!PS
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% 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.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
%
|
||||
% $Id: pdf_info.ps 6300 2005-12-28 19:56:24Z alexcher $
|
||||
|
||||
% Dump some info from a PDF file
|
||||
|
||||
% usage: gs -dNODISPLAY -q -sFile=____.pdf [-dDumpMediaSizes=false] [-dDumpFontsNeeded=false] [-dDumpXML]
|
||||
% [-dDumpFontsUsed [-dShowEmbeddedFonts] ] lib/pdf_info.ps
|
||||
|
||||
128 dict begin
|
||||
|
||||
/QUIET true def % in case they forgot
|
||||
|
||||
/showoptions {
|
||||
( where "options" are:) =
|
||||
( -dDumpMediaSizes=false (default true) MediaBox and CropBox for each page) =
|
||||
( -dDumpFontsNeeded=false (default true)Fonts used, but not embedded) =
|
||||
( -dDumpXML print the XML Metadata from the PDF, if present) =
|
||||
( -dDumpFontsUsed List all fonts used) =
|
||||
( -dShowEmbeddedFonts only meaningful with -dDumpFontsUsed) =
|
||||
(\n If no options are given, the default is -dDumpMediaSizes -dDumpFontsNeeded) =
|
||||
() =
|
||||
flush
|
||||
} bind def
|
||||
|
||||
/DumpMediaSizes where { pop } { /DumpMediaSizes true def } ifelse
|
||||
/DumpFontsNeeded where { pop } { /DumpFontsNeeded true def } ifelse
|
||||
|
||||
[ {.shellarguments} stopped not
|
||||
{
|
||||
{ counttomark 1 eq {
|
||||
dup 0 get (-) 0 get ne {
|
||||
% File specified on the command line using: -- lib/pdf_info.ps infile.pdf
|
||||
/File exch def
|
||||
false % don't show usage
|
||||
} {
|
||||
true % show usage and quit
|
||||
} ifelse
|
||||
} { true } ifelse
|
||||
{
|
||||
(\n*** Usage: gs [options] -- lib/pdf_info.ps infile.pdf ***\n\n) print
|
||||
showoptions
|
||||
quit
|
||||
} if
|
||||
} if
|
||||
} if
|
||||
/File where not {
|
||||
(\n *** Missing input file name \(use -sFile=____.pdf\)\n) =
|
||||
( usage: gs -dNODISPLAY -q -sFile=____.pdf [ options ] lib/pdf_info.ps\n) =
|
||||
showoptions
|
||||
quit
|
||||
} if
|
||||
cleartomark % discard the dict from --where--
|
||||
|
||||
% ---- No more executable code on the top level after this line -----
|
||||
% ---- except 2 lines at the very end -----
|
||||
|
||||
% Write a character to the standard output.
|
||||
/putchar [ % int -> -
|
||||
(%stdout) (w) file
|
||||
/exch cvx /write cvx
|
||||
] cvx bind def
|
||||
|
||||
% Write U+xxxx to the standard output as UTF-8.
|
||||
/put-ucode { % int -> -
|
||||
dup 16#80 ge {
|
||||
dup 16#800 ge {
|
||||
dup 16#10000 ge {
|
||||
dup -18 bitshift 16#f0 or putchar
|
||||
dup -12 bitshift 16#3f and 16#80 or putchar
|
||||
} {
|
||||
dup -12 bitshift 16#e0 or putchar
|
||||
} ifelse
|
||||
dup -6 bitshift 16#3f and 16#80 or putchar
|
||||
} {
|
||||
dup -6 bitshift 16#C0 or putchar
|
||||
} ifelse
|
||||
16#3f and 16#80 or
|
||||
} if
|
||||
putchar
|
||||
} bind def
|
||||
|
||||
% PDFDocEncoding to U+xxxx decoding table.
|
||||
/doc-to-ucode [
|
||||
0 1 23 {} for
|
||||
16#2d8 16#2c7 16#2c6 16#2d9 16#2dd 16#2db 16#2da 16#2dc
|
||||
32 1 127 {} for
|
||||
16#2022 16#2020 16#2021 16#2026 16#2014 16#2013 16#192
|
||||
16#2044 16#2039 16#203a 16#2212 16#2030 16#201e 16#201c
|
||||
16#201d 16#2018 16#2019 16#201a 16#2122 16#fb01 16#fb02
|
||||
16#141 16#152 16#160 16#178 16#17d 16#131 16#142 16#153
|
||||
16#161 16#17e 0 16#20ac
|
||||
161 1 255 {} for
|
||||
] readonly def
|
||||
|
||||
% Convert a doc string from PDFDocEncoding or UTF-16BE to UTF-8
|
||||
% and write it to standard output.
|
||||
/write-doc-string { % (string) -> -
|
||||
1024 string cvs <feff> anchorsearch {
|
||||
pop
|
||||
0 exch % hi16 (str)
|
||||
0 2 2 index length 2 sub {
|
||||
2 copy 2 copy % hi16 (str) i (str) i (str) i
|
||||
get 256 mul 3 1 roll % hi16 (str) i hi*256 (str) i
|
||||
1 add get add % hi16 (str) i 256*hi+lo
|
||||
dup 16#fc00 and dup % hi16 (str) i 256*hi+lo tag tag
|
||||
16#d800 eq { % High surrogate
|
||||
pop
|
||||
16#3ff and
|
||||
10 bitshift
|
||||
16#10000 add % hi16 (str) i hi16'
|
||||
4 1 roll % hi16' hi16 (str) i
|
||||
pop exch pop % hi16' (str)
|
||||
} {
|
||||
16#dc00 eq { % Low surrogate
|
||||
16#3ff and % hi16 (str) i (256*hi+lo)&0x3ff
|
||||
4 -1 roll add % (str) i (256*hi+lo)&0x3ff+hi16
|
||||
put-ucode % (str) i
|
||||
pop 0 exch % 0 (str)
|
||||
} { % BMP plane
|
||||
put-ucode % hi16 (str) i
|
||||
pop % hi16 (str)
|
||||
} ifelse
|
||||
} ifelse
|
||||
} for
|
||||
pop pop % -
|
||||
} {
|
||||
{ //doc-to-ucode exch get put-ucode
|
||||
} forall
|
||||
} ifelse
|
||||
} bind def
|
||||
|
||||
% If running with -dSAFER, .sort may not be present. Define a (slower) PS alternative
|
||||
systemdict /.sort known not {
|
||||
% <array> <lt-proc> .sort <array>
|
||||
/.sort
|
||||
{ 1 index length 1 sub -1 1
|
||||
{ 2 index exch 2 copy get 3 copy % arr proc arr i arr[i] arr i arr[i]
|
||||
0 1 3 index 1 sub
|
||||
{ 3 index 1 index get % arr proc arr i arr[i] arr imax amax j arr[j]
|
||||
2 index 1 index 10 index exec
|
||||
{ % ... amax < arr[j]
|
||||
4 2 roll
|
||||
}
|
||||
if pop pop
|
||||
}
|
||||
for % arr proc arr i arr[i] arr imax amax
|
||||
4 -1 roll exch 4 1 roll put put
|
||||
}
|
||||
for
|
||||
pop
|
||||
} bind def
|
||||
} if
|
||||
|
||||
/knownoget
|
||||
{
|
||||
2 copy known {
|
||||
get
|
||||
true
|
||||
}{
|
||||
pop pop false
|
||||
} ifelse
|
||||
}bind def
|
||||
|
||||
/PDFContext << >> .PDFInit def
|
||||
{File (r) file PDFContext .PDFStream} stopped not
|
||||
{
|
||||
PDFContext .PDFInfo
|
||||
File
|
||||
() = ( ) print print ( has ) print
|
||||
dup /NumPages get dup =print 10 mod 1 eq { ( page.\n) } { ( pages\n) } ifelse = flush
|
||||
|
||||
/DumpXML where {/DumpXML get}{//false}ifelse
|
||||
{
|
||||
(\n*** DumpXML is no longer supported. ***\n\n) print
|
||||
}if
|
||||
|
||||
dup /Title knownoget { (Title: ) print write-doc-string () = flush } if
|
||||
dup /Author knownoget { (Author: ) print write-doc-string () = flush } if
|
||||
dup /Subject knownoget { (Subject: ) print write-doc-string () = flush } if
|
||||
dup /Keywords knownoget { (Keywords: ) print write-doc-string () = flush } if
|
||||
dup /Creator knownoget { (Creator: ) print write-doc-string () = flush } if
|
||||
dup /Producer knownoget { (Producer: ) print write-doc-string () = flush } if
|
||||
dup /CreationDate knownoget { (CreationDate: ) print write-doc-string () = flush } if
|
||||
dup /ModDate knownoget { (ModDate: ) print write-doc-string () = flush } if
|
||||
dup /Trapped knownoget { (Trapped: ) print write-doc-string () = flush } if
|
||||
(\n) print flush
|
||||
|
||||
/EmbeddedFonts 10 dict def
|
||||
/UnEmbeddedFonts 10 dict def
|
||||
/FontNumbers 10 dict def
|
||||
|
||||
/NumPages get 0 1 3 -1 roll 1 sub
|
||||
{
|
||||
dup
|
||||
PDFContext exch .PDFPageInfoExt exch
|
||||
DumpMediaSizes {
|
||||
(Page ) print 1 add =print
|
||||
dup /UserUnit knownoget {( UserUnit: ) print =print} if
|
||||
dup /MediaBox knownoget {( MediaBox: ) print ==only} if
|
||||
dup /CropBox knownoget {( CropBox: ) print ==only} if
|
||||
dup /BleedBox knownoget {( BleedBox: ) print ==only} if
|
||||
dup /TrimBox knownoget {( TrimBox: ) print ==only} if
|
||||
dup /ArtBox knownoget {( ArtBox: ) print ==only} if
|
||||
dup /Rotate knownoget not {0}if ( Rotate = ) print =print
|
||||
dup /Annots knownoget {{( Page contains Annotations) print} if} if
|
||||
dup /UsesTransparency knownoget {{( Page uses transparency features) print} if} if
|
||||
dup /Spots knownoget {
|
||||
(\n Page Spot colors: ) =
|
||||
{( ) print (') print 256 string cvs print (') =} forall
|
||||
} if
|
||||
(\n) print flush
|
||||
(\n) print flush
|
||||
}
|
||||
{
|
||||
pop
|
||||
} ifelse
|
||||
|
||||
/Fonts knownoget
|
||||
{
|
||||
{
|
||||
dup /ObjectNum known
|
||||
{
|
||||
%% Fonts with an ObjectNumber may have been previously referenced on another page
|
||||
dup /ObjectNum get
|
||||
dup FontNumbers exch known
|
||||
{
|
||||
pop
|
||||
%% found the ObjectNumber in the FontNumbers dictionary so we've seen this one.
|
||||
//false
|
||||
}
|
||||
{
|
||||
%% Not seen before, add the number to the array and process this font
|
||||
FontNumbers exch dup put
|
||||
//true
|
||||
}ifelse
|
||||
}{
|
||||
%% Fonts without an ObjectNumber are defined inline and so must be unique
|
||||
//true
|
||||
} ifelse
|
||||
{
|
||||
% First time we've seen the font
|
||||
dup /Descendants known
|
||||
{
|
||||
dup /BaseFont get
|
||||
EmbeddedFonts exch dup put % We class the Type 0 font as 'embedded', but it's really the descendant which is embedded or not.
|
||||
dup /Descendants get
|
||||
1 index /BaseFont get
|
||||
2 index /Embedded get
|
||||
{
|
||||
EmbeddedFonts exch dup put
|
||||
}
|
||||
{
|
||||
UnEmbeddedFonts exch dup put
|
||||
}ifelse
|
||||
pop
|
||||
}
|
||||
{
|
||||
dup /BaseFont get
|
||||
1 index /Embedded get
|
||||
{
|
||||
EmbeddedFonts exch dup put
|
||||
}
|
||||
{
|
||||
UnEmbeddedFonts exch dup put
|
||||
} ifelse
|
||||
}ifelse
|
||||
pop
|
||||
}
|
||||
{
|
||||
pop
|
||||
} ifelse
|
||||
}forall
|
||||
} if
|
||||
} for
|
||||
|
||||
/DumpFontsUsed where {/DumpFontsUsed get}{//false}ifelse
|
||||
{
|
||||
[
|
||||
UnEmbeddedFonts {pop} forall
|
||||
/ShowEmbeddedFonts where {/ShowEmbeddedFonts get}{//false}ifelse
|
||||
{
|
||||
EmbeddedFonts {pop} forall
|
||||
} if
|
||||
]
|
||||
dup length 0 gt {
|
||||
{ 100 string cvs exch 100 string cvs exch lt } .sort
|
||||
(\nFont or CIDFont resources used (plain name and ASCIIHEX string representation):) =
|
||||
{ 128 string cvs dup print ( ) print (<) print 128 string cvs {16 8 string cvrs print} forall (>) print (\n) print} forall
|
||||
} if
|
||||
}
|
||||
{
|
||||
[
|
||||
DumpFontsNeeded
|
||||
{
|
||||
UnEmbeddedFonts {pop} forall
|
||||
} if
|
||||
]
|
||||
dup length 0 gt {
|
||||
{ 100 string cvs exch 100 string cvs exch lt } .sort
|
||||
(\nFonts Needed that are not embedded \(system fonts required\):) =
|
||||
{ ( ) print 128 string cvs dup print ( ) print (<) print {16 8 string cvrs print} forall (>) print (\n) print} forall
|
||||
} if
|
||||
}ifelse
|
||||
} if
|
||||
PDFContext .PDFClose
|
||||
|
||||
end
|
||||
quit
|
||||
535
dist/conf/ghostscript/lib/pf2afm.ps
vendored
535
dist/conf/ghostscript/lib/pf2afm.ps
vendored
@@ -1,535 +0,0 @@
|
||||
%!
|
||||
% This is a PostScript program for making an AFM file from
|
||||
% PFB / PFA and (optionally) PFM files.
|
||||
%
|
||||
% Written in BOP s.c., Gda\'nsk, Poland
|
||||
% e-mail contact: B.Jackowski@GUST.ORG.PL
|
||||
% version 0.5 (18 XII 1997)
|
||||
% version 0.55 (11 III 1998) -- unlimited number of chars in a font
|
||||
% version 1.00 (27 III 1998) -- scanning PFM subdirectory added,
|
||||
% code improved; version sent to LPD
|
||||
% version 1.01 (1 II 2000) -- message changed
|
||||
|
||||
% Usage:
|
||||
% gs [-dNODISPLAY] -- pf2afm.ps disk_font_name
|
||||
%
|
||||
% The result is written to the file disk_font_name.afm, provided such
|
||||
% a file does not exist; otherwise program quits.
|
||||
%
|
||||
% The font can be either *.pfa or *.pfb; if no extension is supplied,
|
||||
% first disk_font_name.pfb is examined, then disk_font_name.pfa.
|
||||
% Moreover, if there is a *.pfm file in the same directory or in the
|
||||
% subdirectory PFM, i.e., disk_font_name.pfm or PFM/disk_font_name.pfm,
|
||||
% kern pairs from it are extracted, as well as additional font
|
||||
% parameters, usually absent from Type 1 fonts.
|
||||
|
||||
% Tribute:
|
||||
% The program is based on James Clark's <jjc@jclark.uucp> printafm.ps
|
||||
% (with alterations by d.love@dl.ac.uk and L. Peter Deutsch) from
|
||||
% Ghostscript 5.10 distribution.
|
||||
|
||||
/onechar 1 string def
|
||||
/edef {exch def} def
|
||||
/WinAnsiEncoding dup /Encoding findresource def
|
||||
|
||||
% charnumber print-charname -
|
||||
% prints the name of the encoded character
|
||||
/print-charname {
|
||||
PFMCharSet 0 eq {
|
||||
WinAnsiEncoding
|
||||
} {
|
||||
PFBencoding
|
||||
} ifelse
|
||||
exch get =string cvs dup
|
||||
(.notdef) eq {
|
||||
/was.notdef true def
|
||||
} if
|
||||
print.to.ofi ( ) print.to.ofi
|
||||
} def
|
||||
|
||||
/printquit {print flush quit} def
|
||||
|
||||
% redirecting GS output to ``ofi'' file
|
||||
/eolch (\r\n) def
|
||||
/=only.to.ofi {ofi exch write=only} def % replaces GS's `=only'
|
||||
/print.to.ofi {ofi exch writestring} def % replaces `print'
|
||||
/=to.ofi { =only.to.ofi eolch print.to.ofi } def % replaces `='
|
||||
|
||||
% read and skip: byte, short, word, double and long
|
||||
/readb-p {currPFMfile read not {(Unexpected EOF\n) printquit} if} def
|
||||
/readw-p {readb-p readb-p 256 mul add} def
|
||||
/reads-p {readw-p dup 32768 ge {65536 sub} if} def
|
||||
/readd-p {readb-p readb-p readb-p readb-p 256 mul add 256 mul add 256 mul add} def
|
||||
/readl-p /readd-p load def % double word is, in fact, long integer in GS
|
||||
/skipb-p {readb-p pop} def
|
||||
/skipw-p {skipb-p skipb-p} def
|
||||
/skips-p /skipw-p load def
|
||||
/skipd-p {skipb-p skipb-p skipb-p skipb-p} def
|
||||
/skipl-p /skipd-p load def
|
||||
/skipa-p { {skipb-p} repeat} def
|
||||
|
||||
% PFMfile readPFMheader -
|
||||
% defines currPFMfile, PFMExtMetricOffset, PFMPairKernTableOffset
|
||||
|
||||
/readPFMheader {
|
||||
currPFMfile bytesavailable
|
||||
% ---------------
|
||||
% PFM MAIN HEADER
|
||||
% ---------------
|
||||
skipw-p % PFM: version
|
||||
readd-p % PFM: size (size is dword, not word as the documentation says)
|
||||
ne {(Wrong file size\n) printquit} if
|
||||
60 skipa-p % PFM: copyright
|
||||
skipw-p % PFM: Type
|
||||
skipw-p % PFM: Points
|
||||
skipw-p % PFM: VertRes
|
||||
skipw-p % PFM: HorizRes
|
||||
skipw-p % PFM: Ascent
|
||||
skipw-p % PFM: InternalLeading
|
||||
skipw-p % PFM: ExternalLeading
|
||||
skipb-p % PFM: Italic
|
||||
skipb-p % PFM: Underline
|
||||
skipb-p % PFM: Stikeout
|
||||
skipw-p % PFM: Weight
|
||||
readb-p % PFM: CharSet
|
||||
/PFMCharSet edef
|
||||
skipw-p % PFM: PixWidth
|
||||
skipw-p % PFM: PixHeight
|
||||
skipb-p % PFM: PitchAndFamily
|
||||
skipw-p % PFM: AvgWidth
|
||||
skipw-p % PFM: MaxWidth
|
||||
skipb-p % PFM: FirstChar
|
||||
skipb-p % PFM: LastChar
|
||||
skipb-p % PFM: DefaultChar
|
||||
skipb-p % PFM: BreakChar
|
||||
skipw-p % PFM: WidthBytes
|
||||
skipd-p % PFM: Device
|
||||
skipd-p % PFM: Face
|
||||
skipd-p % PFM: BitsPointer
|
||||
skipd-p % PFM: BitsOffset
|
||||
% here we assume that it is a PostScript font, i.e., it always uses
|
||||
% the extended width table, therefore the normal width table is empty
|
||||
% -------------
|
||||
% PFM EXTENSION
|
||||
% -------------
|
||||
skipw-p % PFMEX: SizeFields
|
||||
readd-p % PFMEX: ExtMetricOffset
|
||||
/PFMExtMetricOffset edef
|
||||
skipd-p % PFMEX: ExtentTable
|
||||
skipd-p % PFMEX: OriginTable
|
||||
readd-p % PFMEX: PairKernTable
|
||||
/PFMPairKernTableOffset edef
|
||||
skipd-p % PFMEX: TrackKernTable
|
||||
skipd-p % PFMEX: DriverInfo
|
||||
skipd-p % PFMEX: Reserved
|
||||
} def
|
||||
|
||||
% requires that currPFMfile, PFMExtMetricOffset are defined
|
||||
% readPFMExtMetric -
|
||||
% defines PFMNumberofKernPairs
|
||||
|
||||
/readPFMExtMetric {
|
||||
currPFMfile PFMExtMetricOffset setfileposition
|
||||
skips-p % EXTT: Size
|
||||
skips-p % EXTT: PointSize
|
||||
skips-p % EXTT: Orientation
|
||||
skips-p % EXTT: MasterHeight
|
||||
skips-p % EXTT: MinScale
|
||||
skips-p % EXTT: MaxScale
|
||||
skips-p % EXTT: MasterUnit
|
||||
reads-p % EXTT: CapHeight
|
||||
/PFMCapHeight edef
|
||||
reads-p % EXTT: XHeight
|
||||
/PFMXHeight edef
|
||||
reads-p % EXTT: LowerCaseAscent
|
||||
/PFMLowerCaseAscent edef
|
||||
reads-p % EXTT: LowerCaseDescent
|
||||
neg /PFMLowerCaseDescent edef
|
||||
skips-p % EXTT: Slant
|
||||
skips-p % EXTT: SuperScript
|
||||
skips-p % EXTT: SubScript
|
||||
skips-p % EXTT: SuperScriptSize
|
||||
skips-p % EXTT: SubScriptSize
|
||||
skips-p % EXTT: UnderlineOffset
|
||||
skips-p % EXTT: UnderlineWidth
|
||||
skips-p % EXTT: DoubleUpperUnderlineOffset
|
||||
skips-p % EXTT: DoubleLowerUnderlineOffset
|
||||
skips-p % EXTT: DoubleUpperUnderlineWidth
|
||||
skips-p % EXTT: DoubleLowerUnderlineWidth
|
||||
skips-p % EXTT: StrikeOutOffset
|
||||
skips-p % EXTT: StrikeOutWidth
|
||||
readw-p % EXTT: KernPairs
|
||||
/PFMNumberofKernPairs edef
|
||||
skipw-p % EXTT: KernTracks
|
||||
} def
|
||||
|
||||
% requires that currPFMfile, PFMPairKernTableOffset, PFMNumberofKernPairs are defined
|
||||
% readPFMExtMetric -
|
||||
% prints kern pairs table in the AFM format
|
||||
|
||||
/readPFMKernPairs {
|
||||
currPFMfile () ne {
|
||||
PFMdict begin
|
||||
PFMPairKernTableOffset 0 ne {
|
||||
currPFMfile PFMPairKernTableOffset setfileposition
|
||||
readw-p % undocumented kern count (although all remaining structures are
|
||||
% explicitly preceded by their sizes); if it were a stable
|
||||
% feature, EXTTEXTMETRICS could be skipped
|
||||
PFMNumberofKernPairs
|
||||
% 2 copy = =
|
||||
ne {
|
||||
(Inconsistent number of kern pairs\n) printquit
|
||||
} if
|
||||
(StartKernData) =to.ofi
|
||||
(StartKernPairs ) print.to.ofi
|
||||
PFMNumberofKernPairs =to.ofi
|
||||
% ---------
|
||||
% MAIN LOOP
|
||||
% ---------
|
||||
/was.notdef false def
|
||||
PFMNumberofKernPairs {
|
||||
(KPX ) print.to.ofi
|
||||
readb-p % first char
|
||||
print-charname
|
||||
readb-p % second char
|
||||
print-charname
|
||||
reads-p % kern amount
|
||||
=to.ofi
|
||||
} repeat
|
||||
was.notdef {
|
||||
(.notdef character ocurred among kern pairs) =
|
||||
(you'd better check the resulting AFM file.) =
|
||||
} if
|
||||
(EndKernPairs) =to.ofi
|
||||
(EndKernData) =to.ofi
|
||||
} if
|
||||
end
|
||||
} if
|
||||
} def
|
||||
|
||||
% alias (for ``compatibility'' with J. Clark):
|
||||
/printkernpairs /readPFMKernPairs load def
|
||||
|
||||
% printcharmetrics -
|
||||
|
||||
/printcharmetrics {
|
||||
(StartCharMetrics ) print.to.ofi
|
||||
/PFBencoding currfont /Encoding get dup length array copy def
|
||||
/PFBcharstrings currfont /CharStrings get def
|
||||
PFBcharstrings length
|
||||
PFBcharstrings /.notdef known { 1 sub } if =to.ofi
|
||||
currfont 1000 scalefont setfont
|
||||
% checking Encoding array and CharStrings dictionary for
|
||||
% the consistency of names
|
||||
/was.inconsitent false def
|
||||
0 1 255 {
|
||||
dup PFBencoding exch get
|
||||
PFBcharstrings exch known {
|
||||
pop
|
||||
}{
|
||||
% dup PFBencoding exch get =
|
||||
PFBencoding exch /.notdef put % fix Encoding array
|
||||
/was.inconsitent true def
|
||||
} ifelse
|
||||
} for
|
||||
was.inconsitent {
|
||||
(Encoding array contains name(s) absent from CharStrings dictionary) =
|
||||
} if
|
||||
% print metric data for each character in PFB encoding vector
|
||||
0 1 255 {
|
||||
dup PFBencoding exch get
|
||||
dup /.notdef ne {
|
||||
exch dup printmetric
|
||||
}{
|
||||
pop pop
|
||||
} ifelse
|
||||
} for
|
||||
% xPFBencoding contains an entry for each name in the original
|
||||
% encoding vector
|
||||
/xPFBencoding PFBcharstrings length dict def
|
||||
PFBencoding {
|
||||
xPFBencoding exch true put
|
||||
} forall
|
||||
|
||||
/fontiter 0 def
|
||||
/TMPFontTemplate (TMP_FONT#000) def
|
||||
{
|
||||
% NewPFBencoding is the new encoding vector
|
||||
/NewPFBencoding 256 array def
|
||||
0 1 255 {
|
||||
NewPFBencoding exch /.notdef put
|
||||
} for
|
||||
% fill up NewPFBencoding with names from CharStrings dictionary that
|
||||
% are not encoded so far
|
||||
/i 0 def
|
||||
PFBcharstrings {
|
||||
pop
|
||||
i 255 le {
|
||||
dup xPFBencoding exch known not {
|
||||
dup xPFBencoding exch true put
|
||||
NewPFBencoding i 3 -1 roll put
|
||||
/i i 1 add def
|
||||
}{
|
||||
pop
|
||||
} ifelse
|
||||
}{
|
||||
pop exit
|
||||
} ifelse
|
||||
} forall
|
||||
i 0 eq {exit} if
|
||||
% define a new font with NewPFBencoding as its encoding vector
|
||||
currfont maxlength dict /NewTMPfont edef
|
||||
currfont {
|
||||
exch dup dup /FID ne exch /Encoding ne and {
|
||||
exch NewTMPfont 3 1 roll put
|
||||
}{
|
||||
pop pop
|
||||
} ifelse
|
||||
} forall
|
||||
% compute a unique name for a font to be registered
|
||||
/fontiter fontiter 1 add def
|
||||
TMPFontTemplate fontiter (000) cvs
|
||||
dup length TMPFontTemplate length exch sub exch putinterval
|
||||
/TMPFontName TMPFontTemplate cvn def
|
||||
NewTMPfont /FontName TMPFontName put
|
||||
NewTMPfont /Encoding NewPFBencoding put
|
||||
% make this new font the current font
|
||||
TMPFontName NewTMPfont definefont 1000 scalefont setfont
|
||||
% print metric data for each character in the newly created encoding vector
|
||||
0 1 255 {
|
||||
dup NewPFBencoding exch get
|
||||
dup /.notdef ne {
|
||||
exch -1 printmetric
|
||||
}{
|
||||
pop pop exit
|
||||
} ifelse
|
||||
} for
|
||||
i 255 lt {exit} if
|
||||
} loop
|
||||
(EndCharMetrics) =to.ofi
|
||||
} def
|
||||
|
||||
% name actual_code normal_code printmetric -
|
||||
|
||||
/printmetric {
|
||||
(C ) print.to.ofi =only.to.ofi
|
||||
( ; WX ) print.to.ofi
|
||||
onechar 0 3 -1 roll put
|
||||
onechar stringwidth pop round cvi =only.to.ofi
|
||||
( ; N ) print.to.ofi =only.to.ofi
|
||||
( ; B ) print.to.ofi
|
||||
newpath 0 0 moveto
|
||||
onechar false charpath flattenpath pathbbox
|
||||
newpath
|
||||
round cvi /ury edef round cvi /urx edef
|
||||
round cvi /lly edef round cvi /llx edef
|
||||
ury lly eq {/ury 0 def /lly 0 def} if % normalize degenrated BB
|
||||
urx llx eq {/urx 0 def /llx 0 def} if %
|
||||
llx =only.to.ofi ( ) print.to.ofi lly =only.to.ofi ( ) print.to.ofi
|
||||
urx =only.to.ofi ( ) print.to.ofi ury =only.to.ofi ( ) print.to.ofi
|
||||
(;) =to.ofi
|
||||
} def
|
||||
|
||||
/printinfoitem {
|
||||
3 1 roll 2 copy known {
|
||||
get dup type /stringtype ne { =string cvs } if exch
|
||||
print.to.ofi ( ) print.to.ofi =to.ofi
|
||||
}{
|
||||
pop pop pop
|
||||
} ifelse
|
||||
} def
|
||||
|
||||
/printfontinfo {
|
||||
(Comment AFM Generated by Ghostscript/pf2afm) =to.ofi
|
||||
currfont /FontName (FontName) printinfoitem
|
||||
%
|
||||
currfont /FontInfo get
|
||||
dup /FullName (FullName) printinfoitem
|
||||
dup /FamilyName (FamilyName) printinfoitem
|
||||
dup /Weight (Weight) printinfoitem
|
||||
dup /Notice (Notice) printinfoitem
|
||||
dup /ItalicAngle (ItalicAngle) printinfoitem
|
||||
dup /isFixedPitch (IsFixedPitch) printinfoitem
|
||||
dup /UnderlinePosition (UnderlinePosition) printinfoitem
|
||||
dup /UnderlineThickness (UnderlineThickness) printinfoitem
|
||||
/version (Version) printinfoitem
|
||||
%
|
||||
(EncodingScheme FontSpecific) =to.ofi
|
||||
%
|
||||
(FontBBox) print.to.ofi
|
||||
currfont /FontBBox get {
|
||||
( ) print.to.ofi round cvi =only.to.ofi
|
||||
} forall
|
||||
eolch print.to.ofi
|
||||
%
|
||||
currPFMfile () ne {
|
||||
PFMdict
|
||||
dup /PFMCapHeight (CapHeight) printinfoitem
|
||||
dup /PFMXHeight (XHeight) printinfoitem
|
||||
dup /PFMLowerCaseDescent (Descender) printinfoitem
|
||||
/PFMLowerCaseAscent (Ascender) printinfoitem
|
||||
} if
|
||||
} def
|
||||
|
||||
/readPFBfile {
|
||||
% make a shot of the actual font directory:
|
||||
/oldFontDirectory FontDirectory dup length dict copy def
|
||||
isPFB {% defined in `makeafm'
|
||||
(r) file true /PFBDecode filter cvx % true is better (see gs_type1.ps)
|
||||
mark exch exec
|
||||
}{
|
||||
(r) file mark exch run
|
||||
} ifelse
|
||||
cleartomark
|
||||
% make a shot of the updated font directory:
|
||||
/newFontDirectory FontDirectory dup length dict copy def
|
||||
% spot the added font:
|
||||
oldFontDirectory {pop newFontDirectory exch undef} forall
|
||||
newFontDirectory length 1 ne {
|
||||
newFontDirectory length =
|
||||
(Weird PFB file?\n) printquit
|
||||
} if
|
||||
newFontDirectory {pop} forall
|
||||
findfont /currfont edef
|
||||
} def
|
||||
|
||||
/readPFMfile {
|
||||
dup () ne {
|
||||
(r) file /currPFMfile edef
|
||||
10 dict dup /PFMdict edef begin
|
||||
readPFMheader
|
||||
readPFMExtMetric
|
||||
end
|
||||
}{
|
||||
pop /currPFMfile () def
|
||||
} ifelse
|
||||
} def
|
||||
|
||||
% pfmfilename pf[ba]filename filetype printafm -
|
||||
% where filetype=(a) or (b)
|
||||
|
||||
/printafm {
|
||||
readPFBfile
|
||||
readPFMfile
|
||||
(StartFontMetrics 2.0) =to.ofi
|
||||
printfontinfo
|
||||
printcharmetrics
|
||||
printkernpairs
|
||||
(EndFontMetrics) =to.ofi
|
||||
} def
|
||||
|
||||
/pfa_pfb_dict <<
|
||||
/.pfb /pfbn
|
||||
/.pfB /pfbn
|
||||
/.pFb /pfbn
|
||||
/.pFB /pfbn
|
||||
/.Pfb /pfbn
|
||||
/.PfB /pfbn
|
||||
/.PFb /pfbn
|
||||
/.PFB /pfbn
|
||||
|
||||
/.pfa /pfan
|
||||
/.pfA /pfan
|
||||
/.pFa /pfan
|
||||
/.pFA /pfan
|
||||
/.Pfa /pfan
|
||||
/.PfA /pfan
|
||||
/.PFa /pfan
|
||||
/.PFA /pfan
|
||||
>> readonly def
|
||||
|
||||
% Check whether the file name has pfa or pfb extension.
|
||||
/pfa_or_pfb? { % s -> false | /name true
|
||||
dup length 4 lt {
|
||||
pop //false
|
||||
} {
|
||||
dup length 4 sub 4 getinterval //pfa_pfb_dict exch .knownget
|
||||
} ifelse
|
||||
} bind def
|
||||
|
||||
% pf[ba]filename makeafm -
|
||||
/makeafm {
|
||||
count 0 eq {(Missing font file name\n) printquit} if
|
||||
/ifn edef
|
||||
ifn length 0 eq {(Empty font file name\n) printquit} if
|
||||
% the following piece of the code does, in fact, the job of a system shell,
|
||||
% i.e., it analyses the supplied names, appends extensions if needed,
|
||||
% and check files:
|
||||
/pfbn () def /pfan () def /pfmn () def % initialisation
|
||||
[ t1_glyph_equivalence { pop } forall ] { % disable glyph substitution
|
||||
t1_glyph_equivalence exch undef
|
||||
} forall
|
||||
ifn pfa_or_pfb? {
|
||||
ifn dup length string copy def
|
||||
ifn dup length 4 sub 0 exch getinterval /ifn edef
|
||||
} if
|
||||
pfbn () eq pfan () eq and dup {% no extension was supplied, try ".pfb"
|
||||
/pfbn ifn (.pfb) concatstrings def
|
||||
} if
|
||||
pfbn () ne {% check whether "filename.pfb" exists
|
||||
pfbn status {pop pop pop pop /isPFB true def}{/pfbn () def} ifelse
|
||||
} if
|
||||
pfbn () eq and {% checking "filename.pfb" unsuccessful, try ".pfa"
|
||||
/pfan ifn (.pfa) concatstrings def
|
||||
} if
|
||||
pfan () ne {% check whether "filename.pfa" exists
|
||||
pfan status {pop pop pop pop /isPFB false def}{/pfan () def} ifelse
|
||||
} if
|
||||
|
||||
pfbn () eq pfan () eq and {
|
||||
(Neither pfa nor pfb found\n) printquit
|
||||
} if
|
||||
|
||||
/ofn ifn (.afm) concatstrings def
|
||||
ofn status {
|
||||
pop pop pop pop (Resulting file exists\n) printquit
|
||||
} if
|
||||
/ofi ofn (w) file def
|
||||
|
||||
/pfmn ifn (.pfm) concatstrings def
|
||||
pfmn status {
|
||||
pop pop pop pop
|
||||
}{
|
||||
() pfmn {
|
||||
(/) search dup not { pop (\\) search } if {
|
||||
4 -1 roll exch concatstrings exch concatstrings exch
|
||||
}{
|
||||
exit
|
||||
} ifelse
|
||||
} loop
|
||||
(pfm/) exch concatstrings concatstrings
|
||||
dup status {
|
||||
pop pop pop pop /pfmn edef
|
||||
}{
|
||||
pop /pfmn () def (pfm file not found -- ignored\n) print
|
||||
} ifelse
|
||||
} ifelse
|
||||
//systemdict /.setsafe known {
|
||||
<<
|
||||
/PermitFileReading
|
||||
[ pfmn dup length 0 eq { pop } if
|
||||
isPFB {pfbn}{pfan} ifelse
|
||||
]
|
||||
/PermitFileWriting [ ]
|
||||
/PermitFileControl [ ]
|
||||
>> setuserparams
|
||||
.locksafe
|
||||
} if
|
||||
|
||||
pfmn
|
||||
isPFB {pfbn}{pfan} ifelse
|
||||
printafm
|
||||
|
||||
} def
|
||||
|
||||
% Check for command line arguments.
|
||||
[ .shellarguments
|
||||
{ ] dup length 1 eq {
|
||||
0 get makeafm
|
||||
}{
|
||||
(This is PF2AFM -- AFM generator \(ver. 1.00\)\n) print
|
||||
(Usage: gs [-dNODISPLAY] -- pf2afm.ps disk_font_name\n) printquit
|
||||
} ifelse
|
||||
}
|
||||
{pop}
|
||||
ifelse
|
||||
33
dist/conf/ghostscript/lib/pfbtopfa.ps
vendored
33
dist/conf/ghostscript/lib/pfbtopfa.ps
vendored
@@ -1,33 +0,0 @@
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% 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.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% pfbtopfa.ps
|
||||
% Convert a .pfb font to .pfa format.
|
||||
|
||||
[ .shellarguments {
|
||||
counttomark 2 eq {
|
||||
/pfa exch def /pfb exch def pop
|
||||
/in1 pfb (r) file def
|
||||
/in in1 true /PFBDecode filter def
|
||||
/out pfa (w) file def
|
||||
{ in read not { exit } if out exch write } loop
|
||||
out closefile in closefile in1 closefile
|
||||
quit
|
||||
} {
|
||||
cleartomark (Usage: pfbtopfa input.pfb output.pfa) = flush
|
||||
} ifelse
|
||||
} {
|
||||
pop
|
||||
} ifelse
|
||||
53
dist/conf/ghostscript/lib/ppath.ps
vendored
53
dist/conf/ghostscript/lib/ppath.ps
vendored
@@ -1,53 +0,0 @@
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% 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.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Redefine pathforall for tracing.
|
||||
% Can't be used recursively.
|
||||
|
||||
/# {( )print} def
|
||||
|
||||
/-mat matrix def
|
||||
/-imat matrix def
|
||||
/-smat { //-mat currentmatrix pop //-imat setmatrix } bind def
|
||||
/-rmat { //-mat setmatrix } bind def
|
||||
/-pathforall /pathforall load def
|
||||
/-p2 { ( ) print exch =only ( ) print =only } bind def
|
||||
/-dp2 { 2 copy -p2 2 { exch 4096 mul dup cvi dup ( ) print =only sub dup 0 eq { pop } { (+) print =only } ifelse } repeat } bind def
|
||||
/-tp2 { //-mat itransform -p2 } bind def
|
||||
/-dict 5 dict def
|
||||
|
||||
/pathforall
|
||||
{ -dict begin
|
||||
/-close exch def /-curve exch def /-line exch def /-move exch def
|
||||
end -smat -mat ==only ( setmatrix) =
|
||||
{2 copy -tp2 ( moveto\t%)print
|
||||
2 copy -dp2 (\n)print
|
||||
flush -dict /-move get -rmat exec -smat}
|
||||
{2 copy -tp2 ( lineto\t%)print
|
||||
2 copy -dp2 (\n)print
|
||||
flush -dict /-line get -rmat exec -smat}
|
||||
{5 index 5 index -tp2 3 index 3 index -tp2 2 copy -tp2 ( curveto\t%)print
|
||||
5 index 5 index -dp2 3 index 3 index -dp2 2 copy -dp2 (\n)print
|
||||
flush -dict /-curve get -rmat exec -smat}
|
||||
{(closepath\n)print flush -dict /-close get -rmat exec -smat}
|
||||
-pathforall -rmat
|
||||
}
|
||||
def
|
||||
|
||||
% Just print the current path
|
||||
|
||||
/printpath {
|
||||
{pop pop} {pop pop} {pop pop pop pop pop pop} {} pathforall
|
||||
} def
|
||||
220
dist/conf/ghostscript/lib/pphs.ps
vendored
220
dist/conf/ghostscript/lib/pphs.ps
vendored
@@ -1,220 +0,0 @@
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% 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.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Print Linearized PDF hint streams
|
||||
|
||||
% Utilities
|
||||
/read1 { % <file> read1 <value>
|
||||
read not {
|
||||
(**** Unexpected EOF) = flush quit
|
||||
} if
|
||||
} bind def
|
||||
/read2 { % <file> read2 <value>
|
||||
dup read1 8 bitshift exch read1 add
|
||||
} bind def
|
||||
/read4 { % <file> read4 <value>
|
||||
dup read2 16 bitshift exch read2 add
|
||||
} bind def
|
||||
% Free variables: Bits, Bitsleft
|
||||
/readninit { % - <readninit> -
|
||||
/Bits 0 def
|
||||
/Bitsleft 0 def
|
||||
} bind def
|
||||
|
||||
/pdftoken { % <file> pdftoken <token>
|
||||
dup token pop
|
||||
dup type /nametype eq 1 index xcheck and {
|
||||
dup dup (<<) cvn eq exch ([) eq or {
|
||||
exec exch {
|
||||
dup pdftoken dup dup (>>) cvn eq exch (]) eq or {
|
||||
exch pop exec exit
|
||||
} if exch
|
||||
} loop
|
||||
} {
|
||||
exch pop
|
||||
} ifelse
|
||||
} {
|
||||
exch pop
|
||||
} ifelse
|
||||
} bind def
|
||||
/makemask { % <nbits> makemask <mask>
|
||||
1 exch bitshift 1 sub
|
||||
} bind def
|
||||
/readn { % <file> <nbits> readn <value>
|
||||
dup Bitsleft le {
|
||||
exch pop
|
||||
/Bitsleft Bitsleft 2 index sub def
|
||||
makemask Bits Bitsleft neg bitshift and
|
||||
} {
|
||||
Bitsleft makemask Bits and
|
||||
exch Bitsleft sub exch 1 index bitshift 3 1 roll
|
||||
/Bits 2 index read1 def /Bitsleft 8 def
|
||||
readn add
|
||||
} ifelse
|
||||
} bind def
|
||||
/sread { % <string> sread <file>
|
||||
0 () /SubFileDecode filter
|
||||
} bind def
|
||||
|
||||
/ptag { % <pre-tag> <proc> <post-tag> ptag -
|
||||
3 -1 roll print (: ) print
|
||||
exch exec
|
||||
( % ) print =
|
||||
} bind def
|
||||
|
||||
% Print the linearization parameters dictionary.
|
||||
/plpkeys <<
|
||||
/E (end of p. 1 objects)
|
||||
/L (total file length)
|
||||
/H (PHS start + length)
|
||||
/N (# of pages)
|
||||
/O (p. 1 object #)
|
||||
/T (offset of first main xref entry)
|
||||
>> def
|
||||
/plpdict { % <dict> plpdict -
|
||||
(<<) = plpkeys {
|
||||
2 index 2 index .knownget {
|
||||
% Stack: dict key label value
|
||||
( ) print 3 -1 roll ===only ( ) print ===only
|
||||
( % ) print =
|
||||
} {
|
||||
pop pop
|
||||
} ifelse
|
||||
} forall {
|
||||
plpkeys 2 index known {
|
||||
pop pop
|
||||
} {
|
||||
( ) print exch ===only ( ) print ===
|
||||
} ifelse
|
||||
} forall (>>) =
|
||||
} bind def
|
||||
|
||||
% Print the Page Offset Hint Table.
|
||||
/ppoht { % <npages> <file> ppoht -
|
||||
|
||||
20 dict begin
|
||||
/f exch def
|
||||
/npages exch def
|
||||
readninit
|
||||
|
||||
(1) { f read4 =only } (least # objs/page) ptag
|
||||
(2) { f read4 =only } (offset of p. 1 object (+PHS length if beyond PHS)) ptag
|
||||
(3) { f read2 dup =only /nb3 exch def } (# bits for # objs/page delta) ptag
|
||||
(4) { f read4 =only } (least # bytes/page) ptag
|
||||
(5) { f read2 dup =only /nb5 exch def } (# bits for # bytes/page delta) ptag
|
||||
(6) { f read4 =only } (least content stream offset-in-page) ptag
|
||||
(7) { f read2 dup =only /nb7 exch def } (# bits for content stream offset delta) ptag
|
||||
(8) { f read4 =only } (least content stream length) ptag
|
||||
(9) { f read2 dup =only /nb9 exch def } (# bits for content stream length delta) ptag
|
||||
(10) { f read2 dup =only /nb10 exch def } (# bits for # of shared obj refs) ptag
|
||||
(11) { f read2 dup =only /nb11 exch def } (# bits for shared obj indices) ptag
|
||||
(12) { f read2 dup =only /nb12 exch def } (# bits for shared obj ref pos numerators) ptag
|
||||
(13) { f read2 =only } (shared obj ref pos denominator) ptag
|
||||
|
||||
(*1) { [ npages { f nb3 readn } repeat ] ==only } (# objs/page deltas (see 1,3)) ptag
|
||||
(*2) { [ npages { f nb5 readn } repeat ] ==only } (# bytes/page deltas (see 4,5)) ptag
|
||||
(*3) { [ npages { f nb10 readn } repeat ] dup ==only /nso exch def } (# of shared obj refs (see 10)) ptag
|
||||
(*4) { [ nso { [ exch { f nb11 readn } repeat ] } forall ] ==only } (shared obj indices (see 11)) ptag
|
||||
(*5) { [ nso { [ exch { f nb12 readn } repeat ] } forall ] ==only } (shared obj ref pos numerators (see 12)) ptag
|
||||
(*6) { [ npages { f nb7 readn } repeat ] ==only } (content stream offset-in-page deltas (see 6,7)) ptag
|
||||
(*7) { [ npages { f nb9 readn } repeat ] ==only } (content stream length deltas (see 8,9)) ptag
|
||||
|
||||
end % temp dict
|
||||
|
||||
} bind def
|
||||
|
||||
% Print the Shared Objects Hint Table.
|
||||
/psoht { % <file> psoht -
|
||||
|
||||
20 dict begin
|
||||
/f exch def
|
||||
readninit
|
||||
|
||||
(1) { f read4 =only } (first shared obj #) ptag
|
||||
(2) { f read4 =only } (first shared obj offset (+PHS length if beyond PHS)) ptag
|
||||
(3) { f read4 dup =only /n3 exch def } (# of p. 1 shared objs) ptag
|
||||
(4) { f read4 dup =only /n4 exch def } (total # of shared objs) ptag
|
||||
(5) { f read2 dup =only /nb5 exch def } (# bits for # of shared objs/group) ptag
|
||||
(6) { f read4 =only } (least shared obj group length) ptag
|
||||
(7) { f read2 dup =only /nb7 exch def } (# bits for shared obj group length delta) ptag
|
||||
|
||||
/nse n4 def
|
||||
(*1) { [ nse { f nb7 readn } repeat ] ==only } (shared obj group length deltas (see 6,7)) ptag
|
||||
(*2) { [ nse { f 1 readn } repeat ] dup ==only /md5s exch def } (MD5 present?) ptag
|
||||
(*3:) = md5s {
|
||||
0 ne {
|
||||
( ) print f 16 string readstring pop
|
||||
(%stdout) (w) file dup 3 -1 roll writehexstring closefile () =
|
||||
} if
|
||||
} forall
|
||||
(*4) { [ nse { f nb5 readn } repeat ] ==only } (# objs/group (see 5)) ptag
|
||||
|
||||
end % temp dict
|
||||
|
||||
} bind def
|
||||
|
||||
% Print the Primary Hint Stream of a PDF file.
|
||||
/pphs { % <file> pphs -
|
||||
/pdf exch def
|
||||
|
||||
% Read the linearization parameter dictionary.
|
||||
{ pdf pdftoken /obj eq { exit } if } loop
|
||||
pdf pdftoken /lpdict exch def
|
||||
/lpdict type /dicttype eq { lpdict /Linearized known } { false } ifelse {
|
||||
(Not a linearized PDF file.) = stop
|
||||
} if
|
||||
|
||||
lpdict plpdict flush
|
||||
|
||||
% Read the primary hint stream.
|
||||
null {
|
||||
pdf pdftoken dup /stream eq { pop exit } if
|
||||
exch pop
|
||||
} loop
|
||||
/phsdict exch def
|
||||
% Remove Length if indirect reference.
|
||||
phsdict 0 known {
|
||||
phsdict 0 undef phsdict /Length undef
|
||||
} if
|
||||
(PHS: ) print phsdict === flush
|
||||
pdf 0 (endstream) /SubFileDecode filter
|
||||
dup 64000 string readstring pop exch closefile
|
||||
sread /phsdata exch def
|
||||
|
||||
% Decode the hint stream data if necessary.
|
||||
phsdict /Filter .knownget {
|
||||
phsdata exch filter
|
||||
dup 5000 string readstring pop exch closefile
|
||||
sread /phsdata exch def
|
||||
} if
|
||||
|
||||
% Adobe says we can assume /P = 0.
|
||||
(Page Offset Hint Table:) =
|
||||
lpdict /N get
|
||||
phsdata phsdict /S get string readstring pop sread
|
||||
ppoht
|
||||
(Shared Objects Hint Table:) =
|
||||
phsdata psoht
|
||||
} bind def
|
||||
|
||||
% Check for command line arguments.
|
||||
[ .shellarguments
|
||||
{ ] dup length 1 eq
|
||||
{ 0 get (r) file dup pphs closefile }
|
||||
{ (Usage: pphs filename.pdf\n) print flush }
|
||||
ifelse
|
||||
}
|
||||
{ pop }
|
||||
ifelse
|
||||
261
dist/conf/ghostscript/lib/prfont.ps
vendored
261
dist/conf/ghostscript/lib/prfont.ps
vendored
@@ -1,261 +0,0 @@
|
||||
%!
|
||||
%%Creator: Eric Gisin <egisin@waterloo.csnet>
|
||||
%%Title: Print font catalog
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% 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.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
% Copyright (c) 1986 Eric Gisin
|
||||
% Copyright (C) 1992 Aladdin Enterprises, Menlo Park, CA
|
||||
% Modified to print all 256 encoded characters.
|
||||
% Copyright (C) 1993 Aladdin Enterprises, Menlo Park, CA
|
||||
% Modified to print unencoded characters.
|
||||
% Copyright (C) 1994 Aladdin Enterprises, Menlo Park, CA
|
||||
% Modified to always create 256-element Encoding vectors.
|
||||
% Copyright (C) 1995 Aladdin Enterprises, Menlo Park, CA
|
||||
% Modified to print more than 128 unencoded characters.
|
||||
% Copyright (C) 1996 Aladdin Enterprises, Menlo Park, CA
|
||||
% Modified to leave a slightly wider left margin, because many H-P
|
||||
% printers can't print in the leftmost 1/4" of the page.
|
||||
% Modified to print unencoded characters in any font that has CharStrings.
|
||||
% Copyright (C) 1999 Aladdin Enterprises, Menlo Park, CA
|
||||
% Modified to sort unencoded characters.
|
||||
% Copyright (C) 2000 Aladdin Enterprises, Menlo Park, CA
|
||||
% Modified to print CIDFonts as well as fonts.
|
||||
% O(N^2) sorting replaced with O(N log N).
|
||||
% Copyright transferred 2000/09/15 to Artifex Software, Inc. Send any questions to
|
||||
% bug-gs@ghostscript.com.
|
||||
|
||||
|
||||
% Example usages at bottom of file
|
||||
|
||||
/#copies 1 def
|
||||
/min { 2 copy gt { exch } if pop } bind def
|
||||
|
||||
/T6 /Times-Roman findfont 6 scalefont def
|
||||
/Temp 64 string def
|
||||
/Inch {72 mul} def
|
||||
/Base 16 def % char code output base
|
||||
/TempEncoding [ 256 { /.notdef } repeat ] def
|
||||
|
||||
% Sort an array. Code used by permission of the author, Aladdin Enterprises.
|
||||
/sort { % <array> <lt-proc> sort <array>
|
||||
% Heapsort (algorithm 5.2.3H, Knuth vol. 2, p. 146),
|
||||
% modified for 0-origin indexing. */
|
||||
10 dict begin
|
||||
/LT exch def
|
||||
/recs exch def
|
||||
/N recs length def
|
||||
N 1 gt {
|
||||
/l N 2 idiv def
|
||||
/r N 1 sub def {
|
||||
l 0 gt {
|
||||
/l l 1 sub def
|
||||
/R recs l get def
|
||||
} {
|
||||
/R recs r get def
|
||||
recs r recs 0 get put
|
||||
/r r 1 sub def
|
||||
r 0 eq { recs 0 R put exit } if
|
||||
} ifelse
|
||||
/j l def {
|
||||
/i j def
|
||||
/j j dup add 1 add def
|
||||
j r lt {
|
||||
recs j get recs j 1 add get LT { /j j 1 add def } if
|
||||
} if
|
||||
j r gt { recs i R put exit } if
|
||||
R recs j get LT not { recs i R put exit } if
|
||||
recs i recs j get put
|
||||
} loop
|
||||
} loop
|
||||
} if recs end
|
||||
} def
|
||||
|
||||
% do single character of page
|
||||
% output to rectangle ll=(0,-24) ur=(36,24)
|
||||
/DoGlyph { % C, N, W set
|
||||
|
||||
% print code name, width and char name
|
||||
T6 setfont
|
||||
N /.notdef ne {0 -20 moveto N Temp cvs show} if
|
||||
0 -12 moveto C Base Temp cvrs show ( ) show
|
||||
W 0.0005 add Temp cvs 0 5 getinterval show
|
||||
|
||||
% print char with reference lines
|
||||
N /.notdef ne {
|
||||
3 0 translate
|
||||
0 0 moveto F24 setfont N glyphshow
|
||||
/W W 24 mul def
|
||||
0 -6 moveto 0 24 lineto
|
||||
W -6 moveto W 24 lineto
|
||||
-3 0 moveto W 3 add 0 lineto
|
||||
0 setlinewidth stroke
|
||||
} if
|
||||
} def
|
||||
/DoChar {
|
||||
/C exch def
|
||||
/N F /Encoding get C get def
|
||||
/S (_) dup 0 C put def
|
||||
/W F setfont S stringwidth pop def
|
||||
DoGlyph
|
||||
} def
|
||||
/CIDTemp 20 string def
|
||||
/DoCID {
|
||||
/N exch def
|
||||
/C N def
|
||||
/W F setfont gsave
|
||||
matrix currentmatrix nulldevice setmatrix
|
||||
0 0 moveto N glyphshow currentpoint pop
|
||||
grestore def
|
||||
DoGlyph
|
||||
} def
|
||||
|
||||
% print page title
|
||||
/DoTitle {
|
||||
/Times-Roman findfont 18 scalefont setfont
|
||||
36 10.5 Inch moveto FName Temp cvs show ( ) show ((24 point)) show
|
||||
} def
|
||||
|
||||
% print one block of characters
|
||||
/DoBlock { % firstcode lastcode
|
||||
/FirstCode 2 index def
|
||||
1 exch {
|
||||
/I exch def
|
||||
/Xn I FirstCode sub 16 mod def /Yn I FirstCode sub 16 idiv def
|
||||
gsave
|
||||
Xn 35 mul 24 add Yn -56 mul 9.5 Inch add translate
|
||||
I DoCode
|
||||
grestore
|
||||
} for
|
||||
} def
|
||||
|
||||
% print a line of character
|
||||
/DoCharLine { % firstcode lastcode
|
||||
1 exch { (_) dup 0 3 index put show pop } for
|
||||
} def
|
||||
/DoCIDLine { % firstcode lastcode
|
||||
1 exch { glyphshow } for
|
||||
} def
|
||||
|
||||
% initialize variables
|
||||
/InitDoFont { % fontname font
|
||||
/F exch def % font
|
||||
/FName exch def % font name
|
||||
/F24 F 24 scalefont def
|
||||
/Line0 96 string def
|
||||
/Line1 96 string def
|
||||
/Namestring1 128 string def
|
||||
/Namestring2 128 string def
|
||||
} def
|
||||
|
||||
% print pages of unencoded characters
|
||||
/DoUnencoded { % glyphs
|
||||
/Unencoded exch def
|
||||
/Count Unencoded length def
|
||||
|
||||
% Print the unencoded characters in blocks of 128.
|
||||
|
||||
0 128 Unencoded length 1 sub
|
||||
{ /BlockStart 1 index def
|
||||
dup 128 add Unencoded length min 1 index sub
|
||||
Unencoded 3 1 roll getinterval TempEncoding copy
|
||||
/BlockEncoding exch def
|
||||
/BlockCount BlockEncoding length def
|
||||
save
|
||||
F /Encoding known {
|
||||
F length dict F
|
||||
{ 1 index /FID eq { pop pop } { 2 index 3 1 roll put } ifelse }
|
||||
forall dup /Encoding TempEncoding put
|
||||
/* exch definefont
|
||||
/F exch def
|
||||
/F24 F 24 scalefont def
|
||||
/BlockStart 0 def
|
||||
} if
|
||||
|
||||
DoTitle (, unencoded characters) show
|
||||
BlockStart dup BlockCount 1 sub add DoBlock
|
||||
F 10 scalefont setfont
|
||||
36 2.4 Inch moveto
|
||||
0 32 BlockCount 1 sub {
|
||||
0 -0.4 Inch rmoveto gsave
|
||||
dup 31 add BlockCount 1 sub min
|
||||
exch BlockStart add exch BlockStart add DoLine
|
||||
grestore
|
||||
} for
|
||||
showpage
|
||||
restore
|
||||
} for
|
||||
|
||||
} def
|
||||
|
||||
% print font sample pages
|
||||
/DoFont {
|
||||
dup findfont InitDoFont
|
||||
/DoCode {DoChar} def
|
||||
/DoLine {DoCharLine} def
|
||||
|
||||
% Display the first 128 encoded characters.
|
||||
|
||||
DoTitle (, characters 0-127) show
|
||||
0 127 DoBlock
|
||||
F 10 scalefont setfont
|
||||
36 2.0 Inch moveto 0 31 DoLine
|
||||
36 1.6 Inch moveto 32 63 DoLine
|
||||
36 1.2 Inch moveto 64 95 DoLine
|
||||
36 0.8 Inch moveto 96 127 DoLine
|
||||
showpage
|
||||
|
||||
% Display the second 128 encoded characters.
|
||||
|
||||
DoTitle (, characters 128-255) show
|
||||
128 255 DoBlock
|
||||
F 10 scalefont setfont
|
||||
36 2.0 Inch moveto 128 159 DoLine
|
||||
36 1.6 Inch moveto 160 191 DoLine
|
||||
36 1.2 Inch moveto 192 223 DoLine
|
||||
36 0.8 Inch moveto 224 255 DoLine
|
||||
showpage
|
||||
|
||||
F /CharStrings known
|
||||
{
|
||||
% Find and display the unencoded characters.
|
||||
|
||||
/Encoded F /Encoding get length dict def
|
||||
F /Encoding get { true Encoded 3 1 roll put } forall
|
||||
[ F /CharStrings get
|
||||
{ pop dup Encoded exch known { pop } if }
|
||||
forall ] {
|
||||
exch Namestring1 cvs exch Namestring2 cvs lt
|
||||
} sort DoUnencoded
|
||||
|
||||
}
|
||||
if
|
||||
|
||||
} def
|
||||
|
||||
% print CIDFont sample pages
|
||||
/DoCIDFont {
|
||||
dup /CIDFont findresource InitDoFont
|
||||
/DoCode {DoCID} def
|
||||
/DoLine {DoCIDLine} def
|
||||
|
||||
[ 0 1 F /CIDCount get 1 sub { } for ] DoUnencoded
|
||||
} def
|
||||
|
||||
% Do font samples
|
||||
% /Times-Roman DoFont % Test (less than a minute)
|
||||
% /Hershey-Gothic-English DoFont % Test (8 minutes)
|
||||
|
||||
% Do a complete catalog
|
||||
% FontDirectory {pop DoFont} forall % All fonts (quite a long time)
|
||||
173
dist/conf/ghostscript/lib/printafm.ps
vendored
173
dist/conf/ghostscript/lib/printafm.ps
vendored
@@ -1,173 +0,0 @@
|
||||
%!
|
||||
% written by James Clark <jjc@jclark.uucp>
|
||||
% print an afm file on the standard output
|
||||
% usage is `fontname printafm' eg `/Times-Roman printafm'
|
||||
|
||||
% From the `dvitops' distribution, which included this notice:
|
||||
% dvitops is not copyrighted; you can do with it exactly as you please.
|
||||
% I would, however, ask that if you make improvements or modifications,
|
||||
% you ask me before distributing them to others.
|
||||
|
||||
% Altered by d.love@dl.ac.uk to produce input for Rokicki's afm2tfm,
|
||||
% which groks the format of the Adobe AFMs.
|
||||
|
||||
% Modified by L. Peter Deutsch 9/14/93:
|
||||
% uses Ghostscript's =only procedure to replace 'buf cvs print'.
|
||||
% Modified by L. Peter Deutsch 9/6/95:
|
||||
% uses Ghostscript's .shellarguments facility to accept the font name
|
||||
% on the command line.
|
||||
|
||||
% Altered my master@iaas.msu.ru to work with fonts of more than 256 glyphs
|
||||
% and avoid FSType output. Also print a comment with UniqueID of the font.
|
||||
|
||||
/onechar 1 string def
|
||||
|
||||
% c toupper - c
|
||||
/toupper {
|
||||
dup dup 8#141 ge exch 8#172 le and {
|
||||
8#40 sub
|
||||
} if
|
||||
} bind def
|
||||
|
||||
% print unencoded character metric data lines for glyphs in `v' array
|
||||
% and reset `v' -
|
||||
/printv {
|
||||
% define a new font with v as its encoding vector
|
||||
currentfont maxlength dict /f exch def
|
||||
currentfont {
|
||||
exch dup dup /FID ne exch /Encoding ne and {
|
||||
exch f 3 1 roll put
|
||||
} {
|
||||
pop pop
|
||||
} ifelse
|
||||
} forall
|
||||
f /Encoding v put
|
||||
f /FontName /temp put
|
||||
% make this new font the current font
|
||||
/temp f definefont setfont
|
||||
% print a entry for each character not in old vector
|
||||
/e currentfont /Encoding get def
|
||||
0 1 255 {
|
||||
dup e exch get
|
||||
dup dup /.notdef ne exch s exch known not and {
|
||||
exch -1 printmetric
|
||||
} {
|
||||
pop pop
|
||||
} ifelse
|
||||
} for
|
||||
0 1 255 {
|
||||
v exch /.notdef put
|
||||
} for
|
||||
} bind def
|
||||
|
||||
% printcharmetrics -
|
||||
|
||||
/printcharmetrics {
|
||||
(StartCharMetrics ) print
|
||||
currentfont /CharStrings get dup length exch /.notdef known { 1 sub } if =
|
||||
currentfont 1000 scalefont setfont 0 0 moveto
|
||||
/e currentfont /Encoding get def
|
||||
0 1 255 {
|
||||
dup e exch get
|
||||
dup /.notdef ne {
|
||||
exch dup printmetric
|
||||
} {
|
||||
pop pop
|
||||
} ifelse
|
||||
} for
|
||||
% s contains an entry for each name in the original encoding vector
|
||||
/s 256 dict def
|
||||
e {
|
||||
s exch true put
|
||||
} forall
|
||||
% v is the new encoding vector
|
||||
/v 256 array def
|
||||
0 1 255 {
|
||||
v exch /.notdef put
|
||||
} for
|
||||
% fill up v with names in CharStrings
|
||||
/i 0 def
|
||||
currentfont /CharStrings get {
|
||||
pop
|
||||
i 255 le {
|
||||
v i 3 -1 roll put
|
||||
/i i 1 add def
|
||||
} {
|
||||
printv
|
||||
v 0 3 -1 roll put
|
||||
/i 1 def
|
||||
} ifelse
|
||||
} forall
|
||||
printv
|
||||
(EndCharMetrics) =
|
||||
} bind def
|
||||
|
||||
% name actual_code normal_code printmetric -
|
||||
|
||||
/printmetric {
|
||||
/saved save def
|
||||
(C ) print =only
|
||||
( ; WX ) print
|
||||
onechar 0 3 -1 roll put
|
||||
onechar stringwidth pop round cvi =only
|
||||
( ; N ) print =only
|
||||
( ; B ) print
|
||||
onechar false charpath flattenpath mark pathbbox counttomark {
|
||||
counttomark -1 roll
|
||||
round cvi =only
|
||||
( ) print
|
||||
} repeat pop
|
||||
(;) =
|
||||
saved restore
|
||||
} bind def
|
||||
|
||||
% fontname printafm -
|
||||
|
||||
/printafm {
|
||||
findfont gsave setfont
|
||||
(StartFontMetrics 2.0) =
|
||||
|
||||
% Print the UniqueID
|
||||
|
||||
currentfont /UniqueID known {
|
||||
(Comment UniqueID ) print
|
||||
currentfont /UniqueID get =only
|
||||
(\n) print
|
||||
} if
|
||||
|
||||
(FontName ) print currentfont /FontName get =
|
||||
|
||||
% Print the FontInfo
|
||||
|
||||
currentfont /FontInfo get {
|
||||
exch
|
||||
dup /FSType ne {
|
||||
=string cvs dup dup 0 get 0 exch toupper put print
|
||||
( ) print =
|
||||
} {
|
||||
pop pop
|
||||
} ifelse
|
||||
} forall
|
||||
|
||||
% Print the FontBBox
|
||||
|
||||
(FontBBox) print
|
||||
currentfont /FontBBox get {
|
||||
( ) print round cvi =only
|
||||
} forall
|
||||
(\n) print
|
||||
|
||||
printcharmetrics
|
||||
(EndFontMetrics) =
|
||||
grestore
|
||||
} bind def
|
||||
|
||||
% Check for command line arguments.
|
||||
[ .shellarguments
|
||||
{ ] dup length 1 eq
|
||||
{ 0 get printafm }
|
||||
{ (Usage: printafm fontname\n) print flush }
|
||||
ifelse
|
||||
}
|
||||
{ pop }
|
||||
ifelse
|
||||
550
dist/conf/ghostscript/lib/ps2ai.ps
vendored
550
dist/conf/ghostscript/lib/ps2ai.ps
vendored
@@ -1,550 +0,0 @@
|
||||
%!
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% 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.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
%xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
%
|
||||
% ps2ai.ps - a postscript to editable adobe illustrator file filter
|
||||
%
|
||||
/vers {2.14} def % January 31, 1999
|
||||
|
||||
% conditional def ( if the key is already defined before, don't
|
||||
% redefine it. This can be used by other programs to overwrite
|
||||
% some settings from externally
|
||||
%
|
||||
/cdef { 1 index where { pop pop pop } { def } ifelse } bind def
|
||||
%
|
||||
%xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
%
|
||||
% needs a postscript level 2 interpreter, like gnu ghostscript, to work
|
||||
%
|
||||
% Usage: gs -q -dNODISPLAY ps2ai.ps file.ps > file.aips
|
||||
% or (see below)
|
||||
% gs -q -dNODISPLAY ps2ai.ps file.ps
|
||||
% or
|
||||
% cat ps2ai.ps file.ps | lpr (then look in log file)
|
||||
%
|
||||
% or from within gsview via:
|
||||
% Edit->Convert to vector format
|
||||
%xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
% Options
|
||||
%xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
% Output Options: directly to a file or standard out
|
||||
%
|
||||
/jout false cdef % true=file false=stdout (default=false)
|
||||
/joutput (ps2ai.out.aips) cdef % Name of Output file
|
||||
%
|
||||
%xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
%
|
||||
% Other Options
|
||||
%
|
||||
/jtxt3 true cdef % output text in AI3 form (false=ai88)
|
||||
% for coreldraw/photoshop readable output
|
||||
/joutln false cdef % use font outline instead of font
|
||||
/jerr false def % use error handling (ie die gracefully)
|
||||
/jbiterr false def % attempt to handle bitmap fonts (kludge)
|
||||
/jMacGS false def % true if using MacGS (not fully implemented yet)
|
||||
/jMacfix true def % convert filled boxes to lines (only usefull with
|
||||
% laserwriter 8 postscript input)
|
||||
|
||||
%
|
||||
%xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
% No options below here
|
||||
%xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
%
|
||||
% - Notes -
|
||||
% ai uses cmykcolor, so level 1 interpreters don't work
|
||||
% ai doesn't use image/imagemask - so bitmaps don't work correctly
|
||||
% the output file has a header so it is viewable/printable/reconvertable
|
||||
%
|
||||
% Comments, suggestions, bug-fixes, etc send to:
|
||||
%
|
||||
% Jason Olszewski (olszewsk@splash.princeton.edu)
|
||||
%
|
||||
% anonymous ftp: toby.princeton.edu /pub/olszewsk/ps2ai.ps
|
||||
% URL ftp://toby.princeton.edu/pub/olszewsk
|
||||
%
|
||||
% - Fix History -
|
||||
% 2.14 added cdef to allow overwriting of certain values from externally
|
||||
% 2.13 check for bitmap fonts, work better with TeX,WinPS,etc
|
||||
% 2.12 fixed initclip to US letter size page
|
||||
% 2.11 added header support for *u/*U compound paths
|
||||
% 2.1 option of font outline instead of text(gwhite@trevnx.bio.dfo.ca)
|
||||
% 2.0 major change to complex path handling
|
||||
% 1.9 fixed text leaking ascii (,),\
|
||||
% 1.85 added default font to handle no setfont (Courier)
|
||||
% 1.84 added even-odd fill/clip (D)
|
||||
% 1.83 undefined PPD PageSize printer specific info
|
||||
% 1.82 added kludge to save clipping status through a restore
|
||||
% 1.81 added custom color/gray support to header (x/X, g/G)
|
||||
% 1.8 added newpath if clippath is not consumed correctly(amiga)
|
||||
% 1.79 eliminated scientific notation of numbers less than 0.0001
|
||||
% 1.78 fixed transposed h & H
|
||||
% 1.77 made laserwriter 8 fixes optional
|
||||
% 1.76 added margin fix for unix AI (brown@wi.extrel.com)
|
||||
% 1.75 added kludge to handle bitmap font errors (TeX, Windows.ps)
|
||||
% 1.74 made grestore a little smarter
|
||||
% 1.73 included header handle encoded fontname (/_fontname)
|
||||
% 1.72 fixed problem with restore/clip info - (not enough Qs problem)
|
||||
% 1.71 filter font names to remove previous encoding (|,_,etc)
|
||||
% 1.7 change text format to AI3, works better with PS & CD
|
||||
% 1.67 deal with weird makefonts
|
||||
% 1.66 handle to many bad stroke/fills (s s s w/o paths)
|
||||
% 1.65 more useable with non-gs interpreters (defaultmatrix fix)
|
||||
% 1.64 fixed "smart grestore" repeat bug
|
||||
% 1.63 fixed ashow/awidthshow bug
|
||||
% 1.62 check if cmykcolor is understood otherwise rgb
|
||||
% 1.61 made grestore smarter (only print if different)
|
||||
% 1.6 add better compatibility to CorelDraw and PhotoShop
|
||||
% 1.53 make it more gs-backward compatible (clarke@lsl.co.uk)
|
||||
% 1.52 handle clipping paths a little better (Posted)
|
||||
% 1.51 improve mac lw8 output (lines instead of filled boxes)
|
||||
% 1.5 handle some level 2 stuff (mac lw8)
|
||||
% 1.4 fixed scaling of linewidth and dash
|
||||
% 1.31 made trailer more AI88 friendly
|
||||
% 1.3 add ablity to output to file directly
|
||||
% 1.21 print matrix cleaner
|
||||
% 1.2 fix rotated fonts, thanks to G.Cameron (g.cameron@biomed.abdn.ac.uk)
|
||||
% 1.1 fix stroke/fill color difference (k vs K)
|
||||
% 1.0 posted to comp.lang.postscript
|
||||
%
|
||||
% - To Do List -
|
||||
% find real %%BoundingBox: llx lly urx ury
|
||||
% make MacGS friendly (line-endings)
|
||||
% handle eps w/o showpage:(append to end)
|
||||
% write out image data to external file
|
||||
%
|
||||
%xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
% Nothing of Interest below here
|
||||
%xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
matrix identmatrix setmatrix % make ctm [1 0 0 1 0 0]
|
||||
/bdef {bind def} bind def
|
||||
/oldgsave {} def /oldgrestore {} def
|
||||
/initgraphics {} def /initmatrix {} def
|
||||
% undefine PPD PageSizes to be more printer independant
|
||||
/letter {} def /legal {} def /a4 {} def /b5 {} def /lettersmall {} def
|
||||
/setpagedevice { pop } bdef % for level 2 PPD PageSizes
|
||||
/Courier findfont 12 scalefont setfont % handle no setfont
|
||||
/initclip {0 0 moveto 0 792 lineto 612 792 lineto 612 0 lineto closepath
|
||||
clip newpath } bdef
|
||||
/xdef {exch def} bdef
|
||||
/trx {transform exch} bdef
|
||||
/cbdef {cvx bind def} bdef
|
||||
/jltz {dup abs 0.0001 lt {pop 0} if} bdef % get rid of scientific notation bug
|
||||
/clstate false def % closepath state
|
||||
/dpth false def % destroy path (ie newpath)
|
||||
/fclp false def % first paint after clip
|
||||
/kscl {1.0} def % default current scale X-factor
|
||||
/gcnt {1} def % graphics state counter
|
||||
/spth {1} def % multiple paths on stack
|
||||
/jeol (\n) def % default end-of-line
|
||||
/jnump {0} def % number of paths on stack
|
||||
/jx {0} def /jy {0} def /j_ax {0} def
|
||||
/j3ftxt true def
|
||||
/clarry 10 array def
|
||||
0 1 9 {clarry exch false put} for % initilize no clipping path
|
||||
%
|
||||
% handle cmyk color on level 1 interpreters
|
||||
/setcmykcolor where {pop}
|
||||
{/setcmykcolor {
|
||||
/blk exch def /yel exch def /mag exch def /cyan exch def
|
||||
/ccomp {add dup 1 gt {pop 1} if} def
|
||||
/red {1 cyan blk ccomp sub} def
|
||||
/green {1 mag blk ccomp sub} def
|
||||
/blue {1 yel blk ccomp sub} def
|
||||
red green blue setrgbcolor
|
||||
} bdef
|
||||
} ifelse
|
||||
/currentcmykcolor where {pop}
|
||||
{/currentcmykcolor {
|
||||
currentrgbcolor /bval xdef /gval xdef /rval xdef
|
||||
/rawC 1 rval sub def /rawM 1 gval sub def /rawY 1 bval sub def
|
||||
rawC rawM ge { rawY rawM ge { /blk rawM def} if } if
|
||||
rawC rawY ge { rawM rawY ge { /blk rawY def} if } if
|
||||
rawY rawC ge { rawM rawC ge { /blk rawC def} if } if
|
||||
rawY rawC eq { rawM rawC eq { /blk rawC def} if } if
|
||||
/cyan rawC blk sub def
|
||||
/mag rawM blk sub def
|
||||
/yel rawY blk sub def
|
||||
/blk blk def
|
||||
cyan mag yel blk
|
||||
} bdef
|
||||
} ifelse
|
||||
% If using Mac Ghostscript
|
||||
jMacGS {
|
||||
% /jeol {(\r) jp} def
|
||||
/jout true def
|
||||
(%%Note: Loading ps2ai.ps\n) print
|
||||
} if
|
||||
/jstr 40 string def
|
||||
jout {joutput (w) file /joutput xdef} if
|
||||
%
|
||||
% Output
|
||||
%
|
||||
jout {/jp { joutput exch writestring } bdef }{/jp {print} bdef} ifelse
|
||||
/jpnum {jltz ( ) jp =string cvs jp } bdef
|
||||
/jpmat { (\[) jp { jpnum } forall (\]) jp } bdef
|
||||
%
|
||||
% Stack to Paths converters
|
||||
%
|
||||
/ckpnt { % check which paint and clipping to use
|
||||
dpth { % if there are multiple paths on the stack
|
||||
clarry gcnt get fclp and {clstate {(h W\n) jp }{(H W\n) jp } ifelse} if
|
||||
spth 0 eq {clstate {(n\n) jp }{(N\n) jp } ifelse} if
|
||||
spth 1 eq {clstate {(s\n) jp }{(S\n) jp } ifelse} if
|
||||
spth 2 eq {clstate {(f\n) jp }{(F\n) jp } ifelse} if
|
||||
} if
|
||||
} bdef
|
||||
/jpm {
|
||||
ckpnt
|
||||
/dpth true def
|
||||
transform 2 copy /yst xdef /xst xdef exch jpnum jpnum ( m\n) jp } bdef
|
||||
/jpl { trx jpnum jpnum ( l\n) jp } bdef
|
||||
/jpc { 6 4 roll trx jpnum jpnum 4 2 roll trx jpnum jpnum trx
|
||||
jpnum jpnum ( c\n) jp } bdef
|
||||
/jpp {xst jpnum yst jpnum ( l\n) jp /clstate true def} bdef
|
||||
/cntpaths { % count paths on stack
|
||||
oldgsave
|
||||
{pop pop /jnump jnump 1 add def} {pop pop} {6 {pop} repeat}{} pathforall
|
||||
oldgrestore
|
||||
} bdef
|
||||
/ppforall {
|
||||
cntpaths % find out how many paths are on the stack
|
||||
jnump 1 gt { (*u\n) jp } if
|
||||
{jpm}{jpl}{jpc}{jpp} pathforall
|
||||
ckpnt
|
||||
jnump 1 gt { (*U\n) jp } if
|
||||
/jnump 0 def /clstate false def /dpth false def /fclp false def
|
||||
oldnewpath
|
||||
} bdef
|
||||
%
|
||||
% Painting Operators
|
||||
%
|
||||
/oldnewpath [/newpath load] cbdef
|
||||
/newpath { (\n) jp /spth 0 def ppforall} bdef
|
||||
/stroke { (\n) jp /spth 1 def ppforall } bdef
|
||||
/fill {(\n) jp /spth 2 def ppforall } bdef
|
||||
/eofill {(1 D\n) jp fill (0 D\n) jp} bdef
|
||||
/clip {clarry gcnt get {(Q\nq\n) jp}{(q\n) jp} ifelse
|
||||
/fclp true def clarry gcnt true put} bdef
|
||||
/eoclip {(1 D\n) jp clip (0 D\n) jp} bdef
|
||||
%
|
||||
% Text Operators
|
||||
%
|
||||
/oldshow [/show load] cbdef
|
||||
/curpt {stringwidth pop jx add jy} bdef
|
||||
/jNN {dup 0 eq {pop oldgsave currentfont /FontMatrix get setmatrix kscl
|
||||
oldgrestore} if
|
||||
} bdef
|
||||
/curftmatrix {
|
||||
currentfont /FontMatrix get dup 0 get jNN abs /norm exch def
|
||||
dup 0 get norm div exch dup
|
||||
1 get norm div exch dup 2 get norm div exch dup 3 get norm div exch dup
|
||||
4 get exch 5 get 6 array astore matrix currentmatrix matrix concatmatrix
|
||||
} bdef
|
||||
% AI does not support negitive font sizes
|
||||
/curftsize {currentfont /FontMatrix get 0 get jNN abs 1000 mul} bdef
|
||||
/hstr (X) def
|
||||
/vbar (|) 0 get def /undsc (_) 0 get def
|
||||
/ftnamefix { % handle font names with |,_ (previously encoded)
|
||||
jstr cvs
|
||||
{ %forall
|
||||
dup vbar eq {pop}{ %ifelse
|
||||
dup undsc eq {pop}{ %ifelse
|
||||
hstr exch 0 exch put hstr jp
|
||||
} ifelse
|
||||
} ifelse
|
||||
} forall flush
|
||||
} bdef
|
||||
%/curftname {currentfont /FontName get ftnamefix} bdef
|
||||
/curftname { currentfont /FontName known {currentfont /FontName get}
|
||||
{ (Times-Roman)} ifelse ftnamefix } bdef
|
||||
/lftpar (\() 0 get def
|
||||
/rhtpar (\)) 0 get def
|
||||
/bckslsh (\\) 0 get def
|
||||
/handft { % handle strings with (,),\
|
||||
(\() jp
|
||||
{ %forall
|
||||
dup lftpar eq { (\\\() jp }{ %ifelse
|
||||
dup rhtpar eq { (\\\)) jp }{ %ifelse
|
||||
dup bckslsh eq { (\\\\) jp }{ %ifelse
|
||||
hstr exch 0 exch put hstr jp
|
||||
} ifelse
|
||||
} ifelse
|
||||
} ifelse
|
||||
} forall (\)) jp flush
|
||||
} bdef
|
||||
% AI 3 text format pieces
|
||||
jtxt3 {
|
||||
/j3txt { j3ftxt {(0 Ts 100 Tz 0 Tt 0 TA 0 0 5 TC 100 100 200 TW 0 0 0 Ti\n) jp
|
||||
(0 Ta 0 Tq 0 0 TI 0 Tc 0 Tw\n) jp} if } bdef
|
||||
/show {oldgsave (0 To\n) jp
|
||||
currentpoint 2 copy /jy exch def /jx exch def translate
|
||||
curftmatrix /jitm exch def
|
||||
0 1 5 {jitm exch get jpnum} for ( 0 Tp\n) jp (TP\n) jp
|
||||
(0 Tr\n) jp (\/_) jp curftname curftsize jpnum ( Tf\n) jp
|
||||
(0) jp j_ax curftsize div 100 mul jpnum ( 100 TC\n) jp % percent(?)
|
||||
dup curpt moveto mark exch handft ( Tx\n) jp (TO\n) jp /j3ftxt false def
|
||||
cleartomark currentpoint oldgrestore moveto
|
||||
} bdef
|
||||
/ashow {exch pop exch /j_ax exch def show /j_ax {0} def } bdef
|
||||
}
|
||||
{
|
||||
/show {oldgsave (u\n) jp currentpoint 2 copy /jy exch def /jx exch def translate
|
||||
(\/) jp curftname jstr cvs jp
|
||||
curftsize dup jpnum jpnum ( 0 0 z\n) jp
|
||||
curftmatrix jpmat ( e\n) jp
|
||||
dup curpt moveto mark exch handft ( t T U\n) jp
|
||||
cleartomark currentpoint oldgrestore moveto} bdef
|
||||
/ashow {oldgsave (u\n) jp currentpoint translate (\/) jp curftname jstr cvs jp
|
||||
curftsize dup jpnum jpnum exch kscl mul jpnum ( 0 z\n) jp
|
||||
curftmatrix jpmat ( e\n) jp dup curpt moveto mark exch handft
|
||||
( t T U\n) jp cleartomark currentpoint oldgrestore moveto} bdef
|
||||
} ifelse
|
||||
/widthshow { show pop pop pop} bdef
|
||||
/awidthshow {ashow pop pop pop} bdef
|
||||
/kshow {show pop} bdef
|
||||
%/show {true charpath fill} bdef % get outline of charactor
|
||||
joutln {/show { true charpath currentpoint
|
||||
/jy exch def /jx exch def fill jx jy moveto} bdef} if
|
||||
%/show {oldshow} bdef % do nothing different
|
||||
%
|
||||
% Color Operators
|
||||
%
|
||||
/oldsetcmykcolor [/setcmykcolor load] cbdef
|
||||
/setcmykcolor {oldsetcmykcolor
|
||||
currentcmykcolor 4 -1 roll jpnum 3 -1 roll jpnum 2 -1 roll jpnum jpnum ( k\n) jp
|
||||
currentcmykcolor 4 -1 roll jpnum 3 -1 roll jpnum 2 -1 roll jpnum jpnum ( K\n) jp
|
||||
} bdef
|
||||
/oldsetgray [/setgray load] cbdef
|
||||
/setgray {0 0 0 4 -1 roll 1 exch sub setcmykcolor} bdef
|
||||
/oldsethsbcolor [/sethsbcolor load] cbdef
|
||||
/sethsbcolor {oldsethsbcolor currentcmykcolor setcmykcolor} bdef
|
||||
/oldsetrgbcolor [/setrgbcolor load] cbdef
|
||||
/setrgbcolor {oldsetrgbcolor currentrgbcolor /bval xdef /gval xdef /rval xdef
|
||||
/rawC 1 rval sub def /rawM 1 gval sub def /rawY 1 bval sub def
|
||||
rawC rawM ge { rawY rawM ge { /blk rawM def} if } if
|
||||
rawC rawY ge { rawM rawY ge { /blk rawY def} if } if
|
||||
rawY rawC ge { rawM rawC ge { /blk rawC def} if } if
|
||||
rawY rawC eq { rawM rawC eq { /blk rawC def} if } if
|
||||
/cyan rawC blk sub def
|
||||
/mag rawM blk sub def
|
||||
/yel rawY blk sub def
|
||||
/blk blk def
|
||||
cyan mag yel blk setcmykcolor } bdef
|
||||
%
|
||||
% State Operators
|
||||
%
|
||||
/oldsetlinewidth [/setlinewidth load] cbdef
|
||||
/setlinewidth {kscl abs mul jltz oldsetlinewidth
|
||||
currentlinewidth jpnum ( w\n) jp } bdef
|
||||
/oldsetlinecap [/setlinecap load] cbdef
|
||||
/setlinecap {dup oldsetlinecap jpnum ( J\n) jp} bdef
|
||||
/oldsetlinejoin [/setlinejoin load] cbdef
|
||||
/setlinejoin {dup oldsetlinejoin jpnum ( j\n) jp} bdef
|
||||
/oldsetmiterlimit [/setmiterlimit load] cbdef
|
||||
/setmiterlimit {dup oldsetmiterlimit jpnum ( M\n) jp}bdef
|
||||
/oldsetdash [/setdash load] cbdef
|
||||
/setdash {exch [ exch {kscl abs mul} forall ] exch kscl abs mul oldsetdash
|
||||
currentdash exch jpmat jpnum ( d\n) jp } bdef
|
||||
/oldsetflat [/setflat load] cbdef
|
||||
/setflat {dup oldsetflat jpnum ( i\n) jp } bdef
|
||||
%
|
||||
% More State Operators
|
||||
%
|
||||
/kscl { % use just the x scale factor
|
||||
oldgsave
|
||||
matrix currentmatrix /jctm exch def
|
||||
jctm 4 0 put jctm 5 0 put jctm setmatrix
|
||||
1 0 moveto currentpoint transform
|
||||
dup mul exch dup mul add sqrt 10000 mul round 10000 div
|
||||
oldgrestore
|
||||
} bdef
|
||||
/currentstate {currentcmykcolor setcmykcolor
|
||||
currentflat jpnum ( i) jp currentlinecap jpnum ( J) jp
|
||||
currentlinejoin jpnum ( j) jp currentlinewidth jpnum ( w) jp
|
||||
currentmiterlimit jpnum ( M ) jp currentdash exch jpmat jpnum ( d\n) jp
|
||||
} bdef
|
||||
/jdifG {
|
||||
currentcmykcolor /jok xdef /joy xdef /jom xdef /joc xdef
|
||||
currentflat /jof xdef currentlinecap /jolc xdef currentlinejoin /jolj xdef
|
||||
currentlinewidth /jolw xdef currentmiterlimit /joml xdef
|
||||
currentdash /jood xdef /joad xdef
|
||||
oldgrestore
|
||||
currentcmykcolor /jnk xdef /jny xdef /jnm xdef /jnc xdef
|
||||
currentflat /jnf xdef currentlinecap /jnlc xdef currentlinejoin /jnlj xdef
|
||||
currentlinewidth /jnlw xdef currentmiterlimit /jnml xdef
|
||||
currentdash /jnod xdef /jnad xdef
|
||||
% compare old gstate to new gstate
|
||||
joc jnc ne jom jnm ne joy jny ne jok jnk ne
|
||||
jof jnf ne jolc jnlc ne jolj jnlj ne jolw jnlw ne joml jnml ne
|
||||
false joad {true exit} forall {pop pop true}{false} ifelse
|
||||
false jnad {true exit} forall {pop pop true}{false} ifelse ne
|
||||
jood jnod ne 10 {or} repeat {currentstate} if
|
||||
} bdef
|
||||
/oldgsave [/gsave load] cbdef
|
||||
/gsave {oldgsave /gcnt gcnt 1 add def } bdef % clarry gcnt false put} bdef
|
||||
% (%%Note:gsave ) jp gcnt jpnum (\n) jp} bdef
|
||||
/oldgrestore [/grestore load] cbdef
|
||||
/grestore {dpth {newpath} if clarry gcnt get {(Q\n) jp clarry gcnt false put} if
|
||||
jdifG /gcnt gcnt 1 sub def } bdef
|
||||
% oldgrestore currentstate } bdef
|
||||
% (%%Note:grestore ) jp gcnt 1 add jpnum (\n) jp} bdef
|
||||
/oldrestore [/restore load] cbdef
|
||||
% a kludgy way of saving the clipping path status information
|
||||
/restore {clarry aload pop 11 -1 roll oldrestore clarry astore pop} bdef
|
||||
/showpage { 0 1 9 {clarry exch get {(Q\n) jp} if } for
|
||||
(%%Note: If Error, make sure there are matched pairs of 'q's and 'Q's\n) jp
|
||||
(%%Note: in the file. Add 'Q's before '%%Trailer' until equal\n) jp
|
||||
(%%Trailer\n) jp
|
||||
jtxt3 {(Adobe_IllustratorA_AI3 /terminate get exec\n) jp
|
||||
(Adobe_typography_AI3 /terminate get exec\n) jp
|
||||
(Adobe_customcolor /terminate get exec\n) jp
|
||||
(Adobe_cshow /terminate get exec\n) jp
|
||||
(Adobe_cmykcolor /terminate get exec\n) jp
|
||||
(Adobe_packedarray /terminate get exec\n) jp
|
||||
}{
|
||||
(Adobe_Illustrator881 /terminate get exec\n) jp
|
||||
(Adobe_customcolor /terminate get exec\n) jp
|
||||
(Adobe_cshow /terminate get exec\n) jp
|
||||
(Adobe_cmykcolor /terminate get exec\n) jp
|
||||
(Adobe_packedarray /terminate get exec\n) jp
|
||||
} ifelse
|
||||
( showpage\n%EOF\n%%EndDocument\n) jp
|
||||
jout {joutput closefile} if jMacGS not {quit} if /j3ftxt true def } bdef
|
||||
%
|
||||
% Error handling
|
||||
%
|
||||
errordict begin
|
||||
% Attempt to handle the error caused by bitmap fonts (TeX,Windows.ps,etc)
|
||||
% this is a big-time kludge
|
||||
jbiterr {
|
||||
/undefined {pop pop (Times-Roman)} bdef
|
||||
/typecheck {pop pop} bdef
|
||||
} if
|
||||
jerr {
|
||||
/handleerror {
|
||||
(%%Note: ps2ai error, aborting rest of conversion\n) jp showpage
|
||||
} bdef
|
||||
} if
|
||||
end
|
||||
%
|
||||
% Mac LW 8 improvements
|
||||
%
|
||||
/jmacimp { % stroked line instead of thin filled boxes
|
||||
/@a { 3 -1 roll 2 div dup 3 -1 roll add exch 3 -1 roll add exch moveto
|
||||
3 -1 roll 2 div dup 3 -1 roll add exch 3 -1 roll exch sub exch lineto
|
||||
abs setlinewidth stroke pop pop} bdef
|
||||
/@b { 3 -1 roll 2 div dup 3 -1 roll add exch 3 -1 roll add exch moveto
|
||||
pop
|
||||
3 -1 roll 2 div dup 3 -1 roll add exch 3 -1 roll add exch lineto
|
||||
abs setlinewidth stroke} bdef
|
||||
/endp {showpage pm restore} bdef % because the restore stops clean up
|
||||
} bdef
|
||||
%
|
||||
% Handle (some) PS Level 2
|
||||
%
|
||||
/rectstroke { 4 2 roll moveto 1 index 0 rlineto 0 exch rlineto neg 0 rlineto
|
||||
closepath stroke} bdef
|
||||
/rectfill { 4 2 roll moveto 1 index 0 rlineto 0 exch rlineto neg 0 rlineto
|
||||
fill } bdef
|
||||
/rectclip { 4 2 roll moveto 1 index 0 rlineto 0 exch rlineto neg 0 rlineto
|
||||
closepath clip newpath jMacfix {jmacimp} if } bdef
|
||||
%
|
||||
% Add a header prolog to the output file so it is still view/print-able
|
||||
%
|
||||
(%!PS-Adobe-2.0 EPSF-1.2\n%%BoundingBox: 0 0 612 792\n) jp
|
||||
(%%Title: Adobe Illustator 3 Editable Document\n) jp
|
||||
(%%Creator: ps2ai.ps vers.) jp vers jpnum ( \(C\) 1993-94 Jason Olszewski\n) jp
|
||||
(%%TemplateBox: 0 0 612 792\n) jp
|
||||
jtxt3 {(%%AI3_Margin:0 0 0 0\n) jp } if
|
||||
(%%EndComments\n) jp
|
||||
(%%BeginProlog\n) jp
|
||||
(/m {moveto} def /l {lineto} def /c {curveto} def\n) jp
|
||||
(/S {stroke} def /F {fill} def\n) jp
|
||||
(/s {closepath S} def /f {closepath F} def\n) jp
|
||||
(/q {gsave} def /Q {grestore} def /W {clip} def /k {setcmykcolor} def\n) jp
|
||||
(/i {setflat} def /J {setlinecap} def /j {setlinejoin} def\n) jp
|
||||
(/w {setlinewidth} def /M {setmiterlimit} def /d {setdash} def\n) jp
|
||||
(/u {gsave} def /U {grestore} def /K {k} def\n) jp
|
||||
(/N {newpath} def /n {closepath N} def\n) jp
|
||||
(/g {setgray} def /G {g} def\n) jp
|
||||
(/x {pop pop k} def /X {x} def\n) jp
|
||||
(/H {} def /h {H closepath} def /D {pop} def\n) jp
|
||||
(/*u { /N {/spth 0 def}def /S{/spth 1 def}def /F {/spth 2 def} def} def\n) jp
|
||||
(/*U { spth 0 eq {newpath} if spth 1 eq {stroke} if spth 2 eq {fill} if\n) jp
|
||||
( /N {newpath} def /S {stroke} def /F {fill} def } def\n) jp
|
||||
%(\n) jp
|
||||
jtxt3 {
|
||||
(/TC {pop pop pop} def /Tr {pop} def\n) jp
|
||||
(/To {pop gsave} def /TO {grestore} def\n) jp
|
||||
(/Tp {pop matrix astore concat} def /TP {0 0 moveto} def\n) jp
|
||||
(/a_str 40 string def /cnt 0 def /h_str (X) def /undsc (_) 0 get def\n) jp
|
||||
(/fntfix {a_str cvs dup length 1 sub /f_str exch string def\n) jp
|
||||
( {dup undsc eq {pop}{f_str cnt 3 -1 roll put /cnt cnt 1 add def\n) jp
|
||||
( } ifelse } forall flush /cnt 0 def f_str cvn } bind def\n) jp
|
||||
|
||||
(/Tf {exch fntfix findfont exch scalefont setfont} def /Tx {show} def\n) jp
|
||||
}{
|
||||
(/z {pop pop pop exch findfont exch scalefont setfont} def\n) jp
|
||||
(/e {concat 0 0 m} def /t {show} def /T {} def\n) jp
|
||||
} ifelse
|
||||
(\n) jp
|
||||
jtxt3 {
|
||||
(userdict /Adobe_packedarray 2 dict dup begin put\n) jp
|
||||
(/initialize {} def /terminate {} def\n) jp
|
||||
(userdict /Adobe_cmykcolor 2 dict dup begin put\n) jp
|
||||
(/initialize {} def /terminate {} def\n) jp
|
||||
(userdict /Adobe_cshow 2 dict dup begin put\n) jp
|
||||
(/initialize {} def /terminate {} def\n) jp
|
||||
(userdict /Adobe_customcolor 2 dict dup begin put\n) jp
|
||||
(/initialize {} def /terminate {} def\n) jp
|
||||
(userdict /Adobe_typography_AI3 2 dict dup begin put\n) jp
|
||||
(/initialize {} def /terminate {} def\n) jp
|
||||
(userdict /Adobe_IllustratorA_AI3 2 dict dup begin put\n) jp
|
||||
(/initialize {} def /terminate {} def\n) jp
|
||||
}{
|
||||
(userdict /Adobe_packedarray 2 dict dup begin put\n) jp
|
||||
(/initialize {} def /terminate {} def\n) jp
|
||||
(userdict /Adobe_cmykcolor 2 dict dup begin put\n) jp
|
||||
(/initialize {} def /terminate {} def\n) jp
|
||||
(userdict /Adobe_cshow 2 dict dup begin put\n) jp
|
||||
(/initialize {} def /terminate {} def\n) jp
|
||||
(userdict /Adobe_customcolor 2 dict dup begin put\n) jp
|
||||
(/initialize {} def /terminate {} def\n) jp
|
||||
(userdict /Adobe_Illustrator881 2 dict dup begin put\n) jp
|
||||
(/initialize {} def /terminate {} def\n) jp
|
||||
} ifelse
|
||||
(%%EndProlog\n) jp
|
||||
(%%BeginSetup\n) jp
|
||||
jtxt3 {
|
||||
(Adobe_packedarray /initialize get exec\n) jp
|
||||
(Adobe_cmykcolor /initialize get exec\n) jp
|
||||
(Adobe_cshow /initialize get exec\n) jp
|
||||
(Adobe_customcolor /initialize get exec\n) jp
|
||||
(Adobe_typography_AI3 /initialize get exec\n) jp
|
||||
(Adobe_IllustratorA_AI3 /initialize get exec\n) jp
|
||||
}{
|
||||
(Adobe_packedarray /initialize get exec\n) jp
|
||||
(Adobe_cmykcolor /initialize get exec\n) jp
|
||||
(Adobe_cshow /initialize get exec\n) jp
|
||||
(Adobe_customcolor /initialize get exec\n) jp
|
||||
(Adobe_Illustrator881 /initialize get exec\n) jp
|
||||
} ifelse
|
||||
(%%EndSetup\n) jp
|
||||
0 0 0 1 oldsetcmykcolor
|
||||
currentstate
|
||||
|
||||
jout {(%%Note: Load Postscript file to be converted now\n) print} if
|
||||
172
dist/conf/ghostscript/lib/ps2epsi.ps
vendored
172
dist/conf/ghostscript/lib/ps2epsi.ps
vendored
@@ -1,172 +0,0 @@
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% 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.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
|
||||
% Convert a PostScript file to an EPSI file, adding the Preview Image.
|
||||
|
||||
% If the file is already EPSF, then skip the creation of an EPSF, and
|
||||
% only add the preview. A warning is issued if the %%Pages: comment
|
||||
% indicates that there is more than a single page in the input file.
|
||||
|
||||
% Expected invocation:
|
||||
% gs -q -dNOOUTERSAVE -dNODISPLAY -dLastPage=1 -sOutputFile=out.epsi --permit-file-read=in.ps --permit-devices=eps2write;bit -- ps2epsi.ps in.ps
|
||||
|
||||
% Usually this will be invoked by the ps2epsi script (or .bat or .cmd versions)
|
||||
|
||||
false % no errors from initial param check
|
||||
% NOOUTERSAVE is needed for the SAVE to not remove the tempfile (if one was needed)
|
||||
vmstatus pop pop 0 gt { (Error: missing -dNOOUTERSAVE option) = pop true } if
|
||||
% NODISPLAY may not be strictly needed, but we don't want to open the default device
|
||||
/NODISPLAY where { pop } { (Error: missing -dNODISPLAY option) = pop true } ifelse
|
||||
% LastPage is needed if we are using eps2write on a PostScript (or PDF) file that has multiple pages.
|
||||
/LastPage where { pop } { (Error: missing -dLastPage option) = pop true } ifelse
|
||||
% OutputFile is needed so that it gets on the permit-file-writing list
|
||||
/OutputFile where { pop } { (Error: missing -sOutputFile option) = pop true } ifelse
|
||||
|
||||
.shellarguments not count 3 lt or count -1 roll or
|
||||
{
|
||||
(usage: gs -q -dNOOUTERSAVE -dNODISPLAY -dLastPage=1 -sOutputFile=out.epsi --permit-file-read=in.eps -- ps2epsi.ps in.ps) =
|
||||
quit
|
||||
} {
|
||||
dup /InputFile exch def
|
||||
(r) file /I exch def
|
||||
} ifelse
|
||||
|
||||
/O OutputFile (w) file def
|
||||
|
||||
/S 65535 string def
|
||||
|
||||
/R { I S readline not { (Error: Unexpected end of file.) = quit } if } bind def
|
||||
/WL { O exch writestring O (\n) writestring } bind def % Write with linefeed
|
||||
/TName null def
|
||||
|
||||
/EPSFheader (%!PS-Adobe-3.0 EPSF-3.0) def
|
||||
% Read the header to check if this file was EPSF
|
||||
R
|
||||
dup EPSFheader ne {
|
||||
% InputFile was not EPSF
|
||||
pop % discard the first line of the InputFile
|
||||
% run the file through eps2write (into a tempfile) to make an EPSF
|
||||
(_ps2epsi) (w+) .tempfile closefile /TName exch def
|
||||
/SAVE save def
|
||||
<< /OutputDevice /eps2write /OutputFile TName >> setpagedevice
|
||||
InputFile run
|
||||
SAVE restore
|
||||
/I TName (r) file def
|
||||
R
|
||||
} if
|
||||
WL % Write the first line (either from InputFile or the tempfile
|
||||
|
||||
% From the "5002 Encapsulated PostScript File Format Specification Version 3.0 1 May 1992"
|
||||
% The preview section must appear after the header comment section, but
|
||||
% before the document prologue definitions. That is, it should immediately
|
||||
% follow the %%EndComments: line in the EPS file.
|
||||
{ % loop until we see the %%EndComments line, writing those lines to output
|
||||
R
|
||||
dup (%%EndComments) anchorsearch exch pop { % discard the match or extra copy of the string
|
||||
pop exit % found it
|
||||
} if
|
||||
% Check the %%Pages: comment to issue a warning if there is more than one page.
|
||||
dup (%%Pages:) anchorsearch exch pop { % discard the match or extra copy of the string
|
||||
cvi 1 gt {
|
||||
(Warning: EPSI files can only have 1 page, Only the first page will be in the preview.) =
|
||||
} if
|
||||
} if
|
||||
% Collect the BoundingBox data that will be used when generating the preview
|
||||
dup (%%BoundingBox:) anchorsearch exch pop { % discard the match or extra copy of the string
|
||||
mark
|
||||
exch token not { (Error: invalid BoundingBox parameters) = quit } if
|
||||
exch token not { (Error: invalid BoundingBox parameters) = quit } if
|
||||
exch token not { (Error: invalid BoundingBox parameters) = quit } if
|
||||
exch token not { (Error: invalid BoundingBox parameters) = quit } if
|
||||
exch pop ]
|
||||
/BBox exch def
|
||||
% Preview dimensions
|
||||
/PWidth BBox dup 2 get exch 0 get sub def
|
||||
/PHeight BBox dup 3 get exch 1 get sub def
|
||||
} if
|
||||
WL % send to output file with linefeed.
|
||||
} loop
|
||||
|
||||
WL % send to output file with linefeed.
|
||||
|
||||
% If the InputFile already has a preview, skip past it
|
||||
R
|
||||
dup (%%BeginPreview) anchorsearch exch pop { % discard the match or extra copy of the string
|
||||
pop
|
||||
% Read lines until after the %%EndPreview
|
||||
{
|
||||
R
|
||||
(%%EndPreview) anchorsearch exch pop { % discard the match or extra copy of the string
|
||||
pop pop exit % found it
|
||||
} if
|
||||
} loop
|
||||
% Get the next line for use after the generated preview
|
||||
R
|
||||
}
|
||||
if
|
||||
/LineAfterEndComments exch def
|
||||
|
||||
//null (w+) .tempfile
|
||||
closefile % will be opened by bit device
|
||||
/Pname exch def
|
||||
|
||||
<<
|
||||
/OutputDevice /bit
|
||||
/GrayValues 256 % Gray, not monochrome
|
||||
/OutputFile Pname
|
||||
/TextAlphaBits 4
|
||||
/GraphicsAlphaBits 4
|
||||
/LastPage 1 % TBD: does this work?
|
||||
/.IgnoreNumCopies true
|
||||
/Install { BBox 0 get neg BBox 1 get neg translate { 1.0 exch sub } settransfer } % EPSI 00 is white
|
||||
/HWResolution [ 72. 72. ]
|
||||
/PageSize [ PWidth PHeight ]
|
||||
>> setpagedevice
|
||||
|
||||
InputFile run
|
||||
|
||||
/P Pname (r) file def % Preview data file
|
||||
/SP PWidth string def % One string per image line
|
||||
|
||||
% Write the preview
|
||||
O (%%BeginPreview: ) writestring
|
||||
O PWidth write==only O ( ) writestring
|
||||
O PHeight write==only O ( 8 ) writestring
|
||||
O PHeight PWidth 39 add 40 idiv mul write== % 40 bytes per line
|
||||
O flushfile
|
||||
0 1 PHeight 1 sub {
|
||||
pop
|
||||
P SP readstring pop
|
||||
0 40 PWidth {
|
||||
O (% ) writestring % 82 bytes on each line, plus EOL
|
||||
SP exch 40 PWidth 2 index sub .min getinterval
|
||||
O exch writehexstring
|
||||
O (\n) writestring
|
||||
} for
|
||||
pop
|
||||
} for
|
||||
(%%EndPreview) WL
|
||||
|
||||
% Write the line that followed the %%EndComments
|
||||
LineAfterEndComments WL
|
||||
|
||||
% Copy the remainder of the inputfile
|
||||
{
|
||||
I S readstring exch O exch writestring not { exit } if
|
||||
} loop
|
||||
|
||||
% If we created a tempfile, delete it
|
||||
TName null ne { TName deletefile } if
|
||||
|
||||
quit
|
||||
383
dist/conf/ghostscript/lib/rollconv.ps
vendored
383
dist/conf/ghostscript/lib/rollconv.ps
vendored
@@ -1,383 +0,0 @@
|
||||
%!
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% 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.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Utility program for converting Japanese fonts produced by Macromedia's
|
||||
% Rollup program to Type 0 fonts suitable for use with Ghostscript.
|
||||
%
|
||||
% Rollup produces the following files, where xxx is the font name:
|
||||
% xxx-H, xxx-SA, xxx-SB, xxx-SK, xxx-SR, xxx-UG
|
||||
% JIS83-1_COD
|
||||
% JIS83-1_CSA
|
||||
% The _COD and _CSA files are large files containing the actual
|
||||
% character outline data; they may theoretically be shared between
|
||||
% multiple fonts.
|
||||
%
|
||||
% rollconv.ps converts the above to files named:
|
||||
% fff.ps
|
||||
% fff.COD
|
||||
% fff.CSA
|
||||
% fff.CSR
|
||||
% where fff is a font file name provided by the user at conversion time.
|
||||
% The fff.ps file is the actual font file to be loaded with `run'
|
||||
% or placed in a Fontmap or a directory named by [GS_]FONTPATH;
|
||||
% the other two files must be present at runtime in a directory that is
|
||||
% on Ghostscript's search path (-I, GS_LIB, GS_LIB_DEFAULT).
|
||||
%
|
||||
% The normal way to invoke this program is
|
||||
% gsnd -- rollconv.ps xxx fff InDir CDir OutDir
|
||||
% (assuming that gsnd is an alias for gs -dNODISPLAY), where:
|
||||
% xxx is the font name;
|
||||
% fff is the base part of the output file name;
|
||||
% InDir is the name of the directory containing the xxx-* input files;
|
||||
% CDir is the name of the directory containing the _COD and _CSA
|
||||
% input files (typically the same as InDir);
|
||||
% OutDir is the name of the directory where the output should be written
|
||||
% (OutDir must already exist).
|
||||
% For example:
|
||||
% gsnd -- rollconv.ps HGGothicBPRO gothic /gs/k/rufonts/Gothic \
|
||||
% /gs/k/rufonts/Gothic /gs/k/gsfonts
|
||||
% To suppress output messages, you may insert -q:
|
||||
% gsnd -q -- rollconv.ps ...
|
||||
%
|
||||
% This program assumes that the files have been FTP'ed from a Macintosh and
|
||||
% therefore have 128 bytes of garbage at the beginning. If you have
|
||||
% transferred them in some manner that avoids this, change true to false
|
||||
% in the following line.
|
||||
/fromMac true def
|
||||
% The FontName of the converted font is xxx-83pv-RKSJ-H. In order to
|
||||
% use a converted font with Ghostscript, you may either load it explicitly
|
||||
% at run time, e.g.,
|
||||
% (gothic.ps) run
|
||||
% or you may add an entry to the Fontmap file, in the form:
|
||||
% /HGGothicBPRO-83pv-RKSJ-H (gothic.ps) ;
|
||||
% which will allow the font to be loaded automatically. After
|
||||
% loading the font, by either method, you can select it in the usual way:
|
||||
% /HGGothicBPRO-83pv-RKSJ-H findfont 36 scalefont setfont
|
||||
% or
|
||||
% /HGGothicBPRO-83pv-RKSJ-H 36 selectfont
|
||||
|
||||
/macrfile % <filename> macrfile <file>
|
||||
{ (r) file
|
||||
fromMac
|
||||
{ % Get rid of the initial Mac garbage (128 characters).
|
||||
% The garbage at the end is unpredictable,
|
||||
% so we'll just have to hope that it's all nulls.
|
||||
dup =string 0 128 getinterval readstring pop pop
|
||||
}
|
||||
if
|
||||
} bind def
|
||||
|
||||
/convert % <FName> <OutBase> <InDir> <CDir> <OutDir> convert -
|
||||
{ /OutDir exch def
|
||||
/CDir exch def
|
||||
/InDir exch def
|
||||
/OutBase exch def
|
||||
/FName exch def
|
||||
|
||||
/inprefix InDir (/) concatstrings FName concatstrings (-) concatstrings def
|
||||
/inh inprefix (H) concatstrings def
|
||||
|
||||
% Open the output file.
|
||||
|
||||
/OutDot OutDir (/) concatstrings OutBase concatstrings (.) concatstrings def
|
||||
/outname OutDot (ps) concatstrings def
|
||||
QUIET not { (Writing ) print outname = flush } if
|
||||
/cdfromstr (\(pgfonts/) FName concatstrings (-JIS83-1_) concatstrings def
|
||||
/cdstr (\() OutBase concatstrings (.) concatstrings def
|
||||
/out outname (w) file def
|
||||
/buffer 65000 string def
|
||||
|
||||
% Copy the initial comments from the input file.
|
||||
|
||||
inh macrfile
|
||||
{ dup =string readline pop
|
||||
out 1 index writestring out (\n) writestring
|
||||
(%%EndComments) eq { exit } if
|
||||
}
|
||||
loop
|
||||
|
||||
% Write out our preamble.
|
||||
|
||||
out (
|
||||
currentpacking true setpacking
|
||||
userdict /AltsysCFD3 known { (%END) .skipeof } if
|
||||
userdict /AltsysCFD3 25 dict dup begin
|
||||
/beint { 0 exch { exch 8 bitshift add } forall } bind def
|
||||
/rfile { findlibfile { exch pop } { (r) file } ifelse } bind def
|
||||
/str 500 string def
|
||||
/AltRO { } def
|
||||
/BuildCh % <font> <ccode> <bias> BuildCh -
|
||||
{ /bias exch def /ccode exch def begin % font
|
||||
ccode dup 255 and dup bias lt exch 252 gt or { pop 127 } if
|
||||
dup -8 bitshift -67 mul add % subfonts have 189 chars, not 256
|
||||
bias sub buildch1
|
||||
} bind def
|
||||
/BuildChr % <font> <ccode> BuildChr -
|
||||
{ /ccode exch def begin % font
|
||||
ccode buildch1
|
||||
} bind def
|
||||
/buildch1
|
||||
{ 6 mul PGOffsets add
|
||||
FileNames 0 get rfile dup dup 4 -1 roll setfileposition
|
||||
(xxxxxx) readstring pop exch closefile
|
||||
dup 1 3 getinterval beint % COD offset
|
||||
exch 4 2 getinterval beint % length
|
||||
dup 0 eq
|
||||
{ pop pop currentdict end
|
||||
1000 0 0 0 1 1 0 -1000 500 1000 setcachedevice2
|
||||
}
|
||||
{ dup str length gt { /str 1 index string store } if
|
||||
FileNames 1 get rfile dup dup % offset length file file file
|
||||
5 -1 roll setfileposition % length file file
|
||||
str 0 5 -1 roll getinterval readstring pop pop closefile
|
||||
currentdict end ccode str 1183615869 internaldict /CCRun get exec
|
||||
}
|
||||
ifelse
|
||||
} bind def
|
||||
/privates 100 dict def
|
||||
/BuildPr % <stdhw> <stdvw> BuildPr <dict>
|
||||
{ 2 copy 1000 mul add privates 1 index known
|
||||
{ privates exch get 3 1 roll pop pop
|
||||
}
|
||||
{ 7 dict begin
|
||||
/MinFeature{16 16}executeonly def
|
||||
/BlueValues BlueValues def
|
||||
/StdVW 3 -1 roll 1 array astore def
|
||||
/StdHW 3 -1 roll 1 array astore def
|
||||
/password 5839 def
|
||||
/LanguageGroup 1 def
|
||||
/Subrs Subrs def
|
||||
currentdict readonly end
|
||||
privates 2 index 2 index put exch pop
|
||||
}
|
||||
ifelse
|
||||
} bind def
|
||||
/FullEncoding
|
||||
systemdict { pop } forall
|
||||
systemdict length 512 sub 1 255 { (x) dup 0 4 -1 roll put cvn } for
|
||||
768 packedarray def
|
||||
/BlueValues[-250 -250 1100 1100]readonly def
|
||||
/BuildChar{AltsysCFD3 begin 64 BuildCh end}bind def
|
||||
/CharStrings 1 dict
|
||||
dup /.notdef (<10>1py<70>8<EFBFBD><38>) noaccess put
|
||||
readonly def
|
||||
/CDevProc
|
||||
{ pop pop pop pop 0 exch -1000 exch 2 div currentfont /FontBBox get 3 get
|
||||
} bind def
|
||||
/FontMatrix[0.001 0.0 0.0 0.001 0.0 0.0]readonly def
|
||||
/Subrs [
|
||||
(<10>1p|=-<2D>D\<EFBFBD>R) noaccess
|
||||
(<10>1py<70><79>Uz) noaccess
|
||||
(<10>1py<70>Ği) noaccess
|
||||
(<10>1p<31>) noaccess
|
||||
(<10>1p|35r<11>I) noaccess
|
||||
] noaccess def
|
||||
end put
|
||||
%END
|
||||
) writestring
|
||||
|
||||
% Locate and copy the definition of NotDefFont.
|
||||
|
||||
out (
|
||||
FontDirectory /NotDefFont known { (%END) .skipeof } if
|
||||
) writestring
|
||||
{ dup =string readline pop
|
||||
dup (/NotDefFont) eq { exit } if pop
|
||||
}
|
||||
loop out exch writestring out (\n) writestring
|
||||
{ dup =string readline pop
|
||||
(definefont) search { pop pop pop exit } if
|
||||
out exch writestring out (\n) writestring
|
||||
}
|
||||
loop out (definefont pop
|
||||
%END
|
||||
) writestring
|
||||
|
||||
% Copy the definitions of the subfonts, moving the
|
||||
% CharStrings of the Roman supplement to an external file.
|
||||
% Stack for pattern procedures: infile line
|
||||
|
||||
/CSRName OutDot (CSR) concatstrings def
|
||||
/csr CSRName (w) file def
|
||||
QUIET not { (Writing ) print CSRName = flush } if
|
||||
|
||||
/encoding 256 array def
|
||||
|
||||
/patterns [
|
||||
% Patterns specific to the Roman supplement, in which
|
||||
% the outlines are in an eexec section.
|
||||
{ (/Encoding 256 array) {
|
||||
pop out (/Encoding ) writestring
|
||||
{ dup buffer readline pop
|
||||
dup (dup) search { exit } if pop pop
|
||||
}
|
||||
loop
|
||||
{ % Stack: infile dupline postdup (dup) predup
|
||||
pop pop exch pop
|
||||
% The top element of the stack is a string beginning with
|
||||
% an index and value to put into the Encoding.
|
||||
token pop exch token pop exch pop encoding 3 1 roll put
|
||||
dup buffer readline pop
|
||||
dup (dup) search not { pop exit } if
|
||||
}
|
||||
loop
|
||||
out encoding cvx write== out ( cvlit ) writestring
|
||||
out exch writestring out (\n) writestring
|
||||
} }
|
||||
{ (/FontType 1 def) {
|
||||
pop out (/FontType 4 def\n) writestring
|
||||
out (/BuildChar{AltsysCFD3 begin BuildChr end}bind def\n) writestring
|
||||
out (/FileNames[) writestring
|
||||
2 { out OutBase (.CSR) concatstrings write==only } repeat
|
||||
out (]def\n) writestring
|
||||
} }
|
||||
{ (currentfile eexec) {
|
||||
pop out (systemdict begin\n) writestring
|
||||
dup //.eexec_param_dict /eexecDecode filter
|
||||
} }
|
||||
{ (dup/CharStrings ) {
|
||||
% Copy the individual CharStrings to the CSR file,
|
||||
% recording the lengths and offsets.
|
||||
pop out (dup/CharStrings AltsysCFD3 /CharStrings get put\n) writestring
|
||||
/offsets 256 dict def
|
||||
{ dup token pop % char name
|
||||
dup dup type /nametype eq exch xcheck not and not { pop exit } if
|
||||
1 index token pop % length of binary data
|
||||
2 index token pop pop % skip RD
|
||||
2 index buffer 0 3 index getinterval readstring pop % charstring
|
||||
offsets 3 index csr fileposition 16 bitshift 4 index add put
|
||||
csr exch writestring pop pop
|
||||
dup buffer readline pop pop % skip ND
|
||||
}
|
||||
loop
|
||||
% We skipped the 'end'; skip the 'readonly put' as well.
|
||||
2 { dup token pop pop } repeat
|
||||
out (dup/PGOffsets ) writestring
|
||||
out csr fileposition write=only
|
||||
out ( put\n) writestring
|
||||
encoding
|
||||
{ offsets exch .knownget not { 0 } if
|
||||
2 { csr 0 write } repeat
|
||||
4 { dup -24 bitshift csr exch write 8 bitshift } repeat pop
|
||||
}
|
||||
forall
|
||||
} }
|
||||
{ (/OtherSubrs[) {
|
||||
pop
|
||||
{ dup buffer readline pop
|
||||
(]noaccess def) search { pop pop pop exit } if pop
|
||||
}
|
||||
loop
|
||||
} }
|
||||
{ (/Subrs 5 array) {
|
||||
pop out (/Subrs AltsysCFD3 /Subrs get def\n) writestring
|
||||
6 { dup buffer readline pop pop } repeat
|
||||
} }
|
||||
{ (currentfile closefile) {
|
||||
pop out (end % systemdict\n) writestring
|
||||
closefile
|
||||
} }
|
||||
% Patterns for other supplements.
|
||||
{ (pgfonts/) {
|
||||
{ cdfromstr search not { exit } if
|
||||
out exch writestring pop out cdstr writestring
|
||||
}
|
||||
loop out exch writestring out (\n) writestring
|
||||
} }
|
||||
{ (/BuildChar{AltsysCFD3 begin 64 BuildCh end}bind def) {
|
||||
pop out (\t/BuildChar AltsysCFD3 /BuildChar get def\n) writestring
|
||||
} }
|
||||
{ (/CDevProc{pop pop pop pop 0 exch -1000 exch 2 div ) {
|
||||
pop out (\t/CDevProc AltsysCFD3 /CDevProc get def\n) writestring
|
||||
} }
|
||||
{ (/CharStrings 1 dict dup begin) {
|
||||
pop out (\t/CharStrings AltsysCFD3 /CharStrings get def\n) writestring
|
||||
2 { dup buffer readline pop pop } repeat
|
||||
} }
|
||||
{ (/FontMatrix[0.001 0.0 0.0 0.001 0.0 0.0]def) {
|
||||
pop out (\t/FontMatrix AltsysCFD3 /FontMatrix get def\n) writestring
|
||||
} }
|
||||
{ (/Private 14 dict dup begin) {
|
||||
pop out (\t/Private) writestring
|
||||
{ dup buffer readline pop
|
||||
(end def) search { pop pop pop exit } if
|
||||
(/Std) search
|
||||
{ pop pop dup length 3 sub 3 exch getinterval
|
||||
(]) search pop out ( ) writestring out exch writestring pop
|
||||
}
|
||||
if pop
|
||||
}
|
||||
loop out ( AltsysCFD3 begin BuildPr end def\n) writestring
|
||||
} }
|
||||
{ (UniqueID) { pop } }
|
||||
{ () {
|
||||
out exch writestring out (\n) writestring
|
||||
} }
|
||||
] def
|
||||
[ (SR) (SA) (SK) (SB) (UG) ]
|
||||
{ 0 1 255 { encoding exch /.notdef put } for
|
||||
inprefix exch concatstrings macrfile
|
||||
{ dup buffer readline not { pop exit } if
|
||||
/patterns load
|
||||
{ 2 copy 0 get search { pop pop pop 1 get exec exit } if pop pop }
|
||||
forall
|
||||
}
|
||||
loop closefile
|
||||
}
|
||||
forall
|
||||
csr closefile
|
||||
|
||||
% Copy the definition of the root font.
|
||||
|
||||
dup buffer readstring pop out exch writestring closefile
|
||||
out (
|
||||
setpacking
|
||||
) writestring
|
||||
out closefile
|
||||
|
||||
% Remove the Mac garbage from the outline files.
|
||||
|
||||
[ (COD) (CSA) ]
|
||||
{ CDir (/) concatstrings (JIS83-1_) concatstrings
|
||||
1 index concatstrings macrfile
|
||||
exch OutDot exch concatstrings
|
||||
QUIET not { (Writing ) print dup = flush } if
|
||||
(w) file
|
||||
% Stack: infile outfile
|
||||
{ 1 index buffer readstring exch
|
||||
% Stack: infile outfile noteof substring
|
||||
2 index exch writestring not { exit } if
|
||||
}
|
||||
loop closefile closefile
|
||||
}
|
||||
forall
|
||||
|
||||
} bind def
|
||||
|
||||
% If the program was invoked from the command line, run it now.
|
||||
[ .shellarguments
|
||||
{ counttomark 5 eq
|
||||
{ convert
|
||||
QUIET not { (Done.\n) print flush } if
|
||||
}
|
||||
{ cleartomark
|
||||
(Usage: gsnd -- rollconv.ps FName OutBase InDir CDir OutDir\n) print
|
||||
( e.g.: gsnd -- rollconv.ps HGMinchoE mincho HGfonts/Mincho HGfonts/Mincho HGfonts/gs\n) print flush
|
||||
mark
|
||||
}
|
||||
ifelse
|
||||
}
|
||||
if pop
|
||||
794
dist/conf/ghostscript/lib/stcinfo.ps
vendored
794
dist/conf/ghostscript/lib/stcinfo.ps
vendored
@@ -1,794 +0,0 @@
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% 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.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% stcinfo.ps
|
||||
% Epson Stylus-Color Printer-Driver
|
||||
|
||||
% The purpose of this file is to print & show Parameters of the
|
||||
% stcolor-driver. If not run on ghostscript/stcolor, it prints
|
||||
% something like a color-chart.
|
||||
|
||||
% use either existing STCinfo-dictionary, retrieve new one or create dummy
|
||||
|
||||
statusdict begin product end
|
||||
dup (Ghostscript) eq 1 index (Artifex Ghostscript) eq or
|
||||
exch (AFPL Ghostscript) eq or{
|
||||
|
||||
currentpagedevice
|
||||
dup /Name get (stcolor) eq /STCi_onstc exch def
|
||||
/STCinfo where {/STCinfo get exch pop} if
|
||||
/STCinfo exch def
|
||||
|
||||
}{
|
||||
|
||||
/STCinfo 10 dict def
|
||||
STCinfo begin /Name (unknown) def end
|
||||
/STCi_onstc false def
|
||||
|
||||
}ifelse
|
||||
|
||||
% Next Block are procedures to generate the color-triangles.
|
||||
% you may wish to separate them, just look ahead for the name
|
||||
% given in the next line to achieve that.
|
||||
% Begin: colortri_procedures
|
||||
|
||||
% Plot the CIE-XY-triangle (or something like that)
|
||||
|
||||
% /colortri_mat Conversion matrix RGB -> XYZ
|
||||
% /colortri_bg procedure, that takes X/Y-Values and delivers the
|
||||
% "background color" as RGB-Values, default is:
|
||||
% {pop pop 0.85 dup dup}
|
||||
|
||||
% The default matrix was taken from:
|
||||
% Color spaces FAQ - David Bourgin
|
||||
% Date: 15/6/94 (items 5.3 and 6 updated)
|
||||
% Last update: 29/6/94
|
||||
|
||||
/colortri_mat [ % RGB -> CIE XYZitu601-1 (D65)
|
||||
0.4306 0.3415 0.1784
|
||||
0.2220 0.7067 0.0713
|
||||
0.0202 0.1295 0.9394
|
||||
] def
|
||||
|
||||
/colortri_bg {pop pop 0.85 dup dup} bind def
|
||||
|
||||
% +---------------------------------------------------------------------+
|
||||
% | Besides from fixing bugs, nothing should be changed below this line |
|
||||
% +---------------------------------------------------------------------+
|
||||
|
||||
% Arbitrary operation on a pair of vectors, *CHANGES* 1st.
|
||||
% invoke: Vaccu Vop op vop
|
||||
/vop {
|
||||
bind 0 1 3 index length 1 sub {
|
||||
3 index 1 index get 3 index 2 index get 3 index exec 4 index 3 1 roll put
|
||||
} for pop pop
|
||||
} bind def
|
||||
|
||||
/vsub { {sub} vop } bind def % subtract two vectors
|
||||
/vmul { {mul} vop } bind def % multiply two vectors
|
||||
|
||||
% Compute sum of vectors elements
|
||||
/vsum {0.0 exch{add}forall} bind def
|
||||
|
||||
% Sum up products of elements
|
||||
/veqn { [ 3 -1 roll {} forall ] exch vmul vsum } bind def
|
||||
|
||||
% Find index of |maximum| in array
|
||||
/imax {
|
||||
dup 0 get abs 0 exch % array i v[i]
|
||||
1 1 4 index length 1 sub {
|
||||
3 index 1 index get abs dup 3 index gt {4 2 roll}if pop pop
|
||||
} for
|
||||
3 -1 roll pop
|
||||
} bind def
|
||||
|
||||
% Procedure to *CHANGE* RGB-Values into XYZ-Values
|
||||
/rgb2xyz {
|
||||
0 3 6 { colortri_mat exch 3 getinterval 1 index veqn exch } for astore
|
||||
} bind def
|
||||
|
||||
% Procedure to *CHANGE* transform rgb->xy
|
||||
/rgb2xy {
|
||||
rgb2xyz
|
||||
dup 0 get 1 index 1 get 2 index vsum % XYZ X Y sum
|
||||
dup 0 ne {
|
||||
exch 1 index div 3 1 roll div % XYZ y x
|
||||
2 index exch 0 exch put % xYZ y
|
||||
1 index exch 1 exch put % xyZ
|
||||
}{
|
||||
pop pop pop dup 0 0 put dup 0 1 put
|
||||
} ifelse
|
||||
0 2 getinterval
|
||||
} bind def
|
||||
|
||||
% So here we go with our procedure
|
||||
|
||||
/colortri { %Usage: box #pixels
|
||||
save
|
||||
1 index type /arraytype eq {exch 8}{3 1 roll} ifelse % Default scale
|
||||
/colortri_scale exch def
|
||||
/colortri_box exch def
|
||||
|
||||
% Prepare some useful constants for xy -> RGB conversion
|
||||
|
||||
/colsum [ % Array with column-sums
|
||||
0 1 2{0 exch 3 1 index 6 add{colortri_mat exch get add}for}for
|
||||
] def
|
||||
|
||||
/Xrow colortri_mat 0 3 getinterval def % two rows from colortri_mat
|
||||
/Yrow colortri_mat 3 3 getinterval def
|
||||
|
||||
% Avoid allocating new arrays
|
||||
/xcoeff 3 array def
|
||||
/ycoeff 3 array def
|
||||
|
||||
% Procedure to derive RGB-Values form X,Y
|
||||
/xy2rgb{ aload pop
|
||||
dup dup dup ycoeff astore colsum vmul Yrow vsub imax
|
||||
3 index dup dup xcoeff astore colsum vmul Xrow vsub imax
|
||||
3 -1 roll 1 index 1 index gt{
|
||||
xcoeff ycoeff /xcoeff exch def /ycoeff exch def pop 3 -1 roll pop
|
||||
}{
|
||||
3 1 roll pop pop
|
||||
} ifelse
|
||||
1e-6 lt { % No Pivot ?
|
||||
pop colortri_bg xcoeff astore pop
|
||||
}{ % Have a Pivot
|
||||
dup ycoeff exch get neg
|
||||
0 1 2 { dup ycoeff exch get 2 index div ycoeff 3 1 roll put} for
|
||||
pop ycoeff 1 index 0 put
|
||||
|
||||
xcoeff 1 index get
|
||||
0 1 2 {
|
||||
ycoeff 1 index get 2 index mul xcoeff 2 index get add
|
||||
xcoeff 3 1 roll put
|
||||
} for
|
||||
pop xcoeff 1 index 0 put
|
||||
xcoeff imax 1e-6 lt { % no Pivot ?
|
||||
pop pop colortri_bg xcoeff astore pop
|
||||
}{
|
||||
dup 2 index or 3 exch sub
|
||||
xcoeff 1 index get xcoeff 3 index get div neg
|
||||
xcoeff exch 3 index exch put
|
||||
xcoeff 1 index 1 put
|
||||
ycoeff exch get ycoeff 2 index get xcoeff 4 -1 roll get mul add
|
||||
xcoeff 3 1 roll put
|
||||
0 1 2 {
|
||||
xcoeff exch get dup -0.0015 lt exch 1.0015 gt or {
|
||||
colortri_bg xcoeff astore dup exit
|
||||
} if
|
||||
} for
|
||||
pop pop xcoeff
|
||||
} ifelse
|
||||
} ifelse
|
||||
} bind def
|
||||
|
||||
% Compute the displayed range
|
||||
[ 1 1 1 ] rgb2xy
|
||||
dup 0 get /colortri_x0 exch def /colortri_dx colortri_x0 def
|
||||
1 get /colortri_y0 exch def /colortri_dy colortri_y0 def
|
||||
[[0 0 1][0 1 0][0 1 1][1 0 0][1 0 1][1 1 0]] {
|
||||
rgb2xy
|
||||
dup 0 get
|
||||
dup colortri_x0 lt {/colortri_x0 1 index def}if
|
||||
dup colortri_dx gt {/colortri_dx 1 index def}if
|
||||
pop 1 get
|
||||
dup colortri_y0 lt {/colortri_y0 1 index def}if
|
||||
dup colortri_dy gt {/colortri_dy 1 index def}if
|
||||
pop
|
||||
} forall
|
||||
colortri_dx colortri_x0 sub /colortri_dx exch def
|
||||
colortri_dy colortri_y0 sub /colortri_dy exch def
|
||||
%
|
||||
|
||||
% determine the scale
|
||||
colortri_box 2 get colortri_box 0 get sub colortri_dx div % fx
|
||||
colortri_box 3 get colortri_box 1 get sub colortri_dy div % fx fy
|
||||
gt { % fy limits
|
||||
colortri_box 3 get colortri_box 1 get sub
|
||||
dup colortri_dx mul colortri_dy div exch
|
||||
}{ % fx limits
|
||||
colortri_box 2 get colortri_box 0 get sub
|
||||
dup colortri_dy mul colortri_dx div
|
||||
} ifelse
|
||||
dtransform abs colortri_scale div cvi /colortri_ny exch def
|
||||
abs colortri_scale div cvi /colortri_nx exch def
|
||||
colortri_nx colortri_scale mul colortri_ny colortri_scale mul
|
||||
idtransform abs exch abs exch
|
||||
colortri_box 0 get colortri_box 2 get 1 index sub 3 index sub 2 div add
|
||||
colortri_box 1 get colortri_box 3 get 1 index sub 3 index sub 2 div add
|
||||
transform .5 add cvi exch .5 add cvi exch itransform
|
||||
translate scale
|
||||
|
||||
% String & indices
|
||||
/colortri_tmp colortri_nx 3 mul string def
|
||||
/colortri_dx colortri_dx colortri_nx 1 sub div def
|
||||
/colortri_dy colortri_dy colortri_ny 1 sub div def
|
||||
/colortri_xy [ colortri_x0 colortri_y0 ] def
|
||||
/colortri_ie colortri_tmp length 3 sub def
|
||||
|
||||
colortri_nx colortri_ny 8 [ colortri_nx 0 0 colortri_ny 0 0 ]
|
||||
{
|
||||
colortri_xy 0 colortri_x0 put
|
||||
0 3 colortri_ie {
|
||||
colortri_tmp exch % buf ir
|
||||
colortri_xy xy2rgb % buf ir rgb buf ib
|
||||
2 index 2 index 2 add 2 index 2 get 255 mul cvi put
|
||||
2 index 2 index 1 add 2 index 1 get 255 mul cvi put
|
||||
0 get 255 mul cvi put
|
||||
colortri_xy dup 0 exch 0 get colortri_dx add put
|
||||
}for
|
||||
colortri_xy dup 1 exch 1 get colortri_dy add put
|
||||
colortri_tmp
|
||||
} bind
|
||||
false 3 colorimage
|
||||
restore
|
||||
} bind def
|
||||
|
||||
% [ newpath clippath pathbbox ] colortri showpage % standalone usage
|
||||
|
||||
% End: colortri_procedures
|
||||
|
||||
% The next section is a group of procedures, that I for myself
|
||||
% do no more fully understand, but they do the Job.
|
||||
|
||||
% Begin: stcinfo_procedures_1
|
||||
|
||||
% fetch a parameter from the dictionary
|
||||
/STCiget { STCinfo exch get } bind def
|
||||
|
||||
% action upon ProcessColorModel
|
||||
/STCimode {
|
||||
/ProcessColorModel STCiget dup
|
||||
/DeviceCMYK eq{pop 2}{/DeviceRGB eq{1}{0}ifelse}ifelse get exec
|
||||
} bind def
|
||||
|
||||
% print given number of blanks
|
||||
/STCipspace {
|
||||
dup 0 gt{ 1 exch 1 exch { pop ( ) print}for }{ pop } ifelse
|
||||
} bind def
|
||||
|
||||
% print right or left-justified text
|
||||
/STCiprint {
|
||||
dup 0 gt { dup 2 index length sub STCipspace } if
|
||||
1 index print
|
||||
dup 0 lt { neg dup 2 index length sub STCipspace } if
|
||||
pop pop
|
||||
} bind def
|
||||
|
||||
% floating-point to fixed-length-string conversion
|
||||
|
||||
/STCicvs { % number -> string
|
||||
|
||||
% Prepare the result
|
||||
8 string dup 0 ( ) putinterval
|
||||
exch
|
||||
|
||||
% Make it unsigned
|
||||
dup 0 lt {neg(-)}{( )}ifelse 0 get exch
|
||||
|
||||
dup 1000 lt 1 index 0 eq 2 index 0.001 ge or and { % floating point
|
||||
(e+) 0
|
||||
}{ % engineering
|
||||
0 {
|
||||
1 index 1000.0 ge
|
||||
{3 add exch 1000 div exch}
|
||||
{1 index 1 lt {3 sub exch 1000 mul exch}{exit}ifelse}
|
||||
ifelse
|
||||
}loop
|
||||
dup 0 lt {neg(e-)}{(e+)}ifelse exch
|
||||
}ifelse
|
||||
|
||||
% string sign num esig e
|
||||
|
||||
% always up to three Integer Digits plus sign
|
||||
2 index cvi 3 { % string sign num esig e int ind
|
||||
1 index 10 div cvi dup 10 mul 3 index exch sub cvi
|
||||
(0123456789) exch get 8 index exch 3 index exch put
|
||||
3 -2 roll 1 sub exch pop dup 0 eq 2 index 0 eq or {exit} if
|
||||
} loop exch pop % string sign num esig e ind
|
||||
5 index exch 6 -1 roll put % string num esig e
|
||||
|
||||
% print either fraction or exponent
|
||||
dup 0 eq { pop pop dup cvi sub % String fraction
|
||||
|
||||
dup 0.0 ne { % Fraction present
|
||||
0.0005 add 1 index 4 (.) putinterval
|
||||
5 1 7 { % string frac ind
|
||||
exch 10 mul dup cvi exch 1 index sub % string ind ic nfrac
|
||||
exch (0123456789) exch get 3 -1 roll % string nfrac chr ind
|
||||
exch 3 index 3 1 roll put
|
||||
} for
|
||||
} if
|
||||
pop
|
||||
|
||||
}{ 3 -1 roll pop % string esig e
|
||||
|
||||
exch 2 index exch 4 exch putinterval
|
||||
7 -1 6 { % string n i
|
||||
1 index 10 div cvi dup 10 mul 3 index exch sub cvi % string n i n/10
|
||||
(0123456789) exch get 4 index exch 3 index exch put
|
||||
exch pop exch pop
|
||||
} for
|
||||
pop
|
||||
} ifelse
|
||||
|
||||
} bind def
|
||||
|
||||
% compute colorvalue-steps from transfer & coding
|
||||
/STCisteps { % xfer, coding => X-values, Y-Values
|
||||
% 2^nbits
|
||||
2 /BitsPerComponent STCiget dup 11 gt { pop 11 } if exp cvi
|
||||
|
||||
% X & Y - Arrays (stack: xv:4 yv:3 xfer:2 coding:1 2^ni:0)
|
||||
dup 1 add array 1 index array 5 2 roll
|
||||
|
||||
% compute GS-Color-Value according to the coding-array
|
||||
|
||||
1 index null eq { % no coding present
|
||||
|
||||
0 1 2 index 1 sub {
|
||||
dup 6 index exch dup 4 index div put
|
||||
4 index exch dup 3 index 1 sub div put
|
||||
} for
|
||||
|
||||
}{ % coding-array given
|
||||
|
||||
1.0 1 index 1 sub div % y step
|
||||
0 % current index
|
||||
0 1 4 index 1 sub { % over indices
|
||||
dup 3 index mul
|
||||
{
|
||||
dup 3 index 1 add dup 8 index length ge {pop pop exit} if % i y
|
||||
7 index exch get le {exit} if
|
||||
2 index 1 add 3 1 roll 4 -1 roll pop
|
||||
} loop
|
||||
5 index 3 index get sub
|
||||
5 index 3 index 1 add get 6 index 4 index get sub div
|
||||
2 index add 5 index length 1 sub div
|
||||
2 copy exch dup 0 eq {
|
||||
10 index exch 0.0 put pop
|
||||
}{
|
||||
dup 10 index exch 1 sub get 3 -1 roll add 2 div
|
||||
10 index 3 1 roll put
|
||||
}ifelse
|
||||
7 index 3 1 roll put
|
||||
} for % over indices
|
||||
pop pop
|
||||
} ifelse
|
||||
4 index 1 index 1.0 put
|
||||
|
||||
% Replace the raw y-values by those computed from the transfer-array
|
||||
|
||||
0 1 2 index 1 sub { % over indices, 2nd
|
||||
dup 5 index exch get
|
||||
dup 5 index length 1 sub mul cvi % -> iy
|
||||
5 index 1 index get
|
||||
1 index 1 add 7 index length lt {
|
||||
dup 7 index 3 index 1 add get exch sub
|
||||
3 index 3 index 9 index length 1 sub div sub mul
|
||||
7 index length 1 sub mul add
|
||||
} if
|
||||
exch pop exch pop 5 index 3 1 roll put
|
||||
} for % over indices, 2nd
|
||||
|
||||
pop pop pop
|
||||
} bind def
|
||||
|
||||
/STCibar { % Window X-Values proc => Window
|
||||
0 1 3 index length 2 sub {
|
||||
dup 3 index exch get exch
|
||||
1 add 3 index exch get
|
||||
dup 2 index add 2 div 3 index exec % Color to average
|
||||
4 index 2 get 5 index 0 get sub exch 1 index mul 5 index 0 get add 3 1 roll
|
||||
mul 4 index 0 get add 4 index 3 get 5 index 1 get
|
||||
newpath
|
||||
2 index 1 index moveto
|
||||
3 index 1 index lineto
|
||||
3 index 2 index lineto
|
||||
2 index 2 index lineto
|
||||
closepath fill
|
||||
pop pop pop pop
|
||||
} for
|
||||
pop pop
|
||||
0 setgray
|
||||
newpath
|
||||
dup 0 get 1 index 1 get moveto
|
||||
dup 2 get 1 index 1 get lineto
|
||||
dup 2 get 1 index 3 get lineto
|
||||
dup 0 get 1 index 3 get lineto
|
||||
closepath stroke
|
||||
pop
|
||||
} bind def
|
||||
|
||||
% End: stcinfo_procedures_1
|
||||
|
||||
% Begin: stcinfo_preparation
|
||||
|
||||
% Compute used area from clippath
|
||||
|
||||
/STCi_clip [
|
||||
newpath clippath pathbbox
|
||||
2 sub 4 1 roll 2 sub 4 1 roll 2 add 4 1 roll 2 add 4 1 roll
|
||||
] def
|
||||
|
||||
%
|
||||
% Perpare the texual messages, assume no stcolor if this fails
|
||||
%
|
||||
{
|
||||
/STCi_stopped % A Special Mark
|
||||
|
||||
% Textual Parameters (an array of pairs of strings)
|
||||
/STCi_l1 0 def
|
||||
/STCi_l2 0 def
|
||||
/STCi_text [
|
||||
% Driver-Name & Version
|
||||
(Parameters of)
|
||||
/Name STCiget length /Version STCiget length add 1 add string
|
||||
dup 0 /Name STCiget putinterval dup /Name STCiget length (-)putinterval
|
||||
dup /Name STCiget length 1 add /Version STCiget putinterval
|
||||
% Dithering-Algorithm
|
||||
(Dithering)
|
||||
/Dithering STCiget
|
||||
[{( \(Monochrome\))}{( \(RGB\))}{( \(CMYK\))}] STCimode
|
||||
dup length 2 index length add string exch 1 index exch
|
||||
3 index length exch putinterval dup 3 1 roll exch 0 exch putinterval
|
||||
% Flags for the algorithm
|
||||
(Flag4-0) 5 string
|
||||
dup 0 /Flag4 STCiget {(T)}{(f)} ifelse putinterval
|
||||
dup 1 /Flag3 STCiget {(T)}{(f)} ifelse putinterval
|
||||
dup 2 /Flag2 STCiget {(T)}{(f)} ifelse putinterval
|
||||
dup 3 /Flag1 STCiget {(T)}{(f)} ifelse putinterval
|
||||
dup 4 /Flag0 STCiget {(T)}{(f)} ifelse putinterval
|
||||
|
||||
% Bits Per Pixel & Bits Per Component
|
||||
(BitsPerPixel) 10 string % (nn -> nxnn)
|
||||
/BitsPerPixel STCiget 1 index cvs length % string used
|
||||
dup 2 index exch ( -> ) putinterval 4 add dup 2 add exch 2 index exch
|
||||
[{(1x)}{(3x)}{(4x)}] STCimode putinterval % String used
|
||||
/BitsPerComponent STCiget 2 index 2 index 2 getinterval cvs length add
|
||||
0 exch getinterval
|
||||
|
||||
() ()
|
||||
% ColorAdjustMatrix
|
||||
(ColorAdjustMatrix)
|
||||
/ColorAdjustMatrix STCiget dup null eq {
|
||||
pop (default)
|
||||
}{
|
||||
{ STCicvs } forall
|
||||
[{ % Monochrome
|
||||
26 string
|
||||
dup 0 6 -1 roll putinterval dup 8 ( ) putinterval
|
||||
dup 9 5 -1 roll putinterval dup 17 ( ) putinterval
|
||||
dup 18 4 -1 roll putinterval
|
||||
}{ % RGB
|
||||
26 string
|
||||
dup 0 12 -1 roll putinterval dup 8 ( ) putinterval
|
||||
dup 9 11 -1 roll putinterval dup 17 ( ) putinterval
|
||||
dup 18 10 -1 roll putinterval
|
||||
|
||||
() 26 string
|
||||
dup 0 11 -1 roll putinterval dup 8 ( ) putinterval
|
||||
dup 9 10 -1 roll putinterval dup 17 ( ) putinterval
|
||||
dup 18 9 -1 roll putinterval
|
||||
|
||||
() 26 string
|
||||
dup 0 10 -1 roll putinterval dup 8 ( ) putinterval
|
||||
dup 9 9 -1 roll putinterval dup 17 ( ) putinterval
|
||||
dup 18 8 -1 roll putinterval
|
||||
}{
|
||||
35 string
|
||||
dup 0 19 -1 roll putinterval dup 8 ( ) putinterval
|
||||
dup 9 18 -1 roll putinterval dup 17 ( ) putinterval
|
||||
dup 18 17 -1 roll putinterval dup 26 ( ) putinterval
|
||||
dup 27 16 -1 roll putinterval
|
||||
|
||||
() 35 string
|
||||
dup 0 17 -1 roll putinterval dup 8 ( ) putinterval
|
||||
dup 9 16 -1 roll putinterval dup 17 ( ) putinterval
|
||||
dup 18 15 -1 roll putinterval dup 26 ( ) putinterval
|
||||
dup 27 14 -1 roll putinterval
|
||||
|
||||
() 35 string
|
||||
dup 0 15 -1 roll putinterval dup 8 ( ) putinterval
|
||||
dup 9 14 -1 roll putinterval dup 17 ( ) putinterval
|
||||
dup 18 13 -1 roll putinterval dup 26 ( ) putinterval
|
||||
dup 27 12 -1 roll putinterval
|
||||
|
||||
() 35 string
|
||||
dup 0 13 -1 roll putinterval dup 8 ( ) putinterval
|
||||
dup 9 12 -1 roll putinterval dup 17 ( ) putinterval
|
||||
dup 18 11 -1 roll putinterval dup 26 ( ) putinterval
|
||||
dup 27 10 -1 roll putinterval
|
||||
|
||||
}
|
||||
] STCimode
|
||||
} ifelse
|
||||
() ()
|
||||
|
||||
% Printer Model
|
||||
(Printer-Model) /Model STCiget
|
||||
|
||||
% Resolution
|
||||
(Resolution) 15 string % (nnnnnxnnnnn DpI)
|
||||
/HWResolution STCiget 0 get cvi 1 index cvs length
|
||||
dup 2 index exch (x) putinterval 1 add dup 2 index exch 5 getinterval
|
||||
/HWResolution STCiget 1 get cvi exch cvs length add dup 2 index
|
||||
exch ( DpI) putinterval 4 add 0 exch getinterval
|
||||
|
||||
% HWsize holds entire Page in Pixels,
|
||||
% .HWMargins is [left,bottom,right,top] in Points
|
||||
(Printed Area) 18 string % (nnnnnxnnnnn Pixel)
|
||||
/HWSize STCiget 0 get /.HWMargins STCiget dup 0 get exch 2 get add
|
||||
/HWResolution STCiget 0 get mul 72.0 div sub cvi 1 index cvs length
|
||||
dup 2 index exch (x) putinterval 1 add dup 2 index exch 5 getinterval
|
||||
/HWSize STCiget 1 get /.HWMargins STCiget dup 1 get exch 3 get add
|
||||
/HWResolution STCiget 1 get mul 72.0 div sub cvi exch cvs length add
|
||||
dup 2 index exch ( Pixel) putinterval 6 add 0 exch getinterval
|
||||
|
||||
() ()
|
||||
% WeaveMode
|
||||
(Weave-Mode)
|
||||
/noWeave STCiget {
|
||||
(noWeave)
|
||||
}{
|
||||
/Microweave STCiget {(Microweave)}{(Softweave)}ifelse
|
||||
}ifelse
|
||||
% Unidirectional
|
||||
(Unidirectional) /Unidirectional STCiget {(ON)}{(off)} ifelse
|
||||
% Output coding
|
||||
(OutputCode) /OutputCode STCiget
|
||||
% number of heads
|
||||
(escp_Band) /escp_Band STCiget 3 string cvs
|
||||
(escp_Width) /escp_Width STCiget 5 string cvs
|
||||
(escp_Height) /escp_Height STCiget 5 string cvs
|
||||
(escp_Top) /escp_Top STCiget 5 string cvs
|
||||
(escp_Bottom) /escp_Bottom STCiget 5 string cvs
|
||||
] def
|
||||
|
||||
%
|
||||
% compute the Proper X & Y-Arrays
|
||||
%
|
||||
[{ % Monochrome
|
||||
/Ktransfer STCiget /Kcoding STCiget STCisteps
|
||||
/STCi_yv [ 3 -1 roll ] def
|
||||
/STCi_xv [ 3 -1 roll ] def
|
||||
/STCi_col [[0 0 0]] def
|
||||
/STCi_set [{1.0 exch sub setgray}] def
|
||||
}{ % RGB
|
||||
/Rtransfer STCiget /Rcoding STCiget STCisteps
|
||||
/Gtransfer STCiget /Gcoding STCiget STCisteps
|
||||
/Btransfer STCiget /Bcoding STCiget STCisteps
|
||||
exch 4 -1 roll 6 -1 roll exch 3 -1 roll
|
||||
/STCi_xv [ 5 2 roll ] def
|
||||
/STCi_yv [ 5 2 roll ] def
|
||||
/STCi_col [[1 0 0] [0 1 0] [0 0 1]] def
|
||||
/STCi_set [
|
||||
{1.0 exch sub 1 exch dup setrgbcolor}
|
||||
{1.0 exch sub dup 1 exch setrgbcolor}
|
||||
{1.0 exch sub dup 1 setrgbcolor}
|
||||
] def
|
||||
}{ % CMYK
|
||||
/Ctransfer STCiget /Ccoding STCiget STCisteps
|
||||
/Mtransfer STCiget /Mcoding STCiget STCisteps exch 3 1 roll
|
||||
/Ytransfer STCiget /Ycoding STCiget STCisteps exch 4 1 roll
|
||||
/Ktransfer STCiget /Kcoding STCiget STCisteps exch 5 1 roll
|
||||
/STCi_yv [ 6 2 roll ] def
|
||||
/STCi_xv [ 6 2 roll ] def
|
||||
/STCi_col [[0 1 1] [1 0 1] [1.0 0.5 0.0] [0 0 0]] def
|
||||
/STCi_set [
|
||||
{ 0 0 0 setcmykcolor }
|
||||
{ 0 exch 0 0 setcmykcolor }
|
||||
{ 0 exch 0 exch 0 setcmykcolor }
|
||||
{ 0 exch 0 exch 0 exch setcmykcolor }
|
||||
] def
|
||||
}
|
||||
]STCimode
|
||||
|
||||
} stopped
|
||||
|
||||
{ {/STCi_stopped eq {exit}if}loop true}
|
||||
{ {/STCi_stopped eq {exit}if}loop false} ifelse
|
||||
|
||||
% End: stcinfo_preparation
|
||||
|
||||
% The Next section does the real job
|
||||
|
||||
% Begin: stcinfo_execution
|
||||
{
|
||||
(%%[ stcinfo.ps: currentdevice is not supported -> colortri ]%%\n) print
|
||||
STCi_clip colortri % The default action
|
||||
|
||||
}{
|
||||
%
|
||||
% Print the text
|
||||
%
|
||||
0 2 STCi_text length 2 sub { dup 1 add exch
|
||||
STCi_text exch get length dup STCi_l1 gt{/STCi_l1 exch def}{pop}ifelse
|
||||
STCi_text exch get length dup STCi_l2 gt{/STCi_l2 exch def}{pop}ifelse
|
||||
} for
|
||||
/STCi_l2 STCi_l2 neg def
|
||||
0 2 STCi_text length 2 sub {
|
||||
dup 1 add STCi_text exch get exch STCi_text exch get
|
||||
1 index length 0 gt {
|
||||
dup STCi_l1 STCiprint length 0 gt {(: )}{( )}ifelse print print
|
||||
}{
|
||||
pop pop
|
||||
} ifelse
|
||||
(\n) print
|
||||
} for
|
||||
%
|
||||
% Deactivate a present ColorAdjust Matrix, if any
|
||||
%
|
||||
/ColorAdjustMatrix STCiget null ne STCi_onstc and {
|
||||
mark
|
||||
/ColorAdjustMatrix null
|
||||
.dicttomark setpagedevice
|
||||
} if
|
||||
%
|
||||
% "Show" the text
|
||||
%
|
||||
/Times-Roman findfont 10 scalefont setfont
|
||||
/STCi_l1 0 def
|
||||
0 2 STCi_text length 2 sub {
|
||||
STCi_text exch get stringwidth pop dup STCi_l1 gt {
|
||||
/STCi_l1 exch def
|
||||
}{
|
||||
pop
|
||||
} ifelse
|
||||
} for
|
||||
STCi_l1 STCi_clip 0 get add /STCi_l1 exch def
|
||||
|
||||
STCi_clip 3 get 12 sub
|
||||
0 2 STCi_text length 2 sub {
|
||||
STCi_text exch get dup length 0 gt {
|
||||
dup stringwidth pop STCi_l1 exch sub 2 index moveto show
|
||||
}{
|
||||
pop
|
||||
} ifelse
|
||||
12 sub
|
||||
} for
|
||||
pop
|
||||
|
||||
/Courier findfont 10 scalefont setfont
|
||||
/STCi_l2 0 def
|
||||
1 2 STCi_text length 1 sub {
|
||||
STCi_text exch get stringwidth pop dup STCi_l2 gt {
|
||||
/STCi_l2 exch def
|
||||
}{
|
||||
pop
|
||||
} ifelse
|
||||
} for
|
||||
|
||||
STCi_clip 3 get 12 sub
|
||||
1 2 STCi_text length 1 sub {
|
||||
STCi_text exch get dup length 0 gt {
|
||||
STCi_l1 12 add 2 index moveto show
|
||||
}{
|
||||
pop
|
||||
} ifelse
|
||||
12 sub
|
||||
} for
|
||||
pop
|
||||
|
||||
%
|
||||
% compute the space for the graph-window
|
||||
%
|
||||
STCi_l1 12 add STCi_l2 add 12 add dup STCi_clip 2 get exch sub % Extend
|
||||
[ 3 -1 roll dup 3 index add STCi_clip 3 get dup 5 index sub 3 1 roll ]
|
||||
/STCi_win exch def /STCi_l1 exch def
|
||||
|
||||
% The "Axis"
|
||||
newpath
|
||||
STCi_win 0 get STCi_win 1 get 14 add moveto
|
||||
STCi_win 2 get STCi_win 1 get 14 add lineto stroke
|
||||
|
||||
STCi_win 0 get 14 add STCi_win 1 get moveto
|
||||
STCi_win 0 get 14 add STCi_win 3 get lineto stroke
|
||||
|
||||
% The Labels
|
||||
/Times-Roman findfont 10 scalefont setfont
|
||||
(Postscript-color) dup stringwidth pop
|
||||
STCi_win 2 get STCi_win 0 get sub 14 sub 1 index sub 2 div exch pop
|
||||
STCi_win 0 get add 14 add STCi_win 1 get 4 add moveto show
|
||||
|
||||
gsave
|
||||
STCi_win 0 get 10 add STCi_win 1 get 14 add translate 90 rotate
|
||||
(Device-color) dup stringwidth pop
|
||||
STCi_win 3 get STCi_win 1 get sub 14 sub 1 index sub 2 div exch pop
|
||||
0 moveto show
|
||||
grestore
|
||||
|
||||
% The Graphs
|
||||
gsave
|
||||
STCi_win 0 get 14 add STCi_win 1 get 14 add
|
||||
STCi_win 2 get 2 index sub STCi_win 3 get 2 index sub
|
||||
4 2 roll translate
|
||||
STCi_col 0 1 2 index length 1 sub {
|
||||
1 index 1 index get aload pop setrgbcolor
|
||||
STCi_xv 1 index get STCi_yv 3 -1 roll get
|
||||
newpath
|
||||
1 index 0 get 5 index mul 1 index 0 get 5 index mul moveto
|
||||
1 index 1 get 5 index mul 1 index 0 get 5 index mul lineto
|
||||
1 1 2 index length 1 sub {
|
||||
2 index 1 index get 6 index mul
|
||||
2 index 2 index get 6 index mul lineto
|
||||
2 index 1 index 1 add get 6 index mul
|
||||
2 index 2 index get 6 index mul lineto
|
||||
pop
|
||||
} for
|
||||
stroke pop pop
|
||||
} for
|
||||
pop pop pop
|
||||
grestore
|
||||
|
||||
%
|
||||
% Find lowest Y from Text or graph
|
||||
%
|
||||
STCi_win 1 get STCi_clip 3 get STCi_text length 2 div 12 mul sub
|
||||
dup 2 index gt { pop } { exch pop } ifelse 12 sub
|
||||
|
||||
%
|
||||
% compute the upper bar-window
|
||||
%
|
||||
/STCi_win [
|
||||
STCi_clip 0 get 4 -1 roll 36 sub STCi_clip 2 get 1 index 36 add
|
||||
] def
|
||||
|
||||
%
|
||||
% Draw the required number of graphs
|
||||
%
|
||||
[{ % Monochrome
|
||||
STCi_win STCi_xv 0 get {setgray} STCibar
|
||||
}{ % RGB
|
||||
STCi_win STCi_xv 0 get {0 0 setrgbcolor} STCibar
|
||||
STCi_win dup 1 exch 1 get 47 sub put
|
||||
STCi_win dup 3 exch 3 get 47 sub put
|
||||
STCi_win STCi_xv 1 get {0 0 3 1 roll setrgbcolor} STCibar
|
||||
STCi_win dup 1 exch 1 get 47 sub put
|
||||
STCi_win dup 3 exch 3 get 47 sub put
|
||||
STCi_win STCi_xv 2 get {0 0 3 2 roll setrgbcolor} STCibar
|
||||
}{ % CMYK
|
||||
STCi_win STCi_xv 0 get {0 0 0 setcmykcolor} STCibar
|
||||
STCi_win dup 1 exch 1 get 47 sub put
|
||||
STCi_win dup 3 exch 3 get 47 sub put
|
||||
STCi_win STCi_xv 1 get {0 0 0 4 1 roll setcmykcolor} STCibar
|
||||
STCi_win dup 1 exch 1 get 47 sub put
|
||||
STCi_win dup 3 exch 3 get 47 sub put
|
||||
STCi_win STCi_xv 2 get {0 0 0 4 2 roll setcmykcolor} STCibar
|
||||
STCi_win dup 1 exch 1 get 47 sub put
|
||||
STCi_win dup 3 exch 3 get 47 sub put
|
||||
STCi_win STCi_xv 3 get {0 0 0 4 3 roll setcmykcolor} STCibar
|
||||
}
|
||||
] STCimode
|
||||
|
||||
STCi_win 1 STCi_clip 1 get put
|
||||
STCi_win dup 3 exch 3 get 47 sub put
|
||||
|
||||
%
|
||||
% Plot either one or two Color-Triangles
|
||||
%
|
||||
/ColorAdjustMatrix STCiget null ne STCi_onstc and {
|
||||
STCi_win 0 get STCi_win 2 get add 2 div
|
||||
[STCi_win 0 get STCi_win 1 get 3 index STCi_win 3 get ] colortri
|
||||
mark /ColorAdjustMatrix dup STCiget .dicttomark setpagedevice
|
||||
[1 index STCi_win 1 get STCi_win 2 get STCi_win 3 get ] colortri
|
||||
pop
|
||||
}{
|
||||
STCi_win colortri
|
||||
} ifelse
|
||||
newpath clippath stroke
|
||||
} ifelse
|
||||
showpage
|
||||
169
dist/conf/ghostscript/lib/stcolor.ps
vendored
169
dist/conf/ghostscript/lib/stcolor.ps
vendored
@@ -1,169 +0,0 @@
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% 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.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% stcolor.ps
|
||||
% Epson Stylus-Color Printer-Driver
|
||||
|
||||
% The purpose of this file is to configure the stcolor-printer driver
|
||||
|
||||
%
|
||||
% It is useless and dangerous to interpret the following code with anything
|
||||
% else than Ghostscript, so this condition is verified first. If this fails
|
||||
% a message is send to the output. If this message bothers you, remove it,
|
||||
% but I prefer to know why the device-setup failed.
|
||||
|
||||
statusdict begin product end
|
||||
dup (Ghostscript) eq 1 index (Artifex Ghostscript) eq or
|
||||
exch (AFPL Ghostscript) eq or{
|
||||
|
||||
% fetch the current device-parameters this is specific for Ghostscript.
|
||||
|
||||
/STCold currentpagedevice def
|
||||
|
||||
% Any Ghostscript-Driver has a Name, verify that the selected device is
|
||||
% stcolor, otherwise nothing than another message will be produced.
|
||||
|
||||
STCold /Name get (stcolor) eq {
|
||||
|
||||
%
|
||||
% The main thing this file does, is to establish transfer-functions.
|
||||
% Here are two predefined arrays for 360x360Dpi and for 720x720DpI.
|
||||
% If resolution is 360x720 or 720x360 the average is used. You may
|
||||
% want to define other arrays here.
|
||||
%
|
||||
|
||||
/STCdeftransfer [ 0.0 1.0 ] def
|
||||
|
||||
/STCKtransfer360 [
|
||||
0.0000 0.0034 0.0185 0.0377 0.0574 0.0769 0.0952 0.1147
|
||||
0.1337 0.1540 0.1759 0.1985 0.2209 0.2457 0.2706 0.2949
|
||||
0.3209 0.3496 0.3820 0.4145 0.4505 0.4907 0.5344 0.5840
|
||||
0.6445 0.7093 0.8154 0.9816 0.9983 0.9988 0.9994 1.0000
|
||||
] def
|
||||
|
||||
/STCKtransfer720 [
|
||||
0.0000 0.0011 0.0079 0.0151 0.0217 0.0287 0.0354 0.0425
|
||||
0.0492 0.0562 0.0633 0.0700 0.0766 0.0835 0.0900 0.0975
|
||||
0.1054 0.1147 0.1243 0.1364 0.1489 0.1641 0.1833 0.2012
|
||||
0.2217 0.2492 0.2814 0.3139 0.3487 0.3996 0.4527 0.5195
|
||||
] def
|
||||
|
||||
% compute the resolution
|
||||
|
||||
STCold /HWResolution get dup
|
||||
0 get exch 1 get mul sqrt /STCdpi exch def
|
||||
|
||||
% pick the colormodel
|
||||
STCold /ProcessColorModel get /STCcolor exch def
|
||||
|
||||
mark % prepare stack for "setpagedevice"
|
||||
|
||||
% warn for BitsPerPixel=30 with fsrgb
|
||||
STCcolor /DeviceRGB eq STCold /BitsPerPixel get 32 eq and
|
||||
{
|
||||
(%%[ stcolor.ps: inefficient RGB-setup, recommend BitsPerPixel=24 ]%%\n)
|
||||
print
|
||||
} if
|
||||
|
||||
% if the Dithering-Method is default (gscmyk), change it to fscmyk
|
||||
% this is achieved by pushing a name/value-pair onto the stack
|
||||
% if the selected algorithm uses another ProcessColorModel, it is necessary
|
||||
% to change the Value of STCcolor according to the new algorithm.
|
||||
|
||||
STCold /Dithering get (gscmyk) eq
|
||||
{
|
||||
/Dithering (hscmyk) % preferred dithering-method
|
||||
} if % might be necessary to change STCcolor too
|
||||
|
||||
%
|
||||
% select the array according to the resolution
|
||||
%
|
||||
STCdpi 359.0 lt
|
||||
{ STCdeftransfer }
|
||||
{ STCdpi 361.0 lt
|
||||
{ STCKtransfer360 }
|
||||
{ STCdpi 719.0 gt
|
||||
{ STCKtransfer720 }
|
||||
{
|
||||
STCKtransfer360 length STCKtransfer720 length eq
|
||||
{
|
||||
0 1 STCKtransfer360 length 1 sub
|
||||
{
|
||||
dup dup
|
||||
STCKtransfer360 exch get
|
||||
exch STCKtransfer720 exch get
|
||||
add 2.0 div
|
||||
STCKtransfer360 3 1 roll put
|
||||
} for
|
||||
}if
|
||||
STCKtransfer360
|
||||
} ifelse
|
||||
}ifelse
|
||||
} ifelse
|
||||
/STCtransfer exch def
|
||||
|
||||
%
|
||||
% Add the arrays. With Version 1.17 and above, it seems to be
|
||||
% a good idea, to use the transfer-arrays as coding-arrays too.
|
||||
%
|
||||
|
||||
%
|
||||
% RGB-Model requires inversion of the transfer-arrays
|
||||
%
|
||||
STCcolor /DeviceRGB eq
|
||||
{
|
||||
/RGBtransfer STCtransfer length array def
|
||||
0 1 STCtransfer length 1 sub
|
||||
{
|
||||
dup RGBtransfer length 1 sub exch sub exch
|
||||
STCtransfer exch get 1.0 exch sub
|
||||
RGBtransfer 3 1 roll put
|
||||
} for
|
||||
|
||||
/Rtransfer RGBtransfer
|
||||
/Gtransfer RGBtransfer
|
||||
/Btransfer RGBtransfer
|
||||
|
||||
/Rcoding RGBtransfer
|
||||
/Gcoding RGBtransfer
|
||||
/Bcoding RGBtransfer
|
||||
|
||||
}{
|
||||
|
||||
/Ctransfer STCtransfer
|
||||
/Mtransfer STCtransfer
|
||||
/Ytransfer STCtransfer
|
||||
/Ktransfer STCtransfer
|
||||
|
||||
/Ccoding STCtransfer
|
||||
/Mcoding STCtransfer
|
||||
/Ycoding STCtransfer
|
||||
/Kcoding STCtransfer
|
||||
|
||||
} ifelse
|
||||
|
||||
counttomark 0 ne
|
||||
{.dicttomark setpagedevice}{cleartomark}ifelse
|
||||
|
||||
% decativate predefined correction
|
||||
|
||||
{} dup dup currenttransfer setcolortransfer
|
||||
|
||||
}{
|
||||
(%%[ stcolor.ps: currentdevice is not stcolor - ignored ]%%\n) print
|
||||
} ifelse
|
||||
}{
|
||||
(%%[ stcolor.ps: not interpreted by AFPL Ghostscript - ignored ]%%\n) print
|
||||
} ifelse
|
||||
61
dist/conf/ghostscript/lib/stocht.ps
vendored
61
dist/conf/ghostscript/lib/stocht.ps
vendored
@@ -1,61 +0,0 @@
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% 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.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% helper file to simplify use of Stochastic Halftone - uses ht_ccsto.ps
|
||||
|
||||
% This file sets the /StochasticDefault /Halftone as the current
|
||||
% and the /Default halftoning, loading the Stochastic halftone
|
||||
% if required.
|
||||
|
||||
% Stochastic halftoning is recommended for inkjet printers, and may
|
||||
% produce output as pleasing as the more computationally expensive
|
||||
% "error diffusion" that *some* device drivers provide.
|
||||
|
||||
% For printing technologies other than inkjet, Stochastic halftoning
|
||||
% may not look better than standard screening. In particular, thermal
|
||||
% transfer and direct thermal tend to be better with standard ordered
|
||||
% screening methods. Some laser printers may produce "smoother"
|
||||
% looking gray shades with Stochastic halftoning. Try it, and if
|
||||
% you like it, use it.
|
||||
|
||||
% Note that this /Default halftone can be overridden by PostScript
|
||||
% operators that set the screening or halftone (such as setscreen).
|
||||
|
||||
% To make Stochastic Halftone be "sticky" so that other screening and
|
||||
% halftone setting in the subsequent PostScript will be ignored, use:
|
||||
% -c "<< /HalftoneMode 1 >> setuserparams"
|
||||
% on the command line prior to the file to be processed. For example,
|
||||
%
|
||||
% gs stocht.ps -c "<< /HalftoneMode 1 >> setuserparams" -f examples/tiger.eps
|
||||
|
||||
% Alternatively, the command to set the /HalftoneMode userparam can be
|
||||
% concatenated to this file (see below).
|
||||
|
||||
% =====================================================================
|
||||
% Try to get the previously defined resource
|
||||
{ /StochasticDefault /Halftone findresource } stopped
|
||||
{
|
||||
pop pop
|
||||
% Need to load the Stochastic Halftone using the lib file
|
||||
(ht_ccsto.ps) runlibfile
|
||||
} if
|
||||
|
||||
% If we didn't error out by now, then go ahead and define the /Default
|
||||
/StochasticDefault /Halftone findresource
|
||||
/Default exch /Halftone defineresource
|
||||
sethalftone % Use the halftone
|
||||
|
||||
% Uncomment the next line to make the Stocahstic halftoning be "sticky"
|
||||
% << /HalftoneMode 1 >> setuserparams
|
||||
41
dist/conf/ghostscript/lib/traceimg.ps
vendored
41
dist/conf/ghostscript/lib/traceimg.ps
vendored
@@ -1,41 +0,0 @@
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% 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.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% traceimg.ps
|
||||
% Trace the data supplied to the 'image' operator.
|
||||
|
||||
% This code currently handles only the (Level 2) dictionary form of image,
|
||||
% with a single data source and 8-bit pixels.
|
||||
|
||||
/traceimage % <dict> traceimage -
|
||||
{ currentcolorspace == (setcolorspace\n) print
|
||||
(<<) print
|
||||
dup { (\t) print exch ==only ( ) print == } forall
|
||||
(>>\n) print flush
|
||||
begin /i_left Width Height mul store /i_dict currentdict store end
|
||||
{ i_left 0 le { exit } if
|
||||
i_dict /DataSource get exec
|
||||
dup type /filetype eq
|
||||
{ i_buf 0 i_left 32 .min getinterval readstring pop
|
||||
} if
|
||||
dup (%stdout) (w) file exch writehexstring (\n) print flush
|
||||
i_left exch length sub /i_left exch def
|
||||
} loop
|
||||
} bind odef
|
||||
|
||||
/image /traceimage load def
|
||||
/i_left 0 def
|
||||
/i_dict null def
|
||||
/i_buf 32 string def
|
||||
82
dist/conf/ghostscript/lib/traceop.ps
vendored
82
dist/conf/ghostscript/lib/traceop.ps
vendored
@@ -1,82 +0,0 @@
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% 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.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Trace individual operators or procedures.
|
||||
% <opref> is <opname> or <opname> <dict>
|
||||
% (dict defaults to dict where op is currently defined, if writable;
|
||||
% otherwise uses userdict)
|
||||
% <opref> traceop prints vmem usage before;
|
||||
% <opref> <numargs|preproc> prints arguments or runs proc before;
|
||||
% <opref> <numargs|preproc> <numresults|postproc>
|
||||
% also prints results or runs proc after.
|
||||
% If traceflush is true, flush the output after each printout.
|
||||
/traceflush true def
|
||||
|
||||
currentpacking true setpacking
|
||||
currentglobal true setglobal
|
||||
|
||||
% Define the default "before" action
|
||||
/tracebefore { vmstatus 3 traceprint pop pop pop } def
|
||||
|
||||
% Define the default "after" action
|
||||
/traceafter { } def
|
||||
|
||||
/traceprint {
|
||||
dup type /integertype eq {
|
||||
1 sub -1 0 { ( ) print index ==only } for
|
||||
} {
|
||||
exec
|
||||
} ifelse
|
||||
} bind def
|
||||
/traceend {
|
||||
traceflush { flush } if
|
||||
} bind def
|
||||
/traceop {
|
||||
userdict begin
|
||||
dup type dup /nametype eq exch /dicttype eq or { { tracebefore } } if
|
||||
1 index type dup /nametype eq exch /dicttype eq or { { traceafter } } if
|
||||
/.tpost exch def /.tpre exch def
|
||||
dup type /dicttype ne {
|
||||
dup where not { userdict 1 index {} put userdict } if
|
||||
} if
|
||||
dup dup wcheck not {
|
||||
(Warning: substituting userdict for non-writable dictionary.) =
|
||||
pop userdict
|
||||
} if
|
||||
/.tddict exch def /.tdict exch def /.tname exch cvlit def
|
||||
currentglobal [
|
||||
.tname /=only cvx ( ) /print cvx
|
||||
/.tpre load /traceprint cvx /traceend cvx
|
||||
.tdict .tname get /.tdef 1 index cvlit def
|
||||
dup xcheck {
|
||||
dup type dup /arraytype eq exch /packedarraytype eq or {
|
||||
/exec cvx
|
||||
} if
|
||||
} if
|
||||
/.tpost load /traceprint cvx () /= cvx /traceend cvx
|
||||
.tdef gcheck /.tpre load gcheck and /.tpost load gcheck and setglobal
|
||||
] cvx
|
||||
.tdef type /operatortype eq {
|
||||
.tname exch .makeoperator
|
||||
} if
|
||||
exch setglobal
|
||||
.tddict exch .tname exch put
|
||||
end % userdict
|
||||
} bind def
|
||||
/tracebind /bind load def % in case someone wants to put it back
|
||||
/bind { } def % disable
|
||||
|
||||
setglobal
|
||||
setpacking
|
||||
219
dist/conf/ghostscript/lib/uninfo.ps
vendored
219
dist/conf/ghostscript/lib/uninfo.ps
vendored
@@ -1,219 +0,0 @@
|
||||
%!
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% 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.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% uninfo.ps: Utilities for "printing" PostScript items, especially dictionaries
|
||||
% Usage:
|
||||
% (prefix-string) dict unprint
|
||||
|
||||
% Maximum Print-Width
|
||||
/HSpwidth 80 def
|
||||
|
||||
% any HScvs string
|
||||
/HScvs {
|
||||
% Number-Syntax
|
||||
dup type % stack: any /anytype
|
||||
dup /integertype eq 1 index /realtype eq or { pop
|
||||
16 string cvs
|
||||
}{
|
||||
% Logical-Type
|
||||
dup /booleantype eq { pop
|
||||
5 string cvs
|
||||
}{
|
||||
% Identifiers
|
||||
dup /nametype eq { pop
|
||||
dup length 1 add string
|
||||
dup 0 (/) putinterval
|
||||
exch 1 index 1 1 index length 1 sub getinterval cvs pop
|
||||
}{
|
||||
% Strings
|
||||
dup /stringtype eq { pop
|
||||
% ------- Compute Length
|
||||
2 1 index { % stack: str len item
|
||||
dup 32 lt 1 index 126 gt or { % need 4
|
||||
pop 4 add
|
||||
}{
|
||||
dup 40 eq 1 index 41 eq or 1 index 92 eq or {
|
||||
pop 2 add
|
||||
}{
|
||||
pop 1 add
|
||||
} ifelse
|
||||
} ifelse
|
||||
} forall
|
||||
% ------- Allocate & Fill String
|
||||
string dup 0 (\() putinterval 1
|
||||
3 -1 roll { % outstr pos item
|
||||
dup 32 lt 1 index 126 gt or {
|
||||
dup 7 le {
|
||||
2 index 2 index (\\00) putinterval
|
||||
8 3 index 3 index 3 add 1 getinterval cvrs
|
||||
}{
|
||||
dup 63 le {
|
||||
2 index 2 index (\\0) putinterval
|
||||
8 3 index 3 index 2 add 2 getinterval cvrs
|
||||
}{
|
||||
2 index 2 index (\\) putinterval
|
||||
8 3 index 3 index 1 add 3 getinterval cvrs
|
||||
} ifelse
|
||||
} ifelse
|
||||
pop 4 add
|
||||
}{
|
||||
dup 40 eq 1 index 41 eq or 1 index 92 eq or {
|
||||
2 index 2 index (\\) putinterval
|
||||
exch 1 add exch
|
||||
} if
|
||||
2 index exch 2 index exch put
|
||||
1 add
|
||||
} ifelse
|
||||
} forall
|
||||
1 index exch (\)) putinterval
|
||||
}{ exch pop
|
||||
dup length 1 add string
|
||||
dup 0 (-) putinterval
|
||||
exch 1 index 1 1 index length 1 sub getinterval cvs pop
|
||||
dup dup length 4 sub (-) putinterval
|
||||
0 1 index length 3 sub getinterval
|
||||
} ifelse
|
||||
} ifelse
|
||||
} ifelse
|
||||
} ifelse
|
||||
} bind def
|
||||
|
||||
% int HSpindent - indent-spaces
|
||||
/HSpindent {
|
||||
dup 0 gt {
|
||||
1 1 3 -1 roll { pop ( ) print } for
|
||||
}{
|
||||
pop
|
||||
} ifelse
|
||||
} bind def
|
||||
|
||||
% indent array HSaprint -> Print an Array
|
||||
/HSaprint {
|
||||
dup type /arraytype eq {
|
||||
( [) print
|
||||
exch 1 add dup 1 add
|
||||
3 -1 roll { % rind pos item
|
||||
HScvs dup length % rind pos str len
|
||||
dup 3 index add HSpwidth ge {
|
||||
(\n) print
|
||||
3 index HSpindent
|
||||
3 -1 roll pop
|
||||
2 index add
|
||||
exch
|
||||
}{
|
||||
( ) print
|
||||
2 index add 1 add
|
||||
3 -1 roll pop
|
||||
exch
|
||||
} ifelse
|
||||
print
|
||||
} forall
|
||||
( ]) print
|
||||
pop pop
|
||||
}{
|
||||
( ) print
|
||||
HScvs print pop
|
||||
} ifelse
|
||||
(\n) print
|
||||
} bind def
|
||||
|
||||
% dict HSdnames dict names (creates sorted name-strings)
|
||||
/HSdnames {
|
||||
% Build namelist, stack: dic
|
||||
dup length 0 eq {
|
||||
[]
|
||||
}{
|
||||
[ 1 index {
|
||||
pop dup type /nametype eq {
|
||||
dup length string cvs
|
||||
}{
|
||||
pop
|
||||
} ifelse
|
||||
} forall
|
||||
]
|
||||
% Sort the namelist, stack: dic nam
|
||||
0 1 2 index length 2 sub { % stack: dic nam I
|
||||
2 copy get % stack: pre dic nam I nam[I]
|
||||
1 index 1 add 1 4 index length 1 sub { % stack: dic nam I nam[I] J
|
||||
3 index 1 index get % dic nam I S[I] J S[J]
|
||||
2 index 1 index gt { % swap them
|
||||
4 index 2 index 4 index put
|
||||
4 index 4 index 2 index put
|
||||
3 1 roll
|
||||
} if
|
||||
pop pop
|
||||
} for
|
||||
pop pop
|
||||
} for
|
||||
} ifelse
|
||||
} bind def
|
||||
|
||||
% string:prefix dict:which unprint
|
||||
/unprint {
|
||||
HSdnames % pre dic nam
|
||||
% compute the maximum length
|
||||
0 1 index { % pre dic nam maxlen nam[I]
|
||||
length 2 copy lt { exch } if pop
|
||||
} forall
|
||||
% Print out all the items, stack: pre dic nam maxlen
|
||||
(\n) print
|
||||
exch { % pre dic maxlen nam[I]
|
||||
% no prefix yet, -> flush right
|
||||
3 index length 0 eq {
|
||||
dup length 2 index exch sub HSpindent
|
||||
}{
|
||||
3 index print (/) print
|
||||
} ifelse
|
||||
% print the name
|
||||
dup print
|
||||
% prefix: fill up with blanks
|
||||
3 index length 0 ne {
|
||||
dup length 2 index exch sub HSpindent
|
||||
} if
|
||||
% now print the item itself, stack: pre dic maxlen nam[I]
|
||||
2 index 1 index cvn get dup type % stack: pre dic maxlen nam[i] item typ
|
||||
% Dict-Syntax
|
||||
dup /dicttype eq { pop % stack: pre dic maxlen nam[i] item
|
||||
( ) print dup HScvs print
|
||||
4 index length 0 eq { % brand new prefix
|
||||
2 index string 0 1 5 index 1 sub { 1 index exch 32 put } for
|
||||
dup 4 index 4 index length sub 5 -1 roll putinterval
|
||||
}{
|
||||
4 index length 1 add 2 index length add string
|
||||
dup 0 7 index putinterval
|
||||
dup 6 index length (/) putinterval
|
||||
dup 6 index length 1 add 5 -1 roll putinterval
|
||||
} ifelse
|
||||
exch unprint
|
||||
}{
|
||||
3 -1 roll pop % tack: pre dic maxlen item typ
|
||||
% Array-Syntax
|
||||
dup /arraytype eq { pop % stack: pre dic maxlen item
|
||||
3 index length dup 0 ne { 1 add } if 2 index add
|
||||
exch HSaprint
|
||||
}{ pop
|
||||
( ) print
|
||||
HScvs print
|
||||
(\n) print
|
||||
} ifelse
|
||||
} ifelse
|
||||
} forall
|
||||
pop pop length -1 eq { (\n) print } if
|
||||
} bind def
|
||||
|
||||
/currentpagedevice where { % check for currentpagedevice
|
||||
/currentpagedevice get exec () exch unprint
|
||||
} if
|
||||
64
dist/conf/ghostscript/lib/viewcmyk.ps
vendored
64
dist/conf/ghostscript/lib/viewcmyk.ps
vendored
@@ -1,64 +0,0 @@
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% 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.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% viewcmyk.ps
|
||||
% Display a raw CMYK file.
|
||||
% Requires the colorimage operator.
|
||||
% If SCALE is defined, maps input pixels to output pixels with that scale;
|
||||
% if SCALE is undefined, scales the image to fit the page.
|
||||
% If BITS is defined, it is the number of bits per sample (1,2,4,8,12);
|
||||
% if BITS is undefined, its default value is 1.
|
||||
|
||||
/viewcmyk { % <filename> <width> viewcmyk -
|
||||
20 dict begin
|
||||
/w exch def
|
||||
/fname exch def
|
||||
/bpc /BITS where { pop BITS } { 1 } ifelse def
|
||||
/f fname (r) file def
|
||||
mark fname status pop pop pop /flen exch def cleartomark
|
||||
/h flen w bpc 4 mul mul 7 add 8 idiv idiv def
|
||||
(Dimensions: ) print [w h] == flush
|
||||
% Set up scaling.
|
||||
/SCALE where {
|
||||
pop
|
||||
% Map pixels SCALE-for-1. Assume orthogonal transformation.
|
||||
SCALE 1 0 dtransform add abs div
|
||||
SCALE 0 1 dtransform add abs div
|
||||
} {
|
||||
% Scale the image (uniformly) to fit the page.
|
||||
clippath pathbbox pop pop translate
|
||||
pathbbox 3 -1 roll sub h div
|
||||
3 1 roll exch sub w div .min dup
|
||||
} ifelse scale
|
||||
w h bpc [1 0 0 -1 0 h] f false 4 colorimage
|
||||
showpage
|
||||
f closefile
|
||||
end
|
||||
} bind def
|
||||
|
||||
% If the program was invoked from the command line, run it now.
|
||||
[ .shellarguments {
|
||||
counttomark 2 eq {
|
||||
cvi viewcmyk
|
||||
} {
|
||||
cleartomark
|
||||
(Usage: gs -- viewcmyk.ps filename.cmyk width\n) print
|
||||
( e.g.: gs -- viewcmyk.ps my.cmyk 2550\n) print flush
|
||||
(From version 9.50 you must supply permissions for this program to read the input file(s)\n) print flush
|
||||
(either by using -dNOSAFER or by supplying --permit-file-read=<filename>\n) = flush
|
||||
} ifelse
|
||||
} {
|
||||
pop
|
||||
} ifelse
|
||||
180
dist/conf/ghostscript/lib/viewgif.ps
vendored
180
dist/conf/ghostscript/lib/viewgif.ps
vendored
@@ -1,180 +0,0 @@
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% 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.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% viewgif.ps
|
||||
% Display a GIF file.
|
||||
|
||||
/read1 % <file> read1 <int>
|
||||
{ read pop
|
||||
} bind def
|
||||
/read2 % <file> read2 <int>
|
||||
{ dup read1 exch read1 8 bitshift add
|
||||
} bind def
|
||||
|
||||
/readGIFheader % <file> readGIFheader <dict>
|
||||
{ 20 dict begin
|
||||
dup 6 string readstring pop
|
||||
dup (GIF87a) eq exch (GIF89a) eq or not
|
||||
{ (Not a GIF file.\n) print cleartomark stop
|
||||
} if
|
||||
dup read2 /Width exch def
|
||||
dup read2 /Height exch def
|
||||
dup read1
|
||||
dup 128 ge /GlobalColor exch def
|
||||
dup -4 bitshift 7 and 1 add /BitsPerPixel exch def %***BOGUS?***
|
||||
dup 8 and 0 ne /PaletteSorted exch def
|
||||
7 and 1 add dup /BitsPerPixel exch def
|
||||
1 exch bitshift /PaletteSize exch def
|
||||
dup read1 /BackgroundIndex exch def
|
||||
dup read1 15 add 64 div /AspectRatio exch def
|
||||
GlobalColor
|
||||
{ PaletteSize 3 mul string readstring pop
|
||||
/GlobalPalette exch def
|
||||
} {
|
||||
pop
|
||||
} ifelse
|
||||
currentdict end
|
||||
} bind def
|
||||
|
||||
/readGIFimageHeader % <file> readGIFimageHeader <dict>
|
||||
% Note: GIF header must be on dict stack
|
||||
{ 10 dict begin
|
||||
{ dup read1
|
||||
dup (!) 0 get ne { exit } if pop % extension
|
||||
dup read1 pop
|
||||
{ dup read1 dup 0 eq { pop exit } if { dup read1 pop } repeat
|
||||
} loop
|
||||
} loop
|
||||
(,) 0 get ne
|
||||
{ (Not a GIF image.\n) print stop
|
||||
} if
|
||||
dup read2 /Left exch def
|
||||
dup read2 /Top exch def
|
||||
dup read2 /Width exch def
|
||||
dup read2 /Height exch def
|
||||
dup read1
|
||||
dup 128 ge /LocalColor exch def
|
||||
dup 64 and 0 ne /Interlaced exch def
|
||||
LocalColor
|
||||
{ 7 and 1 add /BitsPerPixel exch def
|
||||
1 BitsPerPixel bitshift 3 mul string readstring pop
|
||||
/Palette exch def
|
||||
}
|
||||
{ pop pop /Palette GlobalPalette def
|
||||
}
|
||||
ifelse
|
||||
currentdict end
|
||||
} bind def
|
||||
|
||||
/imageGIF % <imagedict> imageGIF
|
||||
{ /ImageOut where
|
||||
{ pop
|
||||
% We know BitsPerComponent = 8, Decode = [0 255].
|
||||
% and there is only a single data source which is
|
||||
% either a filter or a string whose size is exactly
|
||||
% the width of the row.
|
||||
dup /DataSource get dup type /stringtype eq
|
||||
{ ImageOut exch writestring
|
||||
}
|
||||
{ pop dup /Width get string
|
||||
1 index /Height get
|
||||
{ 1 index /DataSource get 1 index readstring pop
|
||||
ImageOut exch writestring
|
||||
}
|
||||
repeat pop pop
|
||||
}
|
||||
ifelse
|
||||
}
|
||||
{ image
|
||||
}
|
||||
ifelse
|
||||
} bind def
|
||||
|
||||
/viewGIF % <file|string> viewGIF -
|
||||
{ save 20 dict begin
|
||||
/saved exch def
|
||||
dup type /stringtype eq { (r) file } if
|
||||
/F exch def
|
||||
/ImageOutFile where { /ImageOut ImageOutFile (w) file def } if
|
||||
F readGIFheader /Header exch def
|
||||
currentdict Header end begin begin
|
||||
VGIFDEBUG { Header { exch == == } forall (----------------\n) print flush } if
|
||||
F readGIFimageHeader /ImageHeader exch def
|
||||
currentdict ImageHeader end begin begin
|
||||
VGIFDEBUG { ImageHeader { exch == == } forall (----------------\n) print flush } if
|
||||
/D F
|
||||
<< /InitialCodeLength F read1
|
||||
/FirstBitLowOrder true
|
||||
/BlockData true
|
||||
/EarlyChange 0
|
||||
>> /LZWDecode filter def
|
||||
|
||||
[/Indexed /DeviceRGB 1 BitsPerPixel bitshift 1 sub Palette] setcolorspace
|
||||
matrix currentmatrix
|
||||
0 1 3 { 2 copy get dup 0 ne { dup abs div } if 3 copy put pop pop } for
|
||||
setmatrix
|
||||
<< /ImageType 1
|
||||
/ImageMatrix [1 0 0 -1 0 Height]
|
||||
/BitsPerComponent 8
|
||||
/Decode [0 255]
|
||||
Interlaced
|
||||
{ /Width Width /Height 1
|
||||
/row Width string def
|
||||
/DataSource row
|
||||
>> /I exch def
|
||||
/inter % <num> <denom> inter -
|
||||
{ /denom exch def /num exch def
|
||||
gsave
|
||||
/lines Height denom 1 sub add num sub denom idiv def
|
||||
0 1 lines 1 sub {
|
||||
Height exch denom mul num add sub
|
||||
I /ImageMatrix get 5 3 -1 roll put
|
||||
D row readstring pop pop
|
||||
I imageGIF
|
||||
} for
|
||||
grestore
|
||||
}
|
||||
bind def
|
||||
0 8 inter
|
||||
4 8 inter
|
||||
2 4 inter
|
||||
1 2 inter
|
||||
}
|
||||
{ /Width Width /Height Height
|
||||
/DataSource D
|
||||
>> imageGIF
|
||||
}
|
||||
ifelse
|
||||
saved end end end restore
|
||||
} bind def
|
||||
|
||||
% This lets you do stuff on the command line like:
|
||||
% gs -sDEVICE=pdfwrite -o stuff%03d.pdf viewgif.ps -c "(image.gif) << /PageSize 2 index viewGIFgetsize 2 array astore /HWResolution [ 72 72 ] >> setpagedevice viewGIF"
|
||||
% so the output size is influenced by the original image.
|
||||
/viewGIFgetsize % <file|string> ==> [width height]
|
||||
{
|
||||
save 20 dict begin
|
||||
/saved exch def
|
||||
dup type /stringtype eq { (r) file } if
|
||||
/F exch def
|
||||
F readGIFheader /Header exch def
|
||||
currentdict Header end begin begin
|
||||
VGIFDEBUG { Header { exch == == } forall (----------------\n) print flush } if
|
||||
F readGIFimageHeader /ImageHeader exch def
|
||||
currentdict ImageHeader end begin begin
|
||||
F 0 setfileposition % reset file pointer
|
||||
Width Height
|
||||
saved end end end restore
|
||||
} bind def
|
||||
176
dist/conf/ghostscript/lib/viewjpeg.ps
vendored
176
dist/conf/ghostscript/lib/viewjpeg.ps
vendored
@@ -1,176 +0,0 @@
|
||||
%! viewjpeg.ps Copyright (C) 1994 Thomas Merz <tm@pdflib.com>
|
||||
%
|
||||
% 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., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA.
|
||||
|
||||
% View JPEG files with Ghostscript
|
||||
%
|
||||
% This PostScript code relies on level 2 features.
|
||||
%
|
||||
% Only JPEG baseline, extended sequential, and progressive files
|
||||
% are supported. Note that Adobe PostScript level 2 does not include
|
||||
% progressive-JPEG support. Ghostscript with IJG JPEG v6 or later
|
||||
% will decode progressive JPEG, but only if you edit gsjmorec.h to
|
||||
% enable that feature.
|
||||
%
|
||||
% Author's address:
|
||||
% ------------------------------+
|
||||
% {(pstack exec quit) = flush } | Thomas Merz, Munich
|
||||
% pstack exec quit | voice +49/89/29160728
|
||||
% ------------------------------+ tm@muc.de http://www.muc.de/~tm/
|
||||
%
|
||||
% Updated by L. Peter Deutsch 20-May-1997:
|
||||
% move the usage example to the beginning
|
||||
% Updates by Tom Lane 6-Sep-1995
|
||||
|
||||
% Usage example:
|
||||
% (jpeg-6/testimg.jpg) viewJPEG
|
||||
% From version 9.50 you must supply permissions for this program
|
||||
% to read the input file(s) either by using -dNOSAFER or by
|
||||
% supplying --permit-file-read=<filename>
|
||||
|
||||
/languagelevel where {pop languagelevel 2 lt}{true} ifelse {
|
||||
(JPEG needs PostScript Level 2!\n) print flush stop
|
||||
} if
|
||||
|
||||
/JPEGdict 20 dict def
|
||||
JPEGdict begin
|
||||
|
||||
/NoParamMarkers [ % JPEG markers without additional parameters
|
||||
16#D0 16#D1 16#D2 16#D3 16#D4 16#D5 16#D6 16#D7 16#D8 16#01
|
||||
] def
|
||||
|
||||
/NotSupportedMarkers [ % JPEG markers not supported by PostScript level 2
|
||||
16#C3 16#C5 16#C6 16#C7 16#C8 16#C9 16#CA 16#CB 16#CD 16#CE 16#CF
|
||||
] def
|
||||
|
||||
% Names of color spaces
|
||||
/ColorSpaceNames << /1 /DeviceGray /3 /DeviceRGB /4 /DeviceCMYK >> def
|
||||
|
||||
% read one byte from file F
|
||||
% - ==> int --or-- stop context
|
||||
/NextByte {
|
||||
F read not { (Read error in ViewJPEG!\n) print flush stop } if
|
||||
} bind def
|
||||
|
||||
/SkipSegment { % read two bytes and skip that much data
|
||||
NextByte 8 bitshift NextByte add 2 sub { NextByte pop } repeat
|
||||
} bind def
|
||||
|
||||
% read width, height, and # of components from JPEG markers
|
||||
% and store in dict
|
||||
/readJPEGmarkers { % - ==> dict --or-- stop context
|
||||
5 dict begin
|
||||
|
||||
{ % loop: read JPEG marker segments until we find SOFn marker or EOF
|
||||
NextByte
|
||||
16#FF eq { % found marker
|
||||
/markertype NextByte def
|
||||
% Is it S0F0=baseline, SOF1=extended sequential, SOF2=progressive ?
|
||||
markertype dup 16#C0 ge exch 16#C2 le and {
|
||||
NextByte pop NextByte pop % segment length
|
||||
% Ghostscript and Adobe PS accept only data precision 8
|
||||
NextByte 8 ne {
|
||||
(Error: not 8 bits per component!\n) print flush stop
|
||||
} if
|
||||
|
||||
% Read crucial image parameters
|
||||
/height NextByte 8 bitshift NextByte add def
|
||||
/width NextByte 8 bitshift NextByte add def
|
||||
/colors NextByte def
|
||||
|
||||
VJPGDEBUG { currentdict { exch == == } forall flush } if
|
||||
exit
|
||||
} if
|
||||
|
||||
% detect several segment types which are not compatible with PS
|
||||
NotSupportedMarkers {
|
||||
markertype eq {
|
||||
(Marker ) print markertype ==
|
||||
(not supported!\n) print flush stop
|
||||
} if
|
||||
} forall
|
||||
|
||||
% Skip segment if marker has parameters associated with it
|
||||
true NoParamMarkers { markertype eq {pop false exit} if } forall
|
||||
{ SkipSegment } if
|
||||
} if
|
||||
} loop
|
||||
|
||||
currentdict dup /markertype undef
|
||||
end
|
||||
} bind def
|
||||
|
||||
end % JPEGdict
|
||||
|
||||
% read image parameters from JPEG file and display the image
|
||||
/viewJPEG { % <file|string> ==> -
|
||||
save
|
||||
JPEGdict begin
|
||||
/saved exch def
|
||||
/scratch 1 string def
|
||||
dup type /stringtype eq { (r) file } if
|
||||
/F exch def
|
||||
|
||||
readJPEGmarkers begin
|
||||
F 0 setfileposition % reset file pointer
|
||||
|
||||
% We use the whole clipping area for the image (at least in one dimension)
|
||||
gsave clippath pathbbox grestore
|
||||
/ury exch def /urx exch def
|
||||
/lly exch def /llx exch def
|
||||
|
||||
llx lly translate
|
||||
width height scale
|
||||
|
||||
% use whole width or height, whichever is appropriate
|
||||
urx llx sub width div ury lly sub height div
|
||||
2 copy gt { exch } if pop % min
|
||||
dup scale
|
||||
ColorSpaceNames colors scratch cvs get setcolorspace
|
||||
|
||||
% prepare image dictionary
|
||||
<< /ImageType 1
|
||||
/Width width
|
||||
/Height height
|
||||
/ImageMatrix [ width 0 0 height neg 0 height ]
|
||||
/BitsPerComponent 8
|
||||
% If 4-component (CMYK), assume data is inverted per Adobe Photoshop
|
||||
colors 4 eq {
|
||||
/Decode [ colors { 1 0 } repeat ]
|
||||
} {
|
||||
/Decode [ colors { 0 1 } repeat ]
|
||||
} ifelse
|
||||
/DataSource F /DCTDecode filter
|
||||
>> image
|
||||
|
||||
end % image parameter dictionary
|
||||
|
||||
saved end restore
|
||||
} bind def
|
||||
|
||||
% This lets you do stuff on the command line like:
|
||||
% gs -sDEVICE=pdfwrite -o stuff%03d.pdf viewjpeg.ps -c "(image.jpg) << /PageSize 2 index viewJPEGgetsize 2 array astore /HWResolution [ 72 72 ] >> setpagedevice viewJPEG"
|
||||
% so the output size matches the original image.
|
||||
/viewJPEGgetsize { % <file|string> ==> width height
|
||||
save
|
||||
JPEGdict begin
|
||||
/saved exch def
|
||||
/scratch 1 string def
|
||||
dup type /stringtype eq { (r) file } if
|
||||
/F exch def
|
||||
readJPEGmarkers begin
|
||||
F 0 setfileposition % reset file pointer
|
||||
width height
|
||||
saved end restore
|
||||
} bind def
|
||||
137
dist/conf/ghostscript/lib/viewmiff.ps
vendored
137
dist/conf/ghostscript/lib/viewmiff.ps
vendored
@@ -1,137 +0,0 @@
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% 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.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% viewmiff.ps
|
||||
% Display a MIFF file. You would think the 'display' command would do this,
|
||||
% but many versions of 'display' either core-dump or require unacceptably
|
||||
% large amounts of memory.
|
||||
% FITPAGE is true, it fits the output page size to the image
|
||||
|
||||
% Recognize MIFF keywords.
|
||||
/miffwords mark
|
||||
/class { cvn /class exch def }
|
||||
/colors { cvi /colors exch def }
|
||||
/columns { cvi /Width exch def }
|
||||
/compression { cvn /compression exch def }
|
||||
/depth { cvi /depth exch def }
|
||||
/packets { cvi /packets exch def }
|
||||
/rows { cvi /Height exch def }
|
||||
.dicttomark readonly def
|
||||
|
||||
% Recognize MIFF image classes.
|
||||
/miffclasses mark
|
||||
/DirectClass {
|
||||
/DeviceRGB setcolorspace
|
||||
/BitsPerComponent depth def
|
||||
/Decode [ 0 1 0 1 0 1 ] def
|
||||
}
|
||||
/PseudoClass {
|
||||
[ /Indexed
|
||||
% The MIFF documentation lies about the size of pixels
|
||||
% for this case: the pixel size is determined only by
|
||||
% the number of colors, and is not affected by the image
|
||||
% depth. Specifically, if there are 256 or fewer colors
|
||||
% but the depth (of color map entries) is 16, each pixel
|
||||
% is still only 1 byte, not 2.
|
||||
currentdict /colors known {
|
||||
/DeviceRGB colors 1 sub
|
||||
/BitsPerComponent colors 256 le { 8 } { 16 } ifelse def
|
||||
colors 3 mul string depth 8 eq {
|
||||
f exch readstring pop
|
||||
} {
|
||||
% 16-bit color map entries: take only the high-order byte.
|
||||
0 1 2 index length 1 sub {
|
||||
f read pop 2 index 3 1 roll put f read pop pop
|
||||
} for
|
||||
} ifelse
|
||||
} {
|
||||
/colors 256 def
|
||||
/DeviceGray 255
|
||||
256 string 0 1 255 { 1 index exch dup put } for
|
||||
} ifelse
|
||||
] setcolorspace
|
||||
/Decode [ 0 1 BitsPerComponent bitshift 1 sub ] def
|
||||
}
|
||||
.dicttomark readonly def
|
||||
|
||||
% Recognize MIFF compression methods.
|
||||
/rlstring 768 string def
|
||||
/rlread {
|
||||
% packets is not reliable -- disregard it.
|
||||
dup rlstring 0 3 getinterval readstring {
|
||||
pop read pop 3 mul 3 3 2 index {
|
||||
rlstring exch rlstring 0 3 getinterval putinterval
|
||||
} for
|
||||
rlstring 0 3 -1 roll 3 add getinterval
|
||||
} {
|
||||
pop pop ()
|
||||
} ifelse
|
||||
} bind def
|
||||
/miffcompress mark
|
||||
/Uncompressed { f }
|
||||
/RunLengthEncoded { { f rlread } }
|
||||
/Zip { [ f /FlateDecode filter cvlit /rlread cvx ] cvx }
|
||||
.dicttomark readonly def
|
||||
|
||||
% Read a MIFF file and display the image.
|
||||
/viewmiff { % <filename> viewmiff -
|
||||
50 dict begin
|
||||
/fname 1 index def
|
||||
/f exch (r) file def
|
||||
% Set defaults.
|
||||
/ImageType 1 def
|
||||
/class /DirectClass def
|
||||
/compression /Uncompressed def
|
||||
/depth 8 def
|
||||
/packets 16#7fffffff def
|
||||
% Read and parse the header.
|
||||
{ f token pop
|
||||
dup (:) eq { pop exit } if
|
||||
dup type /nametype eq {
|
||||
1024 string cvs (=) search {
|
||||
exch pop miffwords exch .knownget { exec } { pop } ifelse
|
||||
} {
|
||||
pop % who knows?
|
||||
} ifelse
|
||||
} {
|
||||
pop % probably a comment in braces
|
||||
} ifelse
|
||||
} loop
|
||||
% Read and display the image.
|
||||
miffclasses class get exec
|
||||
/DataSource miffcompress compression get exec def
|
||||
/FITPAGE where
|
||||
{
|
||||
/FITPAGE get
|
||||
{
|
||||
% we've already set the image color space, so
|
||||
% push it on the stack, and set it again after
|
||||
% setting the page size
|
||||
currentcolorspace
|
||||
<</PageSize [Width Height] >> setpagedevice
|
||||
setcolorspace
|
||||
} if
|
||||
} if
|
||||
|
||||
/ImageMatrix [Width 0 0 Height neg 0 Height] def
|
||||
currentpagedevice /PageSize get
|
||||
dup 0 get exch 1 get scale
|
||||
gsave 0.8 setgray 0 0 1 1 rectfill grestore % provide background
|
||||
currentdict image
|
||||
showpage
|
||||
% Clean up.
|
||||
f closefile
|
||||
end
|
||||
} bind def
|
||||
337
dist/conf/ghostscript/lib/viewpbm.ps
vendored
337
dist/conf/ghostscript/lib/viewpbm.ps
vendored
@@ -1,337 +0,0 @@
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% 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.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% viewpbm.ps
|
||||
% Display a PBM/PGM/PPM file.
|
||||
% Requires the Level 2 `image' operator (to handle variable pixel widths).
|
||||
% If SCALE is defined, maps input pixels to output pixels with that scale;
|
||||
% if SCALE is undefined, scales the image to fit the page.
|
||||
% If FITPAGE true, it fits the output page size to the image, honouring SCALE
|
||||
% When the input is PAM (P7) RGBTAG from bitrgbtags device, -dTAG will show
|
||||
% the tags is pseudo color:
|
||||
% TEXT=1, IMAGE=2, PATH=4, UNTOUCHED=8
|
||||
% red green blue gray
|
||||
|
||||
/s 100 string def
|
||||
/readmaxv { % <file> readmaxv -
|
||||
10 string readline pop cvx exec /maxv exch def
|
||||
} bind def
|
||||
/readrow { % <file> <row> readrow <row>
|
||||
0 1 2 index length 1 sub {
|
||||
1 index exch 3 index token pop put
|
||||
} for exch pop
|
||||
} bind def
|
||||
/read01 { % <file> <count> read01 <byte>
|
||||
0 exch {
|
||||
1 index read pop 48 xor dup 1 le { exch dup add add } { pop } ifelse
|
||||
} repeat
|
||||
} bind def
|
||||
/readrow01 { % <file> <row> readrow01 <row>
|
||||
0 1 w 8 idiv {
|
||||
1 index exch 3 index 8 read01 put
|
||||
} for
|
||||
wrem 0 ne {
|
||||
dup rsize 1 sub wrem read01 8 wrem sub bitshift put
|
||||
} if
|
||||
exch pop
|
||||
} bind def
|
||||
/readwh { % <file> readwh <w> <h>
|
||||
dup s readline pop % check for comment
|
||||
(#) anchorsearch {
|
||||
pop pop dup s readline pop
|
||||
} if
|
||||
cvx exec
|
||||
} bind def
|
||||
/pbmtypes mark
|
||||
% The procedures in this dictionary are called as
|
||||
% <file> Pn <w> <h> <readproc>
|
||||
/P1 { % ASCII 1-bit white/black
|
||||
/bpc 1 def /maxv 1 def /rsize w 7 add 8 idiv def
|
||||
/wrem w 8 mod def
|
||||
/ncomp 1 def /invert true def /DeviceGray setcolorspace
|
||||
readwh
|
||||
{ readrow01 }
|
||||
} bind
|
||||
/P2 { % ASCII 8-bit gray
|
||||
readwh
|
||||
/bpc 8 def 2 index readmaxv /rsize 2 index def
|
||||
/ncomp 1 def /invert false def /DeviceGray setcolorspace
|
||||
{ readrow }
|
||||
} bind
|
||||
/P3 { % ASCII 8-bit RGB
|
||||
readwh
|
||||
/bpc 8 def 2 index readmaxv /rsize 2 index 3 mul def
|
||||
/ncomp 3 def /invert false def /DeviceRGB setcolorspace
|
||||
{ readrow }
|
||||
} bind
|
||||
/P4 { % Binary 1-bit white/black
|
||||
readwh
|
||||
/bpc 1 def /maxv 1 def /rsize 2 index 7 add 8 idiv def
|
||||
/ncomp 1 def /invert true def /DeviceGray setcolorspace
|
||||
{ readstring pop }
|
||||
} bind
|
||||
/P5 { % Binary 8-bit gray
|
||||
readwh
|
||||
/bpc 8 def 2 index readmaxv /rsize 2 index def
|
||||
/ncomp 1 def /invert false def /DeviceGray setcolorspace
|
||||
{ readstring pop }
|
||||
} bind
|
||||
/P6 { % Binary 8-bit RGB
|
||||
readwh
|
||||
/bpc 8 def 2 index readmaxv /rsize 2 index 3 mul def
|
||||
/ncomp 3 def /invert false def /DeviceRGB setcolorspace
|
||||
{ readstring pop }
|
||||
} bind
|
||||
/P7 { % Assume Binary 8-bit CMYK -- assumes 'pf' is the input file
|
||||
% P7
|
||||
% WIDTH 612 %% used to set rsize and w
|
||||
% HEIGHT 792 %% used to set h
|
||||
% DEPTH 4 %% if present and not 1 or 4, then bail
|
||||
% MAXVAL 255 %% used to set maxv
|
||||
% TUPLTYPE CMYK | RGB_TAG | RGB_ALPHA | GRAYSCALE %% if present and not one of these, then bail
|
||||
% ENDHDR %% skip everything else up to this
|
||||
/P7KEYS <<
|
||||
/WIDTH { /w pf token pop def }
|
||||
/HEIGHT { /h pf token pop def }
|
||||
/DEPTH { /d pf token pop def d 4 eq d 1 eq or not {
|
||||
(*** Only DEPTH 1 or 4 PAM files supported at this time. ***) = quit
|
||||
} if
|
||||
}
|
||||
/MAXVAL { /maxv pf token pop def }
|
||||
/TUPLTYPE { pf token pop dup /CMYK eq 1 index /RGB_TAG eq or 1 index /RGB_ALPHA eq or 1 index /GRAYSCALE eq or not {
|
||||
(*** Only CMYK, RGB_TAG, RGB_ALPHA and GRAYSCALE files supported at this time. ***) = quit
|
||||
} if
|
||||
/T exch def
|
||||
}
|
||||
/ENDHDR { exit }
|
||||
(#) cvn { pf 255 string readline pop pop }
|
||||
>> def
|
||||
{ pf token not { exit } if P7KEYS exch .knownget { exec } if } loop
|
||||
/bpc 8 def
|
||||
/rsize w 4 mul def % same bytes per line for CMYK or RGB_TAG
|
||||
/T load /CMYK eq {
|
||||
/ncomp 4 def /invert false def /DeviceCMYK setcolorspace
|
||||
w h { readstring pop }
|
||||
} if
|
||||
/T load /RGB_ALPHA eq {
|
||||
/ncomp 4 def /invert false def /DeviceCMYK setcolorspace
|
||||
w h { readstring pop }
|
||||
} if
|
||||
/T load /GRAYSCALE eq {
|
||||
/ncomp 1 def /invert false def /DeviceGray setcolorspace
|
||||
w h { readstring pop }
|
||||
} if
|
||||
/T load /RGB_TAG eq {
|
||||
% not CMYK, must be RGB_TAG since was checked above
|
||||
/TAG where {
|
||||
pop
|
||||
% show the tags as pseudo-color image
|
||||
/ncomp 1 def /invert false def /maxv 1 def
|
||||
[ /Indexed /DeviceRGB 255
|
||||
% UNTOUCHED=0, TEXT=1, IMAGE=2, PATH=4
|
||||
% gray red green blue
|
||||
768 string
|
||||
dup 0 <cccccc ff0000 00ff00 ffff00 0000ff ff00ff 00ffff ffffff 000000> putinterval
|
||||
] setcolorspace
|
||||
w h {
|
||||
readstring pop
|
||||
% discard all but the tag
|
||||
dup length 4 div cvi
|
||||
string % destination string
|
||||
0 1 2 index length 1 sub {
|
||||
2 index 1 index 4 mul get
|
||||
2 index exch 2 index exch
|
||||
put
|
||||
pop % done with pixel#
|
||||
} for
|
||||
exch pop
|
||||
}
|
||||
} {
|
||||
% show the image as RGB (ignore tags)
|
||||
/ncomp 3 def /invert false def /DeviceRGB setcolorspace
|
||||
w h {
|
||||
readstring pop
|
||||
% re-pack the RGB, discard the tag
|
||||
dup length 4 div 3 mul cvi string % destination string
|
||||
0 1 2 index length 3 idiv 1 sub {
|
||||
% stack: RGBTstring destRGBstring pixel#
|
||||
2 index 1 index 4 mul 4 getinterval
|
||||
1 3 getinterval % RGB values
|
||||
% stack RGBTstring destRGBstring pixel# RGBstring
|
||||
2 index exch 2 index 3 mul exch
|
||||
putinterval
|
||||
pop % done with pixel#
|
||||
} for
|
||||
exch pop
|
||||
}
|
||||
} ifelse
|
||||
} if
|
||||
} bind
|
||||
|
||||
.dicttomark readonly def
|
||||
/pbmsetup { % <file> <w> <h> <readproc> pbmsetup <imagedict>
|
||||
/readproc exch def
|
||||
/h exch def
|
||||
/w exch def
|
||||
/f exch def
|
||||
20 dict begin % image dictionary
|
||||
/ImageType 1 def
|
||||
/Width w def
|
||||
/Height h def
|
||||
/ImageMatrix [w 0 0 h neg 0 h] def
|
||||
/BitsPerComponent bpc def
|
||||
/Decode [ 0 255 maxv div invert { exch } if ncomp 1 sub { 2 copy } repeat ] def
|
||||
/DataSource [ f rsize string /readproc load /exec load ] cvx def
|
||||
currentdict end
|
||||
} def
|
||||
/imagescale { % <imagedict> imagescale -
|
||||
begin
|
||||
/SCALE where {
|
||||
pop
|
||||
/FITPAGE where {/FITPAGE get}{false} ifelse
|
||||
{
|
||||
Width SCALE mul Height SCALE mul
|
||||
}
|
||||
{
|
||||
% Map pixels SCALE-for-1. Assume orthogonal transformation.
|
||||
Width 1 0 dtransform add abs div SCALE mul
|
||||
Height 0 1 dtransform add abs div SCALE mul
|
||||
} ifelse
|
||||
} {
|
||||
/FITPAGE where {/FITPAGE get}{false} ifelse
|
||||
{
|
||||
% Scale the image (uniformly) to fit the page.
|
||||
clippath pathbbox pop pop translate % offset to the printable origin
|
||||
pathbbox 3 -1 roll sub exch 3 -1 roll sub exch
|
||||
% stack printable_width printable_height
|
||||
2 copy gt 3 1 roll .min exch
|
||||
% stack: min(printable_w, printable_h) landscape?
|
||||
{
|
||||
% printable height is less than width (landscape)
|
||||
dup Height Width gt {
|
||||
Width mul Height div exch
|
||||
} {
|
||||
Height mul Width div
|
||||
} ifelse
|
||||
} {
|
||||
% printable width is less than height (portrait)
|
||||
dup Height Width lt {
|
||||
Width mul Height div exch
|
||||
} {
|
||||
Height mul Width div
|
||||
} ifelse
|
||||
} ifelse
|
||||
}
|
||||
{
|
||||
0 0 translate
|
||||
612 792
|
||||
}
|
||||
ifelse
|
||||
}
|
||||
ifelse
|
||||
scale
|
||||
end
|
||||
} def
|
||||
|
||||
% Image a PBM file page by page.
|
||||
/viewpbm { % <filename> viewpbm -
|
||||
20 dict begin
|
||||
(r) file /pf exch def {
|
||||
pf token not { exit } if
|
||||
pbmtypes exch get pf exch exec pbmsetup
|
||||
currentcolorspace % preserve colorspace around setpagedevice
|
||||
/FITPAGE where
|
||||
{
|
||||
/FITPAGE get
|
||||
{
|
||||
/SCALE where
|
||||
{
|
||||
pop
|
||||
<< /PageSize [ 1 1 dtransform h SCALE mul exch abs div exch w SCALE mul exch abs div exch ] >>
|
||||
}
|
||||
{
|
||||
<< /PageSize [ 1 1 dtransform h exch abs div exch w exch abs div exch ] >>
|
||||
} ifelse
|
||||
setpagedevice
|
||||
} if
|
||||
} if
|
||||
setcolorspace % restore colorspave in case we did setpagedevice
|
||||
dup imagescale image showpage
|
||||
} loop
|
||||
end
|
||||
} def
|
||||
|
||||
% Reassemble a composite PBM file from the CMYK separations.
|
||||
/viewpsm {
|
||||
20 dict begin
|
||||
/fname exch def
|
||||
/sources [ 0 1 3 {
|
||||
/plane exch def
|
||||
/pf fname (r) file def
|
||||
pf pbmtypes pf token pop get exec
|
||||
% Stack: pf w h readproc
|
||||
plane {
|
||||
/readproc exch def /h exch def /w exch def pop
|
||||
/row rsize string def
|
||||
h { pf row readproc pop } repeat
|
||||
pf pbmtypes pf token pop get exec
|
||||
} repeat
|
||||
pbmsetup
|
||||
} for ] def
|
||||
/datas [ sources { /DataSource get 0 get } forall ] def
|
||||
/decode sources 0 get /Decode get
|
||||
dup 0 get exch 1 get add cvi 0 exch
|
||||
2 copy 4 copy 8 array astore def
|
||||
sources 0 get
|
||||
dup /MultipleDataSources true put
|
||||
dup /DataSource datas put
|
||||
dup /Decode decode put
|
||||
/DeviceCMYK setcolorspace
|
||||
/FITPAGE where
|
||||
{
|
||||
/FITPAGE get
|
||||
{
|
||||
/SCALE where
|
||||
{
|
||||
<</PageSize [w SCALE mul h SCALE mul]>>
|
||||
}
|
||||
{
|
||||
<</PageSize [w h]>>
|
||||
}ifelse
|
||||
setpagedevice
|
||||
} if
|
||||
} if
|
||||
dup imagescale image showpage
|
||||
end
|
||||
} def
|
||||
|
||||
% If the program was invoked from the command line, run it now.
|
||||
[ .shellarguments
|
||||
{ counttomark 1 ge
|
||||
{ ] { viewpbm } forall
|
||||
}
|
||||
{ cleartomark
|
||||
(Usage: gs [-dSCALE=#.#] [-dFITPAGE] [--] viewpbm.ps filename.p*m ...\n) print
|
||||
( e.g.: gs [-dSCALE=#.#] [-dFITPAGE] [--] viewpbm.ps my.ppm another.ppm\n) print flush
|
||||
( also -dTAG option can be used to show the pseudo-color tag image from a\n) print flush
|
||||
( P7 RGB_TAG PAM file created by the bitrgbtags device.\n) print flush
|
||||
(From version 9.50 you must supply permissions for this program to read the input file(s)\n) print flush
|
||||
(either by using -dNOSAFER or by supplying --permit-file-read=<filename>\n) = flush
|
||||
}
|
||||
ifelse
|
||||
}
|
||||
{ pop
|
||||
}
|
||||
ifelse
|
||||
193
dist/conf/ghostscript/lib/viewpcx.ps
vendored
193
dist/conf/ghostscript/lib/viewpcx.ps
vendored
@@ -1,193 +0,0 @@
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% 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.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% viewpcx.ps
|
||||
% Display a PCX file.
|
||||
% Requires the Level 2 `image' operator (to handle variable pixel widths).
|
||||
% If SCALE is defined, maps input pixels to output pixels with that scale;
|
||||
% if SCALE is undefined, scales the image to fit the page.
|
||||
% If FITPAGE is true it fits the output page size to the image, honouring SCALE
|
||||
% ****NOTE: does not handle multi-plane images with palette.
|
||||
|
||||
/pcxbytes [
|
||||
0 1 255 {
|
||||
64 string exch 0 1 63 {
|
||||
3 copy exch put pop
|
||||
} for pop
|
||||
} for
|
||||
] readonly def
|
||||
/readpcx { % - readpcx <str>
|
||||
f % gets replaced
|
||||
dup read not {
|
||||
pop ()
|
||||
} {
|
||||
dup 192 lt {
|
||||
( ) dup 0 4 -1 roll put exch pop
|
||||
} {
|
||||
192 sub //pcxbytes 3 -1 roll read pop get exch 0 exch getinterval
|
||||
} ifelse
|
||||
} ifelse
|
||||
} def
|
||||
/get2 % <string> <index> get2 <int>
|
||||
{ 2 copy get 3 1 roll 1 add get 8 bitshift add
|
||||
} bind def
|
||||
/dsproc
|
||||
{ df s readstring pop % s gets filled in
|
||||
s1 () ne { df s1 readstring pop pop } if % discard padding bytes
|
||||
} def % don't bind, must be writable
|
||||
/viewpcx % <filename> viewpcx -
|
||||
{ 100 dict begin
|
||||
/fname 1 index def
|
||||
/f exch (r) file def
|
||||
% Read and unpack the header.
|
||||
/header f 128 string readstring pop def
|
||||
/version header 1 get def
|
||||
/bpp header 3 get def
|
||||
/w header 8 get2 header 4 get2 sub 1 add def
|
||||
/h header 10 get2 header 6 get2 sub 1 add def
|
||||
/FITPAGE where
|
||||
{
|
||||
/FITPAGE get
|
||||
{
|
||||
5 dict begin
|
||||
/SCALE where
|
||||
{
|
||||
pop
|
||||
/Width w SCALE mul def
|
||||
/Height h SCALE mul def
|
||||
}
|
||||
{
|
||||
/Width w def
|
||||
/Height h def
|
||||
} ifelse
|
||||
% we've already set the image color space, so
|
||||
% push it on the stack, and set it again after
|
||||
% setting the page size
|
||||
<</PageSize [Width Height] >> setpagedevice
|
||||
end
|
||||
} if
|
||||
}
|
||||
{
|
||||
/FITPAGE false def
|
||||
} ifelse
|
||||
/nplanes header 65 get def
|
||||
/bpl header 66 get2 def
|
||||
/palinfo header 68 get2 def
|
||||
/nbits bpp nplanes mul def
|
||||
version 5 eq
|
||||
{ nbits 8 le
|
||||
{ /cspace
|
||||
[/Indexed /DeviceRGB 1 bpp bitshift 1 sub
|
||||
f fileposition
|
||||
1 nbits bitshift 3 mul string
|
||||
fname status pop pop pop exch pop
|
||||
1 index length sub f exch setfileposition
|
||||
f exch readstring pop
|
||||
exch f exch setfileposition
|
||||
] def
|
||||
/decode [0 cspace 2 get] def
|
||||
}
|
||||
{ /cspace /DeviceRGB def
|
||||
/decode [0 1 0 1 0 1] def
|
||||
}
|
||||
ifelse
|
||||
}
|
||||
{ /cspace
|
||||
[/Indexed /DeviceRGB 1 bpp bitshift 1 sub
|
||||
header 16 1 nbits bitshift 16 .min 3 mul getinterval
|
||||
] def
|
||||
/decode [0 cspace 2 get] def
|
||||
}
|
||||
ifelse
|
||||
% Set up scaling.
|
||||
/SCALE where
|
||||
{
|
||||
pop
|
||||
FITPAGE
|
||||
{
|
||||
% Map pixels SCALE-for-1. Assume orthogonal transformation.
|
||||
w SCALE mul
|
||||
h SCALE mul
|
||||
}
|
||||
{
|
||||
% Map pixels SCALE-for-1. Assume orthogonal transformation.
|
||||
w 1 0 dtransform add abs div SCALE mul
|
||||
h 0 1 dtransform add abs div SCALE mul
|
||||
} ifelse
|
||||
}
|
||||
{
|
||||
FITPAGE
|
||||
{
|
||||
w h
|
||||
}
|
||||
{
|
||||
% Scale the image (uniformly) to fit the page.
|
||||
clippath pathbbox pop pop translate
|
||||
pathbbox .min exch pop exch pop ceiling
|
||||
dup h w gt { w mul h div exch } { h mul w div } ifelse
|
||||
} ifelse
|
||||
}
|
||||
ifelse scale
|
||||
% Since the number of bytes per line is always even,
|
||||
% it may not match the width specification.
|
||||
/wbpl w bpp mul 7 add 8 idiv def
|
||||
% Define the data source procedure.
|
||||
/s1 bpl wbpl sub string def
|
||||
/df /readpcx load copyarray dup 0 f put cvx bind readonly
|
||||
0 () /SubFileDecode filter def
|
||||
/dsource [ nplanes
|
||||
{ /dsproc load copyarray
|
||||
dup 1 wbpl string put
|
||||
cvx bind readonly
|
||||
}
|
||||
repeat ] def
|
||||
% Construct the image dictionary.
|
||||
20 dict begin % image dictionary
|
||||
/ImageType 1 def
|
||||
/Width w def
|
||||
/Height h def
|
||||
/ImageMatrix [w 0 0 h neg 0 h] def
|
||||
/BitsPerComponent bpp def
|
||||
/Decode decode def
|
||||
/DataSource dsource dup length 1 gt
|
||||
{ /MultipleDataSources true def }
|
||||
{ 0 get }
|
||||
ifelse def
|
||||
currentdict end
|
||||
% Finally, display the image.
|
||||
cspace setcolorspace
|
||||
image
|
||||
showpage
|
||||
df closefile
|
||||
f closefile
|
||||
end
|
||||
} bind def
|
||||
|
||||
% If the program was invoked from the command line, run it now.
|
||||
[ .shellarguments
|
||||
{ counttomark 1 ge
|
||||
{ ] { viewpcx } forall
|
||||
}
|
||||
{ cleartomark
|
||||
(Usage: gs -- viewpcx.ps filename.pcx ...\n) print
|
||||
( e.g.: gs -- viewpcx.ps my.pcx another.pcx\n) print flush
|
||||
(From version 9.50 you must supply permissions for this program to read the input file(s)\n) print flush
|
||||
(either by using -dNOSAFER or by supplying --permit-file-read=<filename>\n) = flush
|
||||
}
|
||||
ifelse
|
||||
}
|
||||
{ pop
|
||||
}
|
||||
ifelse
|
||||
31
dist/conf/ghostscript/lib/viewps2a.ps
vendored
31
dist/conf/ghostscript/lib/viewps2a.ps
vendored
@@ -1,31 +0,0 @@
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% 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.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% Display a file produced by ps2ascii with no switch or with -dCOMPLEX.
|
||||
% This is just a procset to read in before the file to display.
|
||||
|
||||
/init { 0.1 0.1 scale } bind def
|
||||
init
|
||||
/next { currentfile token pop } bind def
|
||||
/F { next next pop next exch selectfont } bind def
|
||||
/P { showpage init } bind def
|
||||
/S
|
||||
{ next next moveto
|
||||
next dup stringwidth pop next exch div
|
||||
gsave 1 scale show grestore
|
||||
} bind def
|
||||
/C { next next next setrgbcolor } bind def
|
||||
/I { next next next next gsave 0.75 setgray rectfill grestore } bind def
|
||||
/R { next next next next rectfill } bind def
|
||||
189
dist/conf/ghostscript/lib/viewraw.ps
vendored
189
dist/conf/ghostscript/lib/viewraw.ps
vendored
@@ -1,189 +0,0 @@
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% 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.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% viewcmyk.ps
|
||||
% Display a raw CMYK file.
|
||||
% Requires the colorimage operator.
|
||||
% If SCALE is defined, maps input pixels to output pixels with that scale;
|
||||
% if SCALE is undefined, scales the image to fit the page.
|
||||
% If BITS is defined, it is the number of bits per sample (1,2,4,8);
|
||||
% if BITS is undefined, its default value is 1.
|
||||
% Colorspace defaults to cmyk, but -dGray or -dRGB can change it
|
||||
|
||||
/viewraw { % <filename> <ncomp> <width> viewraw -
|
||||
20 dict begin
|
||||
% Default ncomp is 4 == CMYK
|
||||
/w exch def
|
||||
/fname exch def
|
||||
/F fname (r) file def % the raw file
|
||||
/f /F load def % the usual DataSource
|
||||
/bpc /BITS where { pop BITS } { 1 } ifelse def
|
||||
/ncomp
|
||||
/Gray where
|
||||
{ pop 1 /CS /DeviceGray def } % DeviceGray is 1 component
|
||||
{ /RGB where
|
||||
{ pop 3 BITS 8 ge % DeviceRGB is 3 component, use Indexed for 1, 2, 4 BITS
|
||||
{ /CS /DeviceRGB def }
|
||||
{
|
||||
BITS 4 eq {
|
||||
/P 4096 3 mul string def % the palette
|
||||
0 1 15 { /r exch def
|
||||
0 1 15 { /g exch def
|
||||
0 1 15 { /b exch def
|
||||
r 256 mul g 16 mul add b add 3 mul % base of the triplet
|
||||
P 1 index r 17 mul put
|
||||
P 1 index 1 add g 17 mul put
|
||||
P exch 2 add b 17 mul put
|
||||
} for
|
||||
} for
|
||||
} for
|
||||
/CS
|
||||
[ /Indexed /DeviceRGB 4095 P ] def
|
||||
/BITS 12 def % change to 4 bit indexed
|
||||
% redefine the DataSource to pack the 16-bit values into 12-bit
|
||||
% The 'proc' returns 2 12-bit pixels in 3 bytes
|
||||
% This proc is needed for the output from -sDEVICE=bitrgb -dGrayValues=16
|
||||
/S3 3 string def
|
||||
/f {
|
||||
F read
|
||||
{
|
||||
256 mul F read
|
||||
pop add 16 mul S3 0 2 index 256 div cvi put
|
||||
240 and F read
|
||||
{ add S3 exch 1 exch put S3 2 F read pop put }
|
||||
{ S3 exch 1 exch put S3 2 0 put }
|
||||
ifelse
|
||||
S3
|
||||
}
|
||||
{ () }
|
||||
ifelse
|
||||
} bind def
|
||||
} if
|
||||
BITS 2 eq {
|
||||
/CS
|
||||
[ /Indexed /DeviceRGB 255 <
|
||||
000000 000055 0000AA 0000FF
|
||||
005500 005555 0055AA 0055FF
|
||||
00AA00 00AA55 00AAAA 00AAFF
|
||||
00FF00 00FF55 00FFAA 00FFFF
|
||||
550000 550055 5500AA 5500FF
|
||||
555500 555555 5555AA 5555FF
|
||||
55AA00 55AA55 55AAAA 55AAFF
|
||||
55FF00 55FF55 55FFAA 55FFFF
|
||||
AA0000 AA0055 AA00AA AA00FF
|
||||
AA5500 AA5555 AA55AA AA55FF
|
||||
AAAA00 AAAA55 AAAAAA AAAAFF
|
||||
AAFF00 AAFF55 AAFFAA AAFFFF
|
||||
FF0000 FF0055 FF00AA FF00FF
|
||||
FF5500 FF5555 FF55AA FF55FF
|
||||
FFAA00 FFAA55 FFAAAA FFAAFF
|
||||
FFFF00 FFFF55 FFFFAA FFFFFF
|
||||
|
||||
000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
|
||||
000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
|
||||
000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
|
||||
000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
|
||||
|
||||
000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
|
||||
000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
|
||||
000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
|
||||
000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
|
||||
|
||||
000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
|
||||
000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
|
||||
000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
|
||||
000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
|
||||
|
||||
000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
|
||||
000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
|
||||
000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
|
||||
000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
|
||||
>
|
||||
] def
|
||||
/BITS 8 def % change to 4 bit indexed
|
||||
} if
|
||||
BITS 1 eq {
|
||||
/CS
|
||||
[ /Indexed /DeviceRGB 15 <
|
||||
000000 0000FF 00FF00 00FFFF FF0000 FF00FF FFFF00 FFFFFF
|
||||
000000 0000FF 00FF00 00FFFF FF0000 FF00FF FFFF00 FFFFFF
|
||||
>
|
||||
] def
|
||||
/BITS 4 def % change to 4 bit indexed
|
||||
} if
|
||||
}
|
||||
ifelse
|
||||
}
|
||||
{ 4 /CS /DeviceCMYK def } % DeviceCMYK is 4 component
|
||||
ifelse
|
||||
}
|
||||
ifelse
|
||||
def
|
||||
|
||||
% Calculate Height from file length and width
|
||||
mark fname status pop pop pop /flen exch def cleartomark
|
||||
% NB: bitrgb writes 4 bits when BITS=1, 8 bits when BITS=2, 16 bits when BITS=4
|
||||
% presumably to keep values on nice boundaries this takes some fudging
|
||||
/h flen w bpc ncomp dup 3 eq bpc 8 lt and { 1 add } if mul mul 7 add 8 idiv idiv def
|
||||
%% (Dimensions: ) print [w h] == flush
|
||||
% Set up scaling.
|
||||
/SCALE where {
|
||||
pop
|
||||
% Map pixels SCALE-for-1. Assume orthogonal transformation.
|
||||
SCALE 1 0 dtransform add abs div
|
||||
SCALE 0 1 dtransform add abs div
|
||||
} {
|
||||
% Scale the image (uniformly) to fit the page.
|
||||
clippath pathbbox pop pop translate
|
||||
pathbbox 3 -1 roll sub h div
|
||||
3 1 roll exch sub w div .min dup
|
||||
} ifelse scale
|
||||
%% w h bpc [1 0 0 -1 0 h] f false ncomp colorimage
|
||||
CS setcolorspace
|
||||
<< /ImageType 1 /Width w /Height h /ImageMatrix [1 0 0 -1 0 h]
|
||||
/MultipleDataSources false /DataSource /f load /BitsPerComponent BITS
|
||||
/Decode
|
||||
bpc 1 eq { % inverted sense for 1 bit per component
|
||||
[ [0] [ 1 0 ] [0] [ 0 15 ] [ 0 1 0 1 0 1 0 1 ] ] ncomp get
|
||||
} if
|
||||
bpc 2 eq {
|
||||
[ [0] [ 0 1 ] [0] [ 0 255 ] [ 0 1 0 1 0 1 0 1 ] ] ncomp get
|
||||
} if
|
||||
bpc 4 eq {
|
||||
[ [0] [ 0 1 ] [0] [ 0 4095 ] [ 1 0 1 0 1 0 1 0 ] ] ncomp get
|
||||
} if
|
||||
bpc 8 ge {
|
||||
[ [0] [ 0 1 ] [0] [ 0 1 0 1 0 1 ] [ 1 0 1 0 1 0 1 0 ] ] ncomp get
|
||||
} if
|
||||
>> image
|
||||
showpage
|
||||
F closefile
|
||||
end
|
||||
} bind def
|
||||
|
||||
% If the program was invoked from the command line, run it now.
|
||||
[ .shellarguments {
|
||||
counttomark 2 eq {
|
||||
cvi viewraw
|
||||
} {
|
||||
cleartomark
|
||||
(Usage: gs -- viewraw filename.raw width\n) print
|
||||
( e.g.: gs -- viewraw my.raw 2550\n) print flush
|
||||
(From version 9.50 you must supply permissions for this program to read the input file(s)\n) print flush
|
||||
(either by using -dNOSAFER or by supplying --permit-file-read=<filename>\n) = flush
|
||||
} ifelse
|
||||
} {
|
||||
pop
|
||||
} ifelse
|
||||
151
dist/conf/ghostscript/lib/viewrgb.ps
vendored
151
dist/conf/ghostscript/lib/viewrgb.ps
vendored
@@ -1,151 +0,0 @@
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% 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.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
|
||||
% viewrgb.ps
|
||||
% Display a raw RGB file created by -sDEVICE=bitrgb.
|
||||
% If SCALE is defined, maps input pixels to output pixels with that scale;
|
||||
% if SCALE is undefined, scales the image to fit the page.
|
||||
% If BITS is defined, it is the number of bits per sample (1,2,8,12).
|
||||
% NB: BITS=4 (corresponding to -dGrayValues=16) is not supported.
|
||||
% if BITS is undefined, its default value is 1.
|
||||
|
||||
/viewrgb { % <filename> <width> viewrgb -
|
||||
20 dict begin
|
||||
/w exch def
|
||||
/fname exch def
|
||||
/bpc /BITS where { pop BITS } { 1 } ifelse def
|
||||
/f fname (r) file def
|
||||
mark fname status pop pop pop /flen exch def cleartomark
|
||||
/h flen
|
||||
w [ 0 4 8 0 0 0 0 0 24 ] bpc get
|
||||
dup 0 eq {
|
||||
(*** -dBITS=) print bpc =print ( is not supported. ***) = flush
|
||||
quit
|
||||
} if
|
||||
mul 7 add 8 idiv idiv def
|
||||
QUIET not { (Dimensions: ) print [w h] == flush } if
|
||||
% Set up scaling.
|
||||
/SCALE where {
|
||||
pop
|
||||
% Map pixels SCALE-for-1. Assume orthogonal transformation.
|
||||
SCALE 1 0 dtransform add abs div
|
||||
SCALE 0 1 dtransform add abs div
|
||||
} {
|
||||
% Scale the image (uniformly) to fit the page.
|
||||
clippath pathbbox pop pop translate
|
||||
pathbbox 3 -1 roll sub h div
|
||||
3 1 roll exch sub w div .min dup
|
||||
} ifelse scale
|
||||
bpc 1 eq {
|
||||
[ /Indexed /DeviceRGB 15 <
|
||||
000000
|
||||
0000FF
|
||||
00FF00
|
||||
00FFFF
|
||||
FF0000
|
||||
FF00FF
|
||||
FFFF00
|
||||
FFFFFF
|
||||
000000
|
||||
0000FF
|
||||
00FF00
|
||||
00FFFF
|
||||
FF0000
|
||||
FF00FF
|
||||
FFFF00
|
||||
FFFFFF
|
||||
>
|
||||
] setcolorspace
|
||||
/BPC 4 def % change to 4 bit indexed
|
||||
} {
|
||||
bpc 2 eq {
|
||||
[ /Indexed /DeviceRGB 255 <
|
||||
000000 000055 0000AA 0000FF
|
||||
005500 005555 0055AA 0055FF
|
||||
00AA00 00AA55 00AAAA 00AAFF
|
||||
00FF00 00FF55 00FFAA 00FFFF
|
||||
550000 550055 5500AA 5500FF
|
||||
555500 555555 5555AA 5555FF
|
||||
55AA00 55AA55 55AAAA 55AAFF
|
||||
55FF00 55FF55 55FFAA 55FFFF
|
||||
AA0000 AA0055 AA00AA AA00FF
|
||||
AA5500 AA5555 AA55AA AA55FF
|
||||
AAAA00 AAAA55 AAAAAA AAAAFF
|
||||
AAFF00 AAFF55 AAFFAA AAFFFF
|
||||
FF0000 FF0055 FF00AA FF00FF
|
||||
FF5500 FF5555 FF55AA FF55FF
|
||||
FFAA00 FFAA55 FFAAAA FFAAFF
|
||||
FFFF00 FFFF55 FFFFAA FFFFFF
|
||||
|
||||
000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
|
||||
000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
|
||||
000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
|
||||
000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
|
||||
|
||||
000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
|
||||
000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
|
||||
000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
|
||||
000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
|
||||
|
||||
000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
|
||||
000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
|
||||
000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
|
||||
000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
|
||||
|
||||
000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
|
||||
000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
|
||||
000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
|
||||
000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
|
||||
>
|
||||
] setcolorspace
|
||||
/BPC 8 def % change to 4 bit indexed
|
||||
} {
|
||||
/DeviceRGB setcolorspace
|
||||
/BPC bpc def
|
||||
}
|
||||
ifelse
|
||||
}
|
||||
ifelse
|
||||
<< /ImageType 1
|
||||
/Width w
|
||||
/Height h
|
||||
/BitsPerComponent BPC
|
||||
/ImageMatrix [1 0 0 -1 0 h]
|
||||
/DataSource f
|
||||
/MultipleDataSources false
|
||||
bpc 4 lt { /Decode [ 0 [ 0 15 255 ] bpc get ] } { /Decode [ 0 1 0 1 0 1 ] } ifelse
|
||||
>> image
|
||||
showpage
|
||||
f closefile
|
||||
end
|
||||
} bind def
|
||||
|
||||
% If the program was invoked from the command line, run it now.
|
||||
[ .shellarguments {
|
||||
counttomark 2 eq {
|
||||
cvi viewrgb
|
||||
} {
|
||||
cleartomark
|
||||
(\nUsage: gs -- viewrgb.ps filename.rgb width\n) print
|
||||
( e.g.: gs -- viewrgb.ps my.rgb 2550\n) print flush
|
||||
( -dSCALE=### sets specific scaling \(default = 1.0\)) = flush
|
||||
( -dBITS=# sets the BitsPerComponent \(1, 2, 8, 12] \(default = 1\)) = flush
|
||||
(From version 9.50 you must supply permissions for this program to read the input file(s)\n) print flush
|
||||
(either by using -dNOSAFER or by supplying --permit-file-read=<filename>\n) = flush
|
||||
} ifelse
|
||||
} {
|
||||
pop
|
||||
} ifelse
|
||||
105
dist/conf/ghostscript/lib/winmaps.ps
vendored
105
dist/conf/ghostscript/lib/winmaps.ps
vendored
@@ -1,105 +0,0 @@
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% 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.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% winmaps.ps - make maps between PostScript encodings and Windows
|
||||
% character sets.
|
||||
|
||||
% Define the two Windows encodings.
|
||||
|
||||
/ANSIEncoding
|
||||
ISOLatin1Encoding 256 array copy
|
||||
dup 16#90 /.notdef put
|
||||
16#93 1 16#9f { 2 copy /.notdef put pop } for
|
||||
def
|
||||
|
||||
/OEMEncoding [
|
||||
/.notdef /.notdef /.notdef /heart /diamond /club /spade /bullet
|
||||
8 { /.notdef } repeat
|
||||
/.notdef /.notdef /.notdef /.notdef /paragraph /section /.notdef /.notdef
|
||||
/arrowup /arrowdown /arrowright /arrowleft /.notdef /arrowboth /.notdef /.notdef
|
||||
StandardEncoding 32 96 getinterval aload pop
|
||||
/Ccedilla /udieresis /eacute /acircumflex /adieresis /agrave /aring /ccedilla
|
||||
/ecircumflex /edieresis /egrave /idieresis /igrave /Adieresis /Aring
|
||||
/Eacute /ae /AE /ocircumflex /odieresis /ograve /ucircumflex /ugrave
|
||||
/ydieresis /Odieresis /Udieresis /cent /sterling /yen /.notdef /florin
|
||||
/aacute /iacute /oacute /uacute /ntilde /Ntilde /ordfeminine /ordmasculine
|
||||
/questiondown /.notdef /logicalnot /onehalf /onequarter /exclamdown /guillemotleft /guillemotright
|
||||
48 { /.notdef } repeat
|
||||
/alpha /beta /Gamma /Pi /Sigma /sigma /mu /tau
|
||||
/Phi /Theta /Omega /delta /infinity /phi /element /intersection
|
||||
/equivalence /plusminus /greaterequal /lessequal /integraltp /integralbt /divide /.notdef
|
||||
/degree /dotmath /periodcentered /radical /.notdef /twosuperior /.notdef /.notdef
|
||||
] def
|
||||
|
||||
% Utility procedures
|
||||
|
||||
/invertencoding % <array> invertencoding <dict>
|
||||
{ 256 dict exch dup length 1 sub -1 0
|
||||
{ % stack: dict array index
|
||||
2 copy get /.notdef ne
|
||||
{ 2 copy get exch 3 index 3 1 roll put }
|
||||
{ pop }
|
||||
ifelse
|
||||
} for
|
||||
pop
|
||||
} def
|
||||
|
||||
/pmarray 256 array def
|
||||
/printmap % <chars> <decode> printmap -
|
||||
{ mark 3 1 roll exch
|
||||
{ 2 copy known { 1 index exch get } { pop 0 } ifelse exch
|
||||
}
|
||||
forall pop
|
||||
pmarray 0 counttomark 2 sub getinterval astore
|
||||
([) print dup length =only 0 exch (] = {\n ) exch
|
||||
{ exch print =only
|
||||
1 add 15 and dup 0 eq { (,\n ) } { (, ) } ifelse
|
||||
}
|
||||
forall pop pop (\n};\n) print pop
|
||||
} def
|
||||
|
||||
/decodeStd StandardEncoding invertencoding def
|
||||
/decodeISO ISOLatin1Encoding
|
||||
% Remove the redundant characters
|
||||
dup length array copy
|
||||
[8#222 8#225 8#230 8#233 8#240] { 2 copy /.notdef put pop } forall
|
||||
invertencoding def
|
||||
/decodeSym SymbolEncoding invertencoding def
|
||||
|
||||
/decodeANSI ANSIEncoding invertencoding def
|
||||
/decodeOEM OEMEncoding invertencoding def
|
||||
|
||||
% Construct the map from Symbol to OEM.
|
||||
|
||||
(\nprivate const byte far_data gs_map_symbol_to_oem) print
|
||||
SymbolEncoding decodeOEM printmap
|
||||
|
||||
% Construct the map from ISOLatin1 to OEM.
|
||||
|
||||
(\nprivate const byte far_data gs_map_iso_to_oem) print
|
||||
ISOLatin1Encoding decodeOEM printmap
|
||||
|
||||
% Construct the map from Standard to ISOLatin1.
|
||||
|
||||
(\nprivate const byte far_data gs_map_std_to_iso) print
|
||||
StandardEncoding decodeISO printmap
|
||||
|
||||
% Construct the map from ISOLatin1 to Standard.
|
||||
% The Windows driver doesn't need this, but the X11 driver does.
|
||||
|
||||
(\nprivate const byte far_data gs_map_iso_to_std) print
|
||||
ISOLatin1Encoding decodeStd printmap
|
||||
|
||||
quit
|
||||
99
dist/conf/ghostscript/lib/zeroline.ps
vendored
99
dist/conf/ghostscript/lib/zeroline.ps
vendored
@@ -1,99 +0,0 @@
|
||||
%!
|
||||
% Copyright (C) 2001-2023 Artifex Software, Inc.
|
||||
% 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.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
|
||||
% zeroline.ps
|
||||
% Test file to determine how other PostScript implementations handle
|
||||
% filling zero-width lines under a variety of conditions.
|
||||
|
||||
% Add a small "fan" of zero-width lines at different angles to the path.
|
||||
/fan
|
||||
{ currentpoint 100 0 rlineto
|
||||
2 copy moveto 100 20 rlineto
|
||||
2 copy moveto 100 100 rlineto
|
||||
2 copy moveto 20 100 rlineto
|
||||
moveto 0 100 rlineto
|
||||
} def
|
||||
|
||||
% Append a rectangle to the current path.
|
||||
/rectappend
|
||||
{ 4 -2 roll moveto 1 index 0 rlineto 0 exch rlineto
|
||||
neg 0 rlineto closepath
|
||||
} def
|
||||
% Fill a rectangle.
|
||||
/rectfill
|
||||
{ gsave newpath rectappend fill grestore
|
||||
} def
|
||||
% Stroke a rectangle.
|
||||
/rectstroke
|
||||
{ gsave newpath rectappend stroke grestore
|
||||
} def
|
||||
% Clip to a rectangle. Unlike the real rectclip,
|
||||
% this clear the current path.
|
||||
/rectclip
|
||||
{ newpath rectappend clip newpath
|
||||
} def
|
||||
|
||||
40 40 translate
|
||||
|
||||
% Display fans of different colors on different backgrounds.
|
||||
gsave
|
||||
0 setgray
|
||||
0 0 120 120 rectstroke
|
||||
10 10 moveto fan fill
|
||||
140 0 translate
|
||||
0 setgray
|
||||
0 0 120 120 rectstroke
|
||||
0.8 setgray
|
||||
10 10 moveto fan fill
|
||||
140 0 translate
|
||||
0 setgray
|
||||
0 0 120 120 rectfill
|
||||
1 setgray
|
||||
10 10 moveto fan fill
|
||||
grestore
|
||||
0 140 translate
|
||||
|
||||
% Display rectangles with two edges coincident.
|
||||
gsave
|
||||
newpath
|
||||
0 setgray
|
||||
0 0 40 40 rectappend
|
||||
0 0 20 20 rectappend
|
||||
eofill
|
||||
60 0 translate
|
||||
0 0 40 40 rectappend
|
||||
40 0 -20 20 rectappend
|
||||
fill
|
||||
grestore
|
||||
0 60 translate
|
||||
|
||||
% Display superimposed lines.
|
||||
gsave
|
||||
/super
|
||||
{ currentpoint fan
|
||||
2 copy moveto 20 0 rmoveto 50 0 rlineto
|
||||
2 copy moveto 20 4 rmoveto 50 10 rlineto
|
||||
2 copy moveto 20 20 rmoveto 50 50 rlineto
|
||||
2 copy moveto 4 20 rmoveto 10 50 rlineto
|
||||
moveto 0 20 rmoveto 0 50 rlineto
|
||||
} def
|
||||
0 setgray
|
||||
0 0 moveto super fill
|
||||
140 0 translate 0 0 moveto super eofill
|
||||
grestore
|
||||
0 140 translate
|
||||
|
||||
showpage
|
||||
527
dist/conf/ghostscript/lib/zugferd.ps
vendored
527
dist/conf/ghostscript/lib/zugferd.ps
vendored
@@ -1,527 +0,0 @@
|
||||
%!PS
|
||||
|
||||
% Copyright (C) 2001-2024 Artifex Software, Inc.
|
||||
% 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.
|
||||
%
|
||||
% Refer to licensing information at http://www.artifex.com or contact
|
||||
% Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
|
||||
% CA 94129, USA, for further information.
|
||||
%
|
||||
% ZUGFeRD.ps
|
||||
% This program will create an (unsigned) ZUGFeRD compliant PDF file.
|
||||
% In order to do so the user must provide certain information, or edit
|
||||
% this program.
|
||||
%
|
||||
% Required information is the path to the XML file containing the invoice
|
||||
% data, and the path to an ICC profile appropriate for the chosen
|
||||
% ColorConversionStrategy.
|
||||
%
|
||||
% -sZUGFeRDXMLFile defines a path to the XML invoice file.
|
||||
%
|
||||
% -sZUGFeRDProfile defines the path to the ICC profile.
|
||||
%
|
||||
% -sZUGFeRDVersion defines the version of the ZUGFeRD standard to be used.
|
||||
% Missing or invalid values would be silently replaced by the default ("2p1").
|
||||
%
|
||||
% -sZUGFeRDConformanceLevel defines the level of conformance.
|
||||
% Missing or invalid values would be silently replaced by the default ("BASIC").
|
||||
%
|
||||
% Note that the ZUGFeRD standard states:
|
||||
%
|
||||
% The content of the field fx:ConformanceLevel has to be picked from
|
||||
% the content of the element "GuidelineSpecifiedDocumentContextParameter"
|
||||
% (specification identifier BT-24) of the XML instance file.
|
||||
%
|
||||
% Optionally:
|
||||
% -sZUGFeRDDateTime can be used to set a string representing the modification
|
||||
% date of the XML invoice file. If this is ommitted a dummy value will be
|
||||
% used. It is up to the user to create a correctly formatted PDF date/time
|
||||
% string. See section 7.9.4 of the PDF 2.0 specification (ISO-32000-2:2017)
|
||||
% for details of the format.
|
||||
%
|
||||
% The user must additionally set -dPDFA=3 and -sColorConversionStrategy
|
||||
% on the Ghostscript command line, and set the permissions for Ghostscript
|
||||
% to read both these files. It is simplest to put the files in a directory
|
||||
% and then permit reading of the entire directory.
|
||||
%
|
||||
% Example command line :
|
||||
%
|
||||
% gs --permit-file-read=/usr/home/me/zugferd/ \
|
||||
% -sDEVICE=pdfwrite \
|
||||
% -dPDFA=3 \
|
||||
% -sColorConversionStrategy=RGB \
|
||||
% -sZUGFeRDXMLFile=/usr/home/me/zugferd/invoice.xml \
|
||||
% -sZUGFeRDProfile=/usr/home/me/zugferd/rgb.icc \
|
||||
% -sZUGFeRDVersion=2p1 \
|
||||
% -sZUGFeRDConformanceLevel=BASIC \
|
||||
% -o /usr/home/me/zugferd/zugferd.pdf \
|
||||
% /usr/home/me/zugferd/zugferd.ps \
|
||||
% /usr/home/me/zugferd/original.pdf
|
||||
%
|
||||
% Much of this program results from a Ghostscript bug report, the thread
|
||||
% can be found at
|
||||
% https://bugs.ghostscript.com/show_bug.cgi?id=696472
|
||||
% Portions of the code below were supplied by Reinhard Nissl and
|
||||
% I'm indebted to him for his efforts in helping me create a solution for
|
||||
% this problem as well as for the code he supplied, particularly for the
|
||||
% SimpleUTF16BE routine.
|
||||
%
|
||||
% The program was further refined and expanded by Adrian Devries in :
|
||||
% https://bugs.ghostscript.com/show_bug.cgi?id=703862
|
||||
%
|
||||
% And refined again following feedback from Thorsten Engel in:
|
||||
% https://bugs.ghostscript.com/show_bug.cgi?id=707694
|
||||
%
|
||||
% It should not be necessary to modify this program, the comments in the
|
||||
% code are there purely for information, but there is one area which
|
||||
% might reasonably be altered. The section with the --8<-- lines could be
|
||||
% replaced with a simpler /N 3 or /N 4 if you always intend to produce
|
||||
% the same kind of files; RGB or CMYK.
|
||||
%
|
||||
% Remaining tasks have been marked with "TODO".
|
||||
|
||||
% istring SimpleUTF16BE ostring
|
||||
/SimpleUTF16BE
|
||||
{
|
||||
dup length
|
||||
1 add
|
||||
2 mul
|
||||
string
|
||||
% istring ostring
|
||||
dup 0 16#FE put
|
||||
dup 1 16#FF put
|
||||
2
|
||||
3 -1 roll
|
||||
% ostring index istring
|
||||
{
|
||||
% ostring index ichar
|
||||
3 1 roll
|
||||
% ichar ostring index
|
||||
2 copy 16#00 put
|
||||
1 add
|
||||
2 copy
|
||||
5 -1 roll
|
||||
% ostring index ostring index ichar
|
||||
put
|
||||
1 add
|
||||
% ostring index
|
||||
}
|
||||
forall
|
||||
% ostring index
|
||||
pop
|
||||
}
|
||||
bind def
|
||||
|
||||
% Cf. https://en.wikibooks.org/wiki/PostScript_FAQ#How_to_concatenate_strings%3F
|
||||
/concatstringarray { % [(a) (b) ... (z)] --> (ab...z)
|
||||
0 1 index {
|
||||
length add
|
||||
} forall
|
||||
string
|
||||
0 3 2 roll {
|
||||
3 copy putinterval
|
||||
length add
|
||||
} forall
|
||||
pop
|
||||
} bind def
|
||||
|
||||
/ZUGFeRDVersion where {
|
||||
pop % Discard the dictionary
|
||||
ZUGFeRDVersion (rc) ne {
|
||||
ZUGFeRDVersion (1p0) ne {
|
||||
ZUGFeRDVersion (2p0) ne {
|
||||
ZUGFeRDVersion (2p1) ne {
|
||||
/ZUGFeRDVersion (2p1) def
|
||||
} if
|
||||
} if
|
||||
} if
|
||||
} if
|
||||
}{
|
||||
/ZUGFeRDVersion (2p1) def
|
||||
} ifelse
|
||||
|
||||
/ZUGFeRDConformanceLevel where {
|
||||
pop % Discard the dictionary
|
||||
ZUGFeRDVersion (rc) eq
|
||||
ZUGFeRDVersion (1p0) eq or {
|
||||
ZUGFeRDConformanceLevel (BASIC) ne {
|
||||
ZUGFeRDConformanceLevel (COMFORT) ne {
|
||||
ZUGFeRDConformanceLevel (EXTENDED) ne {
|
||||
/ZUGFeRDConformanceLevel (BASIC) def
|
||||
} if
|
||||
} if
|
||||
} if
|
||||
} if
|
||||
ZUGFeRDVersion (2p0) eq
|
||||
ZUGFeRDVersion (2p1) eq or {
|
||||
ZUGFeRDConformanceLevel (MINIMUM) ne {
|
||||
ZUGFeRDConformanceLevel (BASIC WL) ne {
|
||||
ZUGFeRDConformanceLevel (BASIC) ne {
|
||||
ZUGFeRDConformanceLevel (EN 16931) ne {
|
||||
ZUGFeRDConformanceLevel (EXTENDED) ne {
|
||||
ZUGFeRDConformanceLevel (XRECHNUNG) ne {
|
||||
/ZUGFeRDConformanceLevel (BASIC) def
|
||||
} if
|
||||
} if
|
||||
} if
|
||||
} if
|
||||
} if
|
||||
} if
|
||||
} if
|
||||
}{
|
||||
/ZUGFeRDConformanceLevel (BASIC) def
|
||||
} ifelse
|
||||
|
||||
% ZUGFeRDSchema
|
||||
/ZUGFeRDSchema () def
|
||||
ZUGFeRDVersion (rc) eq
|
||||
ZUGFeRDVersion (1p0) eq or
|
||||
ZUGFeRDVersion (2p0) eq or {
|
||||
/ZUGFeRDSchema (ZUGFeRD PDFA Extension Schema) def
|
||||
} if
|
||||
ZUGFeRDVersion (2p1) eq {
|
||||
/ZUGFeRDSchema (Factur-X PDFA Extension Schema) def
|
||||
} if
|
||||
|
||||
% ZUGFeRDNamespaceURI
|
||||
/ZUGFeRDNamespaceURI () def
|
||||
ZUGFeRDVersion (rc) eq {
|
||||
/ZUGFeRDNamespaceURI (urn:ferd:pdfa:invoice:rc#) def
|
||||
} if
|
||||
ZUGFeRDVersion (1p0) eq {
|
||||
/ZUGFeRDNamespaceURI (urn:ferd:pdfa:CrossIndustryDocument:invoice:1p0#) def
|
||||
} if
|
||||
ZUGFeRDVersion (2p0) eq {
|
||||
/ZUGFeRDNamespaceURI (urn:zugferd:pdfa:CrossIndustryDocument:invoice:2p0#) def
|
||||
} if
|
||||
ZUGFeRDVersion (2p1) eq {
|
||||
/ZUGFeRDNamespaceURI (urn:factur-x:pdfa:CrossIndustryDocument:invoice:1p0#) def
|
||||
} if
|
||||
|
||||
% ZUGFeRDPrefix
|
||||
/ZUGFeRDPrefix () def
|
||||
ZUGFeRDVersion (rc) eq
|
||||
ZUGFeRDVersion (1p0) eq or
|
||||
ZUGFeRDVersion (2p0) eq or {
|
||||
/ZUGFeRDPrefix (zf) def
|
||||
} if
|
||||
ZUGFeRDVersion (2p1) eq {
|
||||
/ZUGFeRDPrefix (fx) def
|
||||
} if
|
||||
|
||||
% ZUGFeRDVersionDescription
|
||||
/ZUGFeRDVersionDescription () def
|
||||
ZUGFeRDVersion (rc) eq
|
||||
ZUGFeRDVersion (1p0) eq or
|
||||
ZUGFeRDVersion (2p0) eq or {
|
||||
/ZUGFeRDVersionDescription (The actual version of the ZUGFeRD XML schema) def
|
||||
} if
|
||||
ZUGFeRDVersion (2p1) eq {
|
||||
/ZUGFeRDVersionDescription (The actual version of the Factur-X XML schema) def
|
||||
} if
|
||||
|
||||
% ZUGFeRDConformanceLevelDescription
|
||||
/ZUGFeRDConformanceLevelDescription () def
|
||||
ZUGFeRDVersion (rc) eq
|
||||
ZUGFeRDVersion (1p0) eq or
|
||||
ZUGFeRDVersion (2p0) eq or {
|
||||
/ZUGFeRDConformanceLevelDescription (The conformance level of the embedded ZUGFeRD data) def
|
||||
} if
|
||||
ZUGFeRDVersion (2p1) eq {
|
||||
/ZUGFeRDConformanceLevelDescription (The conformance level of the embedded Factur-X data) def
|
||||
} if
|
||||
|
||||
% ZUGFeRDDocumentFileName
|
||||
/ZUGFeRDDocumentFileName () def
|
||||
ZUGFeRDVersion (rc) eq {
|
||||
/ZUGFeRDDocumentFileName (ZUGFeRD-invoice.xml) def
|
||||
} if
|
||||
ZUGFeRDVersion (1p0) eq {
|
||||
/ZUGFeRDDocumentFileName (ZUGFeRD-invoice.xml) def
|
||||
} if
|
||||
ZUGFeRDVersion (2p0) eq {
|
||||
ZUGFeRDConformanceLevel (XRECHNUNG) ne {
|
||||
/ZUGFeRDDocumentFileName (zugferd-invoice.xml) def
|
||||
}{
|
||||
/ZUGFeRDDocumentFileName (xrechnung.xml) def
|
||||
} ifelse
|
||||
} if
|
||||
ZUGFeRDVersion (2p1) eq {
|
||||
ZUGFeRDConformanceLevel (XRECHNUNG) ne {
|
||||
/ZUGFeRDDocumentFileName (factur-x.xml) def
|
||||
}{
|
||||
/ZUGFeRDDocumentFileName (xrechnung.xml) def
|
||||
} ifelse
|
||||
} if
|
||||
|
||||
% ZUGFeRDVersionData
|
||||
/ZUGFeRDVersionData () def
|
||||
ZUGFeRDVersion (rc) eq {
|
||||
/ZUGFeRDVersionData (RC) def
|
||||
} if
|
||||
ZUGFeRDVersion (1p0) eq {
|
||||
/ZUGFeRDVersionData (1.0) def
|
||||
} if
|
||||
ZUGFeRDVersion (2p0) eq {
|
||||
ZUGFeRDConformanceLevel (XRECHNUNG) ne {
|
||||
/ZUGFeRDVersionData (2p0) def
|
||||
}{
|
||||
/ZUGFeRDVersionData (1p2) def
|
||||
} ifelse
|
||||
} if
|
||||
ZUGFeRDVersion (2p1) eq {
|
||||
ZUGFeRDConformanceLevel (XRECHNUNG) ne {
|
||||
/ZUGFeRDVersionData (1.0) def
|
||||
}{
|
||||
/ZUGFeRDVersionData (1p2) def
|
||||
} ifelse
|
||||
} if
|
||||
|
||||
/ZUGFeRDMetadata [
|
||||
(
|
||||
<rdf:Description)
|
||||
( xmlns:pdfaExtension="http://www.aiim.org/pdfa/ns/extension/")
|
||||
( xmlns:pdfaProperty="http://www.aiim.org/pdfa/ns/property#")
|
||||
( xmlns:pdfaSchema="http://www.aiim.org/pdfa/ns/schema#")
|
||||
( rdf:about="">
|
||||
<pdfaExtension:schemas>
|
||||
<rdf:Bag>
|
||||
<rdf:li rdf:parseType="Resource">
|
||||
<pdfaSchema:schema>)ZUGFeRDSchema(</pdfaSchema:schema>
|
||||
<pdfaSchema:namespaceURI>)ZUGFeRDNamespaceURI(</pdfaSchema:namespaceURI>
|
||||
<pdfaSchema:prefix>)ZUGFeRDPrefix(</pdfaSchema:prefix>
|
||||
<pdfaSchema:property>
|
||||
<rdf:Seq>
|
||||
<rdf:li rdf:parseType="Resource">
|
||||
<pdfaProperty:name>DocumentFileName</pdfaProperty:name>
|
||||
<pdfaProperty:valueType>Text</pdfaProperty:valueType>
|
||||
<pdfaProperty:category>external</pdfaProperty:category>
|
||||
<pdfaProperty:description>Name of the embedded XML invoice file</pdfaProperty:description>
|
||||
</rdf:li>
|
||||
<rdf:li rdf:parseType="Resource">
|
||||
<pdfaProperty:name>DocumentType</pdfaProperty:name>
|
||||
<pdfaProperty:valueType>Text</pdfaProperty:valueType>
|
||||
<pdfaProperty:category>external</pdfaProperty:category>
|
||||
<pdfaProperty:description>INVOICE</pdfaProperty:description>
|
||||
</rdf:li>
|
||||
<rdf:li rdf:parseType="Resource">
|
||||
<pdfaProperty:name>Version</pdfaProperty:name>
|
||||
<pdfaProperty:valueType>Text</pdfaProperty:valueType>
|
||||
<pdfaProperty:category>external</pdfaProperty:category>
|
||||
<pdfaProperty:description>)ZUGFeRDVersionDescription(</pdfaProperty:description>
|
||||
</rdf:li>
|
||||
<rdf:li rdf:parseType="Resource">
|
||||
<pdfaProperty:name>ConformanceLevel</pdfaProperty:name>
|
||||
<pdfaProperty:valueType>Text</pdfaProperty:valueType>
|
||||
<pdfaProperty:category>external</pdfaProperty:category>
|
||||
<pdfaProperty:description>)ZUGFeRDConformanceLevelDescription(</pdfaProperty:description>
|
||||
</rdf:li>
|
||||
</rdf:Seq>
|
||||
</pdfaSchema:property>
|
||||
</rdf:li>
|
||||
</rdf:Bag>
|
||||
</pdfaExtension:schemas>
|
||||
</rdf:Description>
|
||||
<rdf:Description xmlns:)ZUGFeRDPrefix(=")ZUGFeRDNamespaceURI(" rdf:about="">
|
||||
<)ZUGFeRDPrefix(:ConformanceLevel>)ZUGFeRDConformanceLevel(</)ZUGFeRDPrefix(:ConformanceLevel>
|
||||
<)ZUGFeRDPrefix(:DocumentFileName>)ZUGFeRDDocumentFileName(</)ZUGFeRDPrefix(:DocumentFileName>
|
||||
<)ZUGFeRDPrefix(:DocumentType>INVOICE</)ZUGFeRDPrefix(:DocumentType>
|
||||
<)ZUGFeRDPrefix(:Version>)ZUGFeRDVersionData(</)ZUGFeRDPrefix(:Version>
|
||||
</rdf:Description>
|
||||
)
|
||||
] concatstringarray def
|
||||
|
||||
/Usage {
|
||||
(example usage: \n) print
|
||||
( gs --permit-file-read=/usr/home/me/zugferd/ \\\n) print
|
||||
( -sDEVICE=pdfwrite \\\n) print
|
||||
( -dPDFA=3 \\\n) print
|
||||
( -sColorConversionStrategy=RGB \\\n) print
|
||||
( -sZUGFeRDXMLFile=/usr/home/me/zugferd/invoice.xml \\\n) print
|
||||
( -sZUGFeRDProfile=/usr/home/me/zugferd\rgb.icc \\\n) print
|
||||
( -sZUGFeRDVersion=2p1 \\\n) print
|
||||
( -sZUGFeRDConformanceLevel=BASIC \\\n) print
|
||||
( -o /usr/home/me/zugferd/zugferd.pdf \\\n) print
|
||||
( /usr/home/me/zugferd/zugferd.ps \\\n) print
|
||||
( /usr/home/me/zugferd/original.pdf \n) print
|
||||
flush
|
||||
} def
|
||||
|
||||
% First check that the user has defined the XML invoice file on the command line
|
||||
%
|
||||
/ZUGFeRDXMLFile where {
|
||||
pop % Discard the dictionary
|
||||
%
|
||||
% Now check that the ICC Profile is defined
|
||||
%
|
||||
/ZUGFeRDProfile where {
|
||||
pop % Discard the dictionary
|
||||
|
||||
% Step 1, add the required PDF/A boilerplate.
|
||||
% This is mostly copied from lib/pdfa_def.ps
|
||||
|
||||
% Create a PDF stream object to hold the ICC profile.
|
||||
[ /_objdef {icc_PDFA} /type /stream /OBJ pdfmark
|
||||
|
||||
% Add the required entries to the stream dictionary (/N only)
|
||||
[ {icc_PDFA}
|
||||
<<
|
||||
%% This code attempts to set the /N (number of components) key for the ICC colour space.
|
||||
%% To do this it checks the ColorConversionStrategy or the device ProcessColorModel if
|
||||
%% ColorConversionStrategy is not set.
|
||||
%% This is not 100% reliable. A better solution is for the user to edit this and replace
|
||||
%% the code between the ---8<--- lines with a simple declaration like:
|
||||
%% /N 3
|
||||
%% where the value of N is the number of components from the profile defined in ZUGFeRDProfile.
|
||||
%%
|
||||
%% ----------8<--------------8<-------------8<--------------8<----------
|
||||
systemdict /ColorConversionStrategy known {
|
||||
systemdict /ColorConversionStrategy get cvn dup /Gray eq {
|
||||
pop /N 1 false
|
||||
}{
|
||||
dup /RGB eq {
|
||||
pop /N 3 false
|
||||
}{
|
||||
/CMYK eq {
|
||||
/N 4 false
|
||||
}{
|
||||
(ColorConversionStrategy not a device space, falling back to ProcessColorModel, output may not be valid PDF/A.)=
|
||||
true
|
||||
} ifelse
|
||||
} ifelse
|
||||
} ifelse
|
||||
} {
|
||||
(ColorConversionStrategy not set, falling back to ProcessColorModel, output may not be valid PDF/A.)=
|
||||
true
|
||||
} ifelse
|
||||
|
||||
{
|
||||
currentpagedevice /ProcessColorModel get
|
||||
dup /DeviceGray eq {
|
||||
pop /N 1
|
||||
}{
|
||||
dup /DeviceRGB eq {
|
||||
pop /N 3
|
||||
}{
|
||||
dup /DeviceCMYK eq {
|
||||
pop /N 4
|
||||
} {
|
||||
(ProcessColorModel not a device space.)=
|
||||
/ProcessColorModel cvx /rangecheck signalerror
|
||||
} ifelse
|
||||
} ifelse
|
||||
} ifelse
|
||||
} if
|
||||
%% ----------8<--------------8<-------------8<--------------8<----------
|
||||
>> /PUT pdfmark
|
||||
|
||||
% Now read the ICC profile from the file into the stream
|
||||
[ {icc_PDFA} ZUGFeRDProfile (r) file /PUT pdfmark
|
||||
|
||||
% Define the output intent dictionary :
|
||||
[/_objdef {OutputIntent_PDFA} /type /dict /OBJ pdfmark
|
||||
|
||||
% Add the required keys to the dictionary
|
||||
[{OutputIntent_PDFA} <<
|
||||
/Type /OutputIntent
|
||||
/S /GTS_PDFA1 % Required for PDF/A.
|
||||
/DestOutputProfile {icc_PDFA} % The actual profile.
|
||||
/OutputConditionIdentifier (Custom) % TODO: A better solution is a
|
||||
% a string from the ICC
|
||||
% Registry, but Custom
|
||||
% is always valid.
|
||||
>> /PUT pdfmark
|
||||
|
||||
% And now add the OutputIntent to the Catalog dictionary
|
||||
[ {Catalog} << /OutputIntents [ {OutputIntent_PDFA} ]>> /PUT pdfmark
|
||||
|
||||
% Step 2, define the XML file and read it into the PDF
|
||||
% First we define the PDF stream to contain the XML invoice
|
||||
[ /_objdef {InvoiceStream} /type /stream /OBJ pdfmark
|
||||
% Fill in the dictionary elements we need. We believe the
|
||||
% ModDate is not useful so it's just set to a valid value.
|
||||
[ {InvoiceStream} <<
|
||||
/Type /EmbeddedFile
|
||||
/Subtype (text/xml) cvn
|
||||
/Params <<
|
||||
/ModDate systemdict /ZUGFeRDDateTime known
|
||||
{ZUGFeRDDateTime}
|
||||
{(D:20130121081433+01'00')}
|
||||
ifelse
|
||||
/Size ZUGFeRDXMLFile status
|
||||
{pop pop exch pop}
|
||||
{(Failed to get file status!\n)print /status load /ioerror signalerror}
|
||||
ifelse
|
||||
>>
|
||||
>> /PUT pdfmark
|
||||
% Now read the data from the file and store it in the stream
|
||||
[ {InvoiceStream} ZUGFeRDXMLFile (r) file /PUT pdfmark
|
||||
% and close the stream
|
||||
[ {InvoiceStream} /CLOSE pdfmark
|
||||
|
||||
% Step 3 create the File Specification dictionary for the embedded file
|
||||
% Create the dictionary
|
||||
[ /_objdef {FSDict} /type /dict /OBJ pdfmark
|
||||
% Fill in the required dictionary elements
|
||||
[ {FSDict} <<
|
||||
/Type /Filespec
|
||||
/F ZUGFeRDDocumentFileName
|
||||
/UF ZUGFeRDDocumentFileName SimpleUTF16BE
|
||||
/Desc (ZUGFeRD electronic invoice)
|
||||
/AFRelationship /Alternative
|
||||
/EF <<
|
||||
/F {InvoiceStream}
|
||||
/UF {InvoiceStream}
|
||||
>>
|
||||
>>
|
||||
/PUT pdfmark
|
||||
|
||||
% Step 4 Create the Associated Files dictionary to hold the FS dict
|
||||
% Create the dictionary
|
||||
[ /_objdef {AFArray} /type /array /OBJ pdfmark
|
||||
% Put (append) the FS dictionary into the Associated Files array
|
||||
[ {AFArray} {FSDict} /APPEND pdfmark
|
||||
|
||||
% Step 5 Add an entry in the Catalog dictionary containing the AF array
|
||||
% Since Ghostscript 10.04.0 this is no longer required, providing the output file is
|
||||
% PDF/A-3 or higher. The PDF/A-3 tech note 0010 (p28) clarifies that the /AF in the Catalog
|
||||
% is mandatory and GS 10.04.0 will emit one itself.
|
||||
%
|
||||
% This line retained for historical reference, and as an example for cases where the output
|
||||
% is not PDF/A-3
|
||||
%
|
||||
% [ {Catalog} << /AF {AFArray} >> /PUT pdfmark
|
||||
|
||||
% Step 6 use the EMBED pdfmark to add the XML file and FS dictionary to the PDF name tree
|
||||
[ /Name ZUGFeRDDocumentFileName /FS {FSDict} /EMBED pdfmark
|
||||
|
||||
% Step 7 Add the extra ZUGFeRD XML data to the Metadata
|
||||
[ /XML ZUGFeRDMetadata /Ext_Metadata pdfmark
|
||||
}
|
||||
{
|
||||
% No ICC Profile definition on the command line;
|
||||
% chide the user and give them an example
|
||||
(\nERROR - ZUGFeRDProfile has not been supplied, you must supply an ICC profile) print
|
||||
(\n Producing a potentially INVALID PDF/A file. \n) print
|
||||
Usage
|
||||
} ifelse
|
||||
}
|
||||
{
|
||||
% No XML invoice definition on the command line;
|
||||
% chide the user and give them an example
|
||||
(\nERROR - ZUGFeRDXMLFile has not been supplied, you must supply a XML invoice file) print
|
||||
(\n Producing a PDF/A file, NOT a ZUGFeRD file. \n) print
|
||||
Usage
|
||||
} ifelse
|
||||
|
||||
% That's all the ZUGFeRD and PDF/A-3 setup completed,
|
||||
% all that remains now is to run the input file
|
||||
|
||||
%%EOF
|
||||
63
dist/conf/label_template.svg
vendored
63
dist/conf/label_template.svg
vendored
@@ -1,63 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Creator: CorelDRAW -->
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" width="35mm" height="25mm" version="1.1" style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd; clip-rule:evenodd"
|
||||
viewBox="0 0 35 25"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:xodm="http://www.corel.com/coreldraw/odm/2003">
|
||||
<defs>
|
||||
<font id="FontID0" horiz-adv-x="722" font-variant="normal" style="fill-rule:nonzero" font-style="normal" font-weight="700">
|
||||
<font-face
|
||||
font-family="Arial">
|
||||
<font-face-src>
|
||||
<font-face-name name="Arial Bold"/>
|
||||
</font-face-src>
|
||||
</font-face>
|
||||
<missing-glyph><path d="M0 0z"/></missing-glyph>
|
||||
<glyph unicode="." horiz-adv-x="277" d="M71.0096 0l0 136.998 136.998 0 0 -136.998 -136.998 0z"/>
|
||||
<glyph unicode=":" horiz-adv-x="332" d="M98.0096 381.997l0 136.998 136.998 0 0 -136.998 -136.998 0zm0 -381.997l0 136.998 136.998 0 0 -136.998 -136.998 0z"/>
|
||||
<glyph unicode="A" horiz-adv-x="722" d="M718.011 0l-156.185 0 -61.8388 162.999 -287.163 0 -59.482 -162.999 -153.342 0 277.993 715.987 153.162 0 286.856 -715.987zm-265.005 284.013l-99.4954 264.979 -96.6775 -264.979 196.173 0z"/>
|
||||
<glyph unicode="C" horiz-adv-x="722" d="M531.009 264.006l139.995 -43.0105c-21.4924,-78.8227 -57.3302,-137.331 -107.334,-175.654 -50.0038,-38.1689 -113.328,-57.3302 -190.179,-57.3302 -95.1661,0 -173.323,32.482 -234.649,97.4972 -61.1727,64.9896 -91.836,153.828 -91.836,266.67 0,119.143 30.8169,211.825 92.3227,277.813 61.5058,66.0143 142.506,99.0086 242.847,99.0086 87.6604,0 158.824,-26.001 213.49,-77.8236 32.6613,-30.6888 56.9972,-74.6727 73.3407,-132.182l-143.018 -33.9934c-8.47914,36.9905 -26.1547,66.3217 -52.9754,87.8397 -27,21.4924 -59.687,32.149 -98.0096,32.149 -53.1803,0 -96.3445,-18.982 -129.339,-57.1509 -33.1737,-38.0152 -49.6708,-99.6747 -49.6708,-185.004 0,-90.3246 16.3435,-154.827 48.8511,-193.176 32.6613,-38.5019 74.9801,-57.6632 127.161,-57.6632 38.5019,0 71.65,12.1679 99.316,36.6831 27.6661,24.4896 47.6727,62.8122 59.687,115.326z"/>
|
||||
<glyph unicode="N" horiz-adv-x="722" d="M73.0077 0l0 715.987 140.328 0 294.669 -479.827 0 479.827 134.001 0 0 -715.987 -144.837 0 -290.161 470.656 0 -470.656 -134.001 0z"/>
|
||||
<glyph unicode="S" horiz-adv-x="667" d="M34.9924 232.011l141.02 13.9867c8.47914,-47.1604 25.4886,-81.6661 51.3103,-103.825 25.8473,-22.1841 60.686,-33.1737 104.516,-33.1737 46.315,0 81.3331,9.83682 104.824,29.5105 23.5162,19.648 35.3255,42.6518 35.3255,68.9858 0,17.0095 -4.99526,31.3293 -14.8321,43.3435 -9.8112,11.8349 -27.1537,22.1585 -51.8226,30.8169 -16.8302,6.01993 -55.1784,16.3435 -115.173,31.3549 -77.1576,19.315 -131.337,42.9849 -162.487,71.1633 -43.8302,39.501 -65.6813,87.6604 -65.6813,144.504 0,36.4782 10.3492,70.8302 30.8425,102.646 20.6727,31.8416 50.3369,55.9982 89.1718,72.6746 38.835,16.6765 85.483,25.0019 140.482,25.0019 89.5048,0 157.005,-19.8273 202.167,-59.6613 45.3416,-39.834 69.0115,-92.835 71.3426,-159.336l-144.991 -4.99526c-6.17363,36.9905 -19.3406,63.5039 -39.501,79.668 -20.186,16.1642 -50.5162,24.3359 -90.8369,24.3359 -41.6784,0 -74.3397,-8.68407 -97.8303,-26.001 -15.1651,-11.1689 -22.8501,-26.001 -22.8501,-44.6756 0,-17.0095 7.17268,-31.5086 21.518,-43.4972 18.1623,-15.4981 62.3255,-31.5086 132.49,-48.1594 70.1642,-16.5228 122.012,-33.8397 155.494,-51.5152 33.686,-17.8292 60.02,-41.9858 79.002,-72.8283 19.0076,-30.8425 28.5114,-68.8321 28.5114,-113.994 0,-41.0124 -11.3482,-79.5143 -34.1727,-115.352 -22.8245,-35.8122 -54.9991,-62.4792 -96.6775,-79.8217 -41.6528,-17.4962 -93.6547,-26.1547 -155.827,-26.1547 -90.5039,0 -160.002,20.8264 -208.495,62.6585 -48.4925,41.6528 -77.3369,102.493 -86.8407,182.34z"/>
|
||||
<glyph unicode="a" horiz-adv-x="556" d="M173.989 358.993l-123.985 22.0048c13.9867,50.6699 38.1689,88.1728 72.3416,112.509 34.1471,24.3359 84.9963,36.5038 152.317,36.5038 61.1727,0 106.847,-7.17268 136.845,-21.6717 29.8179,-14.4991 51.0029,-32.8406 63.1708,-55.1784 12.1679,-22.3378 18.316,-63.1708 18.316,-122.832l-1.9981 -160.002c0,-45.4953 2.17742,-79.1557 6.50665,-100.827 4.32923,-21.6717 12.501,-44.8293 24.4896,-69.4982l-135.999 0c-3.48387,8.99147 -7.99242,22.3378 -13.167,39.9877 -2.1518,8.17173 -3.81689,13.5 -4.81594,16.0105 -23.3368,-23.0038 -48.3388,-40.167 -75.0058,-51.6689 -26.667,-11.5019 -54.9991,-17.3169 -85.1756,-17.3169 -53.1547,0 -95.1661,14.4991 -125.829,43.4972 -30.6632,28.8188 -46.0076,65.502 -46.0076,109.819 0,29.1774 7.01898,55.3321 21.0057,78.3359 14.0123,22.8245 33.5067,40.5 58.8416,52.668 25.1556,12.1679 61.5058,22.8245 108.999,31.9953 63.9906,12.0142 108.487,23.3368 133.156,33.6604l0 13.833c0,26.667 -6.48103,45.6746 -19.4943,57.1765 -13.167,11.3482 -37.8359,17.0095 -74.0067,17.0095 -24.4896,0 -43.4972,-4.84156 -57.1509,-14.6784 -13.833,-9.6575 -24.8482,-26.8207 -33.353,-51.3359zm184.005 -110.997c-17.4962,-5.84061 -45.316,-12.834 -83.4849,-21.0057 -38.0152,-8.14612 -63.0171,-16.1642 -74.6727,-23.8236 -17.8292,-12.834 -26.8463,-28.8444 -26.8463,-48.3388 0,-19.315 7.17268,-35.8378 21.518,-49.8245 14.3197,-14.0123 32.482,-21.0057 54.6661,-21.0057 24.6689,0 48.3388,8.17173 70.8302,24.3359 16.4972,12.501 27.4867,27.5124 32.6613,45.4953 3.50949,11.6812 5.32828,33.9934 5.32828,66.834l0 27.333z"/>
|
||||
<glyph unicode="c" horiz-adv-x="556" d="M523.99 365.013l-135 -24.0029c-4.48293,26.8207 -14.8321,46.9811 -30.9962,60.6604 -16.1642,13.5 -36.9905,20.3397 -62.6585,20.3397 -34.1727,0 -61.5058,-11.8349 -81.8454,-35.5048 -20.3141,-23.6699 -30.4839,-63.1708 -30.4839,-118.682 0,-61.6595 10.3235,-105.157 30.9962,-130.645 20.6727,-25.5143 48.3388,-38.1689 82.9982,-38.1689 26.001,0 47.3397,7.48008 63.8369,22.3122 16.6509,14.8577 28.3321,40.3463 35.1718,76.6709l135 -23.0038c-14.0123,-61.9925 -40.8331,-108.82 -80.5134,-140.482 -39.6547,-31.6623 -92.835,-47.4934 -159.669,-47.4934 -75.6718,0 -136.153,23.9773 -181.161,71.8293 -45.1623,47.9801 -67.6538,114.327 -67.6538,199.17 0,85.816 22.6452,152.496 67.8331,200.323 45.1623,47.8264 106.309,71.6756 183.493,71.6756 62.9915,0 113.175,-13.6793 150.498,-40.8331 37.1699,-27.1793 63.8369,-68.4991 80.1547,-124.164z"/>
|
||||
<glyph unicode="d" horiz-adv-x="610" d="M547.993 0l-126.982 0 0 76.1585c-21.185,-29.6642 -46.3407,-51.8226 -75.1851,-66.834 -28.8188,-14.8321 -57.9963,-22.3122 -87.3274,-22.3122 -59.8407,0 -110.997,23.9773 -153.675,72.1623 -42.4981,48.1594 -63.8113,115.147 -63.8113,201.322 0,87.9934 20.6471,155.007 62.1462,200.835 41.4991,45.8283 93.8341,68.6784 157.184,68.6784 57.9963,0 108.333,-24.1822 150.652,-72.3416l0 258.319 136.998 0 0 -715.987zm-365.986 269.488c0,-55.4858 7.6594,-95.6528 22.8245,-120.475 22.1585,-36.0171 53.001,-54.0001 92.6813,-54.0001 31.483,0 58.3293,13.5 80.3084,40.5 22.1841,27 33.1737,67.1414 33.1737,120.808 0,59.8407 -10.6566,102.851 -32.149,129.185 -21.518,26.334 -48.8511,39.501 -82.3578,39.501 -32.482,0 -59.6613,-13.0133 -81.6661,-39.0143 -21.8254,-26.001 -32.815,-64.8359 -32.815,-116.505z"/>
|
||||
<glyph unicode="e" horiz-adv-x="556" d="M372.006 163.998l136.998 -23.0038c-17.4962,-50.1575 -45.3416,-88.3265 -83.1775,-114.66 -37.9896,-26.1547 -85.483,-39.3217 -142.327,-39.3217 -90.1709,0 -157.005,29.4848 -200.169,88.4802 -34.1727,47.3397 -51.3359,107.001 -51.3359,179.163 0,86.021 22.5171,153.521 67.3464,202.167 44.8293,48.8511 101.647,73.187 170.326,73.187 77.0039,0 137.844,-25.5143 182.494,-76.5172 44.4962,-51.0029 65.835,-129.16 63.8369,-234.495l-343.008 0c0.999052,-40.6537 12.0142,-72.3416 33.1737,-94.9868 21.0057,-22.6708 47.3397,-34.019 78.669,-34.019 21.4924,0 39.501,5.84061 54.0001,17.4962 14.6784,11.6812 25.668,30.5095 33.1737,56.5105zm7.99242 138.996c-0.999052,39.834 -11.1689,70.1642 -30.6632,90.8369 -19.4943,20.8264 -43.1642,31.1756 -71.1633,31.1756 -29.8435,0 -54.5124,-11.0152 -74.0067,-32.8406 -19.4943,-21.8254 -28.9981,-51.6689 -28.6651,-89.1718l204.498 0z"/>
|
||||
<glyph unicode="i" horiz-adv-x="277" d="M72.0086 589.005l0 126.982 136.998 0 0 -126.982 -136.998 0zm0 -589.005l0 518.995 136.998 0 0 -518.995 -136.998 0z"/>
|
||||
<glyph unicode="l" horiz-adv-x="277" d="M72.0086 0l0 715.987 136.998 0 0 -715.987 -136.998 0z"/>
|
||||
<glyph unicode="m" horiz-adv-x="889" d="M61.9925 518.995l126.009 0 0 -70.8302c45.1623,54.5124 99.0086,81.8454 161.488,81.8454 33.1737,0 62.0181,-6.83966 86.354,-20.519 24.4896,-13.6537 44.4962,-34.3264 59.9944,-61.9925 22.8245,27.6661 47.4934,48.3388 73.8274,61.9925 26.334,13.6793 54.5124,20.519 84.5096,20.519 37.9896,0 70.1642,-7.68502 96.6519,-23.1831 26.334,-15.4981 46.0076,-38.1689 58.9953,-68.1661 9.5038,-22.0048 14.166,-57.8169 14.166,-107.334l0 -331.327 -136.998 0 0 296.155c0,51.5152 -4.66224,84.6889 -14.166,99.521 -12.6547,19.4943 -32.3283,29.3311 -58.6623,29.3311 -19.1613,0 -37.3236,-5.84061 -54.3331,-17.4962 -16.8302,-11.8349 -29.1518,-28.9981 -36.6575,-51.5152 -7.5057,-22.6708 -11.1689,-58.3293 -11.1689,-107.155l0 -248.841 -136.998 0 0 284.013c0,50.3112 -2.51044,82.9982 -7.32638,97.4972 -4.84156,14.6528 -12.3473,25.668 -22.6708,32.815 -10.1698,7.17268 -24.1822,10.6822 -41.6784,10.6822 -21.1594,0 -40.167,-5.6613 -56.9972,-17.0095 -17.0095,-11.5019 -28.9981,-27.8198 -36.3245,-49.3378 -7.352,-21.4924 -11.0152,-57.1509 -11.0152,-106.822l0 -251.838 -136.998 0 0 518.995z"/>
|
||||
<glyph unicode="n" horiz-adv-x="610" d="M543.997 0l-136.998 0 0 264.493c0,55.9982 -2.99716,92.169 -8.83777,108.512 -5.99431,16.4972 -15.4981,29.1518 -28.8188,38.3226 -13.3463,9.17079 -29.3311,13.6793 -48.0057,13.6793 -24.0029,0 -45.4953,-6.50665 -64.5029,-19.4943 -19.1613,-13.0133 -32.1746,-30.3558 -39.168,-51.6689 -7.17268,-21.518 -10.6566,-61.1727 -10.6566,-119.169l0 -234.675 -136.998 0 0 518.995 126.982 0 0 -76.1585c45.4953,58.1756 102.672,87.1737 171.837,87.1737 30.3302,0 58.1756,-5.5076 83.3312,-16.3435 25.3349,-10.9896 44.3425,-24.8226 57.1765,-41.6784 12.9877,-16.9839 22.0048,-36.1452 27,-57.6632 5.17458,-21.4924 7.6594,-52.1556 7.6594,-92.169l0 -322.156z"/>
|
||||
<glyph unicode="o" horiz-adv-x="610" d="M39.9877 265.825c0,45.6746 11.1689,89.8378 33.686,132.515 22.4915,42.8312 54.3331,75.3388 95.4991,97.8303 41.1661,22.4915 86.9944,33.8397 137.818,33.8397 78.5153,0 142.685,-25.5143 192.843,-76.5172 50.1575,-51.1566 75.1595,-115.48 75.1595,-193.483 0,-78.669 -25.3349,-143.838 -75.8255,-195.507 -50.6699,-51.6689 -114.327,-77.4906 -191.178,-77.4906 -47.4934,0 -92.835,10.8103 -135.999,32.3283 -42.9849,21.4924 -75.8255,53.001 -98.317,94.6538 -22.5171,41.4991 -33.686,92.169 -33.686,151.83zm141.02 -7.32638c0,-51.4896 12.1679,-90.9906 36.5038,-118.324 24.4896,-27.5124 54.4868,-41.1661 90.3246,-41.1661 35.6585,0 65.6557,13.6537 89.8378,41.1661 24.1566,27.333 36.3245,67.167 36.3245,119.323 0,50.8236 -12.1679,89.9915 -36.3245,117.325 -24.1822,27.5124 -54.1794,41.1661 -89.8378,41.1661 -35.8378,0 -65.835,-13.6537 -90.3246,-41.1661 -24.3359,-27.333 -36.5038,-66.834 -36.5038,-118.324z"/>
|
||||
<glyph unicode="r" horiz-adv-x="389" d="M203.013 0l-137.024 0 0 518.995 127.008 0 0 -73.6737c21.8254,34.8387 41.4991,57.6889 58.9953,68.5247 17.4962,10.8103 37.3492,16.1642 59.5076,16.1642 31.3293,0 61.5058,-8.68407 90.5039,-25.8473l-42.4981 -119.656c-23.1831,14.9858 -44.6756,22.4915 -64.5029,22.4915 -19.3406,0 -35.6585,-5.32828 -49.0048,-15.8311 -13.3207,-10.6566 -23.8236,-29.6642 -31.5086,-57.3302 -7.6594,-27.6661 -11.4763,-85.6623 -11.4763,-173.835l0 -160.002z"/>
|
||||
<glyph unicode="t" horiz-adv-x="332" d="M308.989 518.995l0 -108.999 -93.9878 0 0 -210.16c0,-42.6775 0.819735,-67.5001 2.66414,-74.4934 1.8444,-7.01898 5.84061,-12.834 12.3473,-17.5218 6.32733,-4.48293 13.9867,-6.81405 23.1575,-6.81405 12.834,0 31.1756,4.32923 55.3321,13.167l11.5019 -106.668c-31.8416,-13.6793 -67.8331,-20.4934 -108.179,-20.4934 -24.6689,0 -46.8274,4.14991 -66.6547,12.4753 -19.8273,8.35105 -34.3264,19.1869 -43.4972,32.3539 -9.3501,13.3207 -15.6774,31.1499 -19.3406,53.8207 -2.84346,16.0105 -4.32923,48.3388 -4.32923,97.1642l0 227.169 -62.9915 0 0 108.999 62.9915 0 0 103.005 136.998 81.0001 0 -184.005 93.9878 0z"/>
|
||||
<glyph unicode="{" horiz-adv-x="389" d="M28.9981 200.989l0 117.017c23.8236,1.33207 41.6784,4.81594 53.8464,10.8359 11.9886,5.815 22.3122,15.6518 31.1499,29.4848 8.83777,13.833 14.8321,31.1756 18.1623,52.0019 2.51044,15.6774 3.84251,42.8312 3.84251,81.6661 0,63.1708 2.99716,107.18 8.83777,132.182 5.84061,25.0019 16.3179,44.983 31.6623,60.1481 15.3444,15.1651 37.6566,27 66.834,35.8378 19.8273,5.84061 51.1566,8.83777 93.8341,8.83777l25.8217 0 0 -116.992c-36.3245,0 -59.482,-1.9981 -69.8312,-6.17363 -10.3235,-3.99621 -17.8292,-10.1698 -22.8245,-18.4953 -4.84156,-8.35105 -7.32638,-22.5171 -7.32638,-42.6775 0,-20.4934 -1.33207,-59.5076 -3.99621,-116.659 -1.66509,-32.3283 -5.84061,-58.3293 -12.6803,-78.5153 -6.83966,-19.981 -15.4981,-36.4782 -26.1547,-49.4915 -10.5029,-12.9877 -26.667,-26.4877 -48.5181,-40.5 19.3406,-10.9896 35.0181,-24.0029 47.3397,-38.835 12.3473,-14.8321 21.6717,-32.8406 28.1784,-54.0001 6.66035,-21.1594 10.8359,-49.6708 12.834,-85.15 1.9981,-54.0001 2.99716,-88.6851 2.99716,-103.671 0,-21.518 2.66414,-36.5038 7.83872,-45.0086 5.14896,-8.32543 12.9877,-14.8321 23.6442,-19.1613 10.5029,-4.50854 33.353,-6.66035 68.4991,-6.66035l0 -117.017 -25.8217 0c-44.0095,0 -77.6699,3.50949 -101.16,10.5029 -23.3368,6.99337 -43.1642,18.6746 -59.1746,34.9924 -16.1642,16.1898 -27,36.3501 -32.5076,60.353 -5.48198,23.8236 -8.32543,61.6595 -8.32543,113.149 0,59.8407 -2.66414,98.8293 -7.83872,116.684 -7.17268,26.1547 -17.9829,44.8293 -32.482,55.9982 -14.4991,11.3226 -36.6831,17.6499 -66.6803,19.315z"/>
|
||||
<glyph unicode="}" horiz-adv-x="389" d="M355.996 200.989c-23.8236,-1.33207 -41.6528,-4.81594 -53.667,-10.6566 -12.1679,-5.99431 -22.4915,-15.8311 -31.1499,-29.6642 -8.50475,-13.833 -14.6784,-31.1756 -18.3416,-52.0019 -2.51044,-15.6774 -3.84251,-42.6775 -3.84251,-81.1538 0,-63.1708 -2.81784,-107.334 -8.50475,-132.515 -5.6613,-25.0019 -16.1642,-45.1623 -31.483,-60.3274 -15.3444,-15.1651 -37.8359,-27 -67.3464,-35.8378 -19.8273,-5.84061 -51.1566,-8.83777 -93.8341,-8.83777l-25.8217 0 0 117.017c34.9924,0 57.8169,2.1518 68.6528,6.66035 10.6822,4.32923 18.6746,10.6566 23.6699,19.0076 5.17458,8.32543 7.68502,22.3122 7.83872,42.3188 0.179317,19.8273 1.51139,57.8426 3.84251,113.841 1.66509,33.9934 5.99431,60.9934 13.167,81.4868 7.14707,20.3397 16.6509,37.6822 28.4858,51.8482 12.0142,14.166 27.1793,26.4877 45.6746,37.3236 -24.0029,15.6774 -41.6784,30.9962 -52.668,45.8283 -15.3444,21.518 -25.8473,48.8511 -31.3293,82.1784 -3.50949,22.6708 -5.99431,72.8283 -7.32638,150.319 -0.333017,24.3359 -2.51044,40.6794 -6.68596,48.8511 -3.99621,7.99242 -11.3226,14.3197 -22.0048,18.649 -10.6566,4.50854 -34.3264,6.68596 -71.317,6.68596l0 116.992 25.8217 0c44.0095,0 77.6699,-3.50949 101.186,-10.3235 23.3112,-6.83966 42.9849,-18.5209 58.9953,-34.8387 15.9848,-16.4972 26.8207,-36.6831 32.482,-60.6604 5.68691,-23.8492 8.50475,-61.6851 8.50475,-113.175 0,-59.5076 2.51044,-98.4963 7.32638,-116.659 7.17268,-26.1803 18.0086,-44.8549 32.6869,-56.0238 14.6528,-11.3226 36.9905,-17.6499 66.9877,-19.315l0 -117.017z"/>
|
||||
</font>
|
||||
<style type="text/css">
|
||||
<![CDATA[
|
||||
@font-face { font-family:"Arial";font-variant:normal;font-style:normal;font-weight:bold;src:url("#FontID0") format(svg)}
|
||||
.fil0 {fill:#373435}
|
||||
.fil1 {fill:black}
|
||||
.fnt0 {font-weight:bold;font-size:3.9037px;font-family:'Arial'}
|
||||
]]>
|
||||
</style>
|
||||
</defs>
|
||||
<g id="Layer_x0020_1">
|
||||
<metadata id="CorelCorpID_0Corel-Layer"/>
|
||||
<g transform="matrix(0.576293 0 0 1 -8.27317 4.15816)">
|
||||
<text x="17.5" y="12.5" class="fil0 fnt0">Nr. Comanda:{Article}</text>
|
||||
</g>
|
||||
<g transform="matrix(0.576293 0 0 1 -8.27317 7.72657)">
|
||||
<text x="17.5" y="12.5" class="fil0 fnt0">Nr. Art.:{NrArt}</text>
|
||||
</g>
|
||||
<g transform="matrix(0.576293 0 0 1 -8.33607 11.0472)">
|
||||
<text x="17.5" y="12.5" class="fil0 fnt0">Serial No.:{Serial}</text>
|
||||
</g>
|
||||
<g id="_1383785436736">
|
||||
<path class="fil1" d="M12.82 7.2323c-0.1161,0.0271 -0.6403,0.41 -0.7023,0.417 -0.0438,0.005 -0.4125,-0.272 -0.4735,-0.3166 -0.0598,-0.0436 -0.0888,-0.0806 -0.163,-0.1004 0,0.0747 0.0169,0.2103 0.0281,0.3011 0.0331,0.269 0.0855,0.5861 0.1616,0.848 0.103,0.3544 0.2131,0.6687 0.3663,0.9726 0.2431,0.4823 0.4418,0.7936 0.7893,1.208 0.9583,1.1426 2.579,1.9598 4.0759,1.9598 1.0308,0 1.7035,-0.1145 2.5607,-0.512 0.3018,-0.1399 0.5873,-0.307 0.8502,-0.4886 0.4492,-0.3106 0.7746,-0.6264 1.1172,-1.0338 0.0352,-0.0419 0.0492,-0.052 0.0813,-0.0942 0.6831,-0.895 1.0205,-1.7074 1.1757,-2.8408 0.0122,-0.0889 0.0311,-0.2456 0.0311,-0.3201 -0.1148,-0.0768 -0.2364,-0.1435 -0.3512,-0.2195 -0.4402,-0.2912 -0.3377,-0.2606 -0.7083,0.016 -0.4465,0.3331 -0.1917,0.0604 -0.3623,0.801 -0.0383,0.1665 -0.0787,0.3029 -0.1284,0.4642 -0.2415,0.783 -0.8476,1.5453 -1.4754,2.0363 -0.1897,0.1484 -0.5097,0.3427 -0.7199,0.4433 -1.4392,0.6888 -3.2727,0.5256 -4.5139,-0.4835 -0.1901,-0.1546 -0.4507,-0.3749 -0.5984,-0.5649 -0.2922,-0.3762 -0.4778,-0.591 -0.6835,-1.0723 -0.1761,-0.412 -0.3573,-0.9691 -0.3573,-1.4206z"/>
|
||||
<path class="fil1" d="M11.4812 6.5739c0.1103,0.0738 0.2091,0.1467 0.3248,0.2238 0.4133,0.2755 0.2641,0.2761 0.6717,0.0045 0.1215,-0.0811 0.227,-0.1511 0.3423,-0.2283 0,-0.7199 0.395,-1.6532 0.8432,-2.2515 0.2017,-0.2693 0.6154,-0.6932 0.9082,-0.8915 0.7337,-0.4969 1.3743,-0.7636 2.287,-0.8077 0.3218,-0.0155 0.0567,-0.0336 0.4622,-0.0011 0.2873,0.023 0.3574,0.0038 0.706,0.0841 0.5154,0.1187 1.0246,0.3291 1.4484,0.6147 0.8452,0.5696 1.4617,1.4005 1.7486,2.3776 0.063,0.2147 0.1562,0.6133 0.1562,0.8754 0.1055,-0.0282 0.5565,-0.4104 0.6145,-0.417 0.0786,0.021 0.2734,0.1575 0.3607,0.2099 0.0787,0.0473 0.2939,0.1908 0.3636,0.2071l-0.0687 -0.5898c-0.1423,-0.8307 -0.4834,-1.7021 -0.9879,-2.3701 -0.2122,-0.2809 -0.5138,-0.6564 -0.7903,-0.8778 -0.2016,-0.1613 -0.3013,-0.2735 -0.5584,-0.4512 -0.8199,-0.5666 -1.9324,-1.0006 -3.0378,-1.0006 -1.0533,0 -1.6632,0.1218 -2.5238,0.5051 -1.6549,0.7371 -2.8948,2.3661 -3.1985,4.176 -0.0172,0.1027 -0.0262,0.1807 -0.0409,0.2883 -0.0122,0.0889 -0.0311,0.2456 -0.0311,0.3201z"/>
|
||||
<path class="fil1" d="M16.4195 7.4518l-1.4213 -1.41 -1.0534 1.0643 2.4473 2.4582 3.8738 -3.8629 -1.0537 -1.0423 -0.1758 0.164c-0.0315,0.0363 -0.0538,0.0557 -0.0893,0.0863l-0.6063 0.6008c-0.003,0.0034 -0.0071,0.0084 -0.0101,0.0119l-0.1755 0.1757c-0.0032,0.0032 -0.0077,0.0078 -0.0109,0.011l-0.2499 0.2549c-0.0507,0.0484 -0.0461,0.0309 -0.092,0.0836 -0.1863,0.2139 -1.3182,1.3079 -1.3829,1.4045z"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 18 KiB |
64
dist/conf/label_template_nok.svg
vendored
64
dist/conf/label_template_nok.svg
vendored
@@ -1,64 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Creator: CorelDRAW -->
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" width="35mm" height="25mm" version="1.1" style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd; clip-rule:evenodd"
|
||||
viewBox="0 0 35 25"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:xodm="http://www.corel.com/coreldraw/odm/2003">
|
||||
<defs>
|
||||
<font id="FontID0" horiz-adv-x="722" font-variant="normal" style="fill-rule:nonzero" font-style="normal" font-weight="700">
|
||||
<font-face
|
||||
font-family="Arial">
|
||||
<font-face-src>
|
||||
<font-face-name name="Arial Bold"/>
|
||||
</font-face-src>
|
||||
</font-face>
|
||||
<missing-glyph><path d="M0 0z"/></missing-glyph>
|
||||
<glyph unicode="." horiz-adv-x="277" d="M71.0096 0l0 136.998 136.998 0 0 -136.998 -136.998 0z"/>
|
||||
<glyph unicode=":" horiz-adv-x="332" d="M98.0096 381.997l0 136.998 136.998 0 0 -136.998 -136.998 0zm0 -381.997l0 136.998 136.998 0 0 -136.998 -136.998 0z"/>
|
||||
<glyph unicode="A" horiz-adv-x="722" d="M718.011 0l-156.185 0 -61.8388 162.999 -287.163 0 -59.482 -162.999 -153.342 0 277.993 715.987 153.162 0 286.856 -715.987zm-265.005 284.013l-99.4954 264.979 -96.6775 -264.979 196.173 0z"/>
|
||||
<glyph unicode="C" horiz-adv-x="722" d="M531.009 264.006l139.995 -43.0105c-21.4924,-78.8227 -57.3302,-137.331 -107.334,-175.654 -50.0038,-38.1689 -113.328,-57.3302 -190.179,-57.3302 -95.1661,0 -173.323,32.482 -234.649,97.4972 -61.1727,64.9896 -91.836,153.828 -91.836,266.67 0,119.143 30.8169,211.825 92.3227,277.813 61.5058,66.0143 142.506,99.0086 242.847,99.0086 87.6604,0 158.824,-26.001 213.49,-77.8236 32.6613,-30.6888 56.9972,-74.6727 73.3407,-132.182l-143.018 -33.9934c-8.47914,36.9905 -26.1547,66.3217 -52.9754,87.8397 -27,21.4924 -59.687,32.149 -98.0096,32.149 -53.1803,0 -96.3445,-18.982 -129.339,-57.1509 -33.1737,-38.0152 -49.6708,-99.6747 -49.6708,-185.004 0,-90.3246 16.3435,-154.827 48.8511,-193.176 32.6613,-38.5019 74.9801,-57.6632 127.161,-57.6632 38.5019,0 71.65,12.1679 99.316,36.6831 27.6661,24.4896 47.6727,62.8122 59.687,115.326z"/>
|
||||
<glyph unicode="N" horiz-adv-x="722" d="M73.0077 0l0 715.987 140.328 0 294.669 -479.827 0 479.827 134.001 0 0 -715.987 -144.837 0 -290.161 470.656 0 -470.656 -134.001 0z"/>
|
||||
<glyph unicode="S" horiz-adv-x="667" d="M34.9924 232.011l141.02 13.9867c8.47914,-47.1604 25.4886,-81.6661 51.3103,-103.825 25.8473,-22.1841 60.686,-33.1737 104.516,-33.1737 46.315,0 81.3331,9.83682 104.824,29.5105 23.5162,19.648 35.3255,42.6518 35.3255,68.9858 0,17.0095 -4.99526,31.3293 -14.8321,43.3435 -9.8112,11.8349 -27.1537,22.1585 -51.8226,30.8169 -16.8302,6.01993 -55.1784,16.3435 -115.173,31.3549 -77.1576,19.315 -131.337,42.9849 -162.487,71.1633 -43.8302,39.501 -65.6813,87.6604 -65.6813,144.504 0,36.4782 10.3492,70.8302 30.8425,102.646 20.6727,31.8416 50.3369,55.9982 89.1718,72.6746 38.835,16.6765 85.483,25.0019 140.482,25.0019 89.5048,0 157.005,-19.8273 202.167,-59.6613 45.3416,-39.834 69.0115,-92.835 71.3426,-159.336l-144.991 -4.99526c-6.17363,36.9905 -19.3406,63.5039 -39.501,79.668 -20.186,16.1642 -50.5162,24.3359 -90.8369,24.3359 -41.6784,0 -74.3397,-8.68407 -97.8303,-26.001 -15.1651,-11.1689 -22.8501,-26.001 -22.8501,-44.6756 0,-17.0095 7.17268,-31.5086 21.518,-43.4972 18.1623,-15.4981 62.3255,-31.5086 132.49,-48.1594 70.1642,-16.5228 122.012,-33.8397 155.494,-51.5152 33.686,-17.8292 60.02,-41.9858 79.002,-72.8283 19.0076,-30.8425 28.5114,-68.8321 28.5114,-113.994 0,-41.0124 -11.3482,-79.5143 -34.1727,-115.352 -22.8245,-35.8122 -54.9991,-62.4792 -96.6775,-79.8217 -41.6528,-17.4962 -93.6547,-26.1547 -155.827,-26.1547 -90.5039,0 -160.002,20.8264 -208.495,62.6585 -48.4925,41.6528 -77.3369,102.493 -86.8407,182.34z"/>
|
||||
<glyph unicode="a" horiz-adv-x="556" d="M173.989 358.993l-123.985 22.0048c13.9867,50.6699 38.1689,88.1728 72.3416,112.509 34.1471,24.3359 84.9963,36.5038 152.317,36.5038 61.1727,0 106.847,-7.17268 136.845,-21.6717 29.8179,-14.4991 51.0029,-32.8406 63.1708,-55.1784 12.1679,-22.3378 18.316,-63.1708 18.316,-122.832l-1.9981 -160.002c0,-45.4953 2.17742,-79.1557 6.50665,-100.827 4.32923,-21.6717 12.501,-44.8293 24.4896,-69.4982l-135.999 0c-3.48387,8.99147 -7.99242,22.3378 -13.167,39.9877 -2.1518,8.17173 -3.81689,13.5 -4.81594,16.0105 -23.3368,-23.0038 -48.3388,-40.167 -75.0058,-51.6689 -26.667,-11.5019 -54.9991,-17.3169 -85.1756,-17.3169 -53.1547,0 -95.1661,14.4991 -125.829,43.4972 -30.6632,28.8188 -46.0076,65.502 -46.0076,109.819 0,29.1774 7.01898,55.3321 21.0057,78.3359 14.0123,22.8245 33.5067,40.5 58.8416,52.668 25.1556,12.1679 61.5058,22.8245 108.999,31.9953 63.9906,12.0142 108.487,23.3368 133.156,33.6604l0 13.833c0,26.667 -6.48103,45.6746 -19.4943,57.1765 -13.167,11.3482 -37.8359,17.0095 -74.0067,17.0095 -24.4896,0 -43.4972,-4.84156 -57.1509,-14.6784 -13.833,-9.6575 -24.8482,-26.8207 -33.353,-51.3359zm184.005 -110.997c-17.4962,-5.84061 -45.316,-12.834 -83.4849,-21.0057 -38.0152,-8.14612 -63.0171,-16.1642 -74.6727,-23.8236 -17.8292,-12.834 -26.8463,-28.8444 -26.8463,-48.3388 0,-19.315 7.17268,-35.8378 21.518,-49.8245 14.3197,-14.0123 32.482,-21.0057 54.6661,-21.0057 24.6689,0 48.3388,8.17173 70.8302,24.3359 16.4972,12.501 27.4867,27.5124 32.6613,45.4953 3.50949,11.6812 5.32828,33.9934 5.32828,66.834l0 27.333z"/>
|
||||
<glyph unicode="c" horiz-adv-x="556" d="M523.99 365.013l-135 -24.0029c-4.48293,26.8207 -14.8321,46.9811 -30.9962,60.6604 -16.1642,13.5 -36.9905,20.3397 -62.6585,20.3397 -34.1727,0 -61.5058,-11.8349 -81.8454,-35.5048 -20.3141,-23.6699 -30.4839,-63.1708 -30.4839,-118.682 0,-61.6595 10.3235,-105.157 30.9962,-130.645 20.6727,-25.5143 48.3388,-38.1689 82.9982,-38.1689 26.001,0 47.3397,7.48008 63.8369,22.3122 16.6509,14.8577 28.3321,40.3463 35.1718,76.6709l135 -23.0038c-14.0123,-61.9925 -40.8331,-108.82 -80.5134,-140.482 -39.6547,-31.6623 -92.835,-47.4934 -159.669,-47.4934 -75.6718,0 -136.153,23.9773 -181.161,71.8293 -45.1623,47.9801 -67.6538,114.327 -67.6538,199.17 0,85.816 22.6452,152.496 67.8331,200.323 45.1623,47.8264 106.309,71.6756 183.493,71.6756 62.9915,0 113.175,-13.6793 150.498,-40.8331 37.1699,-27.1793 63.8369,-68.4991 80.1547,-124.164z"/>
|
||||
<glyph unicode="d" horiz-adv-x="610" d="M547.993 0l-126.982 0 0 76.1585c-21.185,-29.6642 -46.3407,-51.8226 -75.1851,-66.834 -28.8188,-14.8321 -57.9963,-22.3122 -87.3274,-22.3122 -59.8407,0 -110.997,23.9773 -153.675,72.1623 -42.4981,48.1594 -63.8113,115.147 -63.8113,201.322 0,87.9934 20.6471,155.007 62.1462,200.835 41.4991,45.8283 93.8341,68.6784 157.184,68.6784 57.9963,0 108.333,-24.1822 150.652,-72.3416l0 258.319 136.998 0 0 -715.987zm-365.986 269.488c0,-55.4858 7.6594,-95.6528 22.8245,-120.475 22.1585,-36.0171 53.001,-54.0001 92.6813,-54.0001 31.483,0 58.3293,13.5 80.3084,40.5 22.1841,27 33.1737,67.1414 33.1737,120.808 0,59.8407 -10.6566,102.851 -32.149,129.185 -21.518,26.334 -48.8511,39.501 -82.3578,39.501 -32.482,0 -59.6613,-13.0133 -81.6661,-39.0143 -21.8254,-26.001 -32.815,-64.8359 -32.815,-116.505z"/>
|
||||
<glyph unicode="e" horiz-adv-x="556" d="M372.006 163.998l136.998 -23.0038c-17.4962,-50.1575 -45.3416,-88.3265 -83.1775,-114.66 -37.9896,-26.1547 -85.483,-39.3217 -142.327,-39.3217 -90.1709,0 -157.005,29.4848 -200.169,88.4802 -34.1727,47.3397 -51.3359,107.001 -51.3359,179.163 0,86.021 22.5171,153.521 67.3464,202.167 44.8293,48.8511 101.647,73.187 170.326,73.187 77.0039,0 137.844,-25.5143 182.494,-76.5172 44.4962,-51.0029 65.835,-129.16 63.8369,-234.495l-343.008 0c0.999052,-40.6537 12.0142,-72.3416 33.1737,-94.9868 21.0057,-22.6708 47.3397,-34.019 78.669,-34.019 21.4924,0 39.501,5.84061 54.0001,17.4962 14.6784,11.6812 25.668,30.5095 33.1737,56.5105zm7.99242 138.996c-0.999052,39.834 -11.1689,70.1642 -30.6632,90.8369 -19.4943,20.8264 -43.1642,31.1756 -71.1633,31.1756 -29.8435,0 -54.5124,-11.0152 -74.0067,-32.8406 -19.4943,-21.8254 -28.9981,-51.6689 -28.6651,-89.1718l204.498 0z"/>
|
||||
<glyph unicode="i" horiz-adv-x="277" d="M72.0086 589.005l0 126.982 136.998 0 0 -126.982 -136.998 0zm0 -589.005l0 518.995 136.998 0 0 -518.995 -136.998 0z"/>
|
||||
<glyph unicode="l" horiz-adv-x="277" d="M72.0086 0l0 715.987 136.998 0 0 -715.987 -136.998 0z"/>
|
||||
<glyph unicode="m" horiz-adv-x="889" d="M61.9925 518.995l126.009 0 0 -70.8302c45.1623,54.5124 99.0086,81.8454 161.488,81.8454 33.1737,0 62.0181,-6.83966 86.354,-20.519 24.4896,-13.6537 44.4962,-34.3264 59.9944,-61.9925 22.8245,27.6661 47.4934,48.3388 73.8274,61.9925 26.334,13.6793 54.5124,20.519 84.5096,20.519 37.9896,0 70.1642,-7.68502 96.6519,-23.1831 26.334,-15.4981 46.0076,-38.1689 58.9953,-68.1661 9.5038,-22.0048 14.166,-57.8169 14.166,-107.334l0 -331.327 -136.998 0 0 296.155c0,51.5152 -4.66224,84.6889 -14.166,99.521 -12.6547,19.4943 -32.3283,29.3311 -58.6623,29.3311 -19.1613,0 -37.3236,-5.84061 -54.3331,-17.4962 -16.8302,-11.8349 -29.1518,-28.9981 -36.6575,-51.5152 -7.5057,-22.6708 -11.1689,-58.3293 -11.1689,-107.155l0 -248.841 -136.998 0 0 284.013c0,50.3112 -2.51044,82.9982 -7.32638,97.4972 -4.84156,14.6528 -12.3473,25.668 -22.6708,32.815 -10.1698,7.17268 -24.1822,10.6822 -41.6784,10.6822 -21.1594,0 -40.167,-5.6613 -56.9972,-17.0095 -17.0095,-11.5019 -28.9981,-27.8198 -36.3245,-49.3378 -7.352,-21.4924 -11.0152,-57.1509 -11.0152,-106.822l0 -251.838 -136.998 0 0 518.995z"/>
|
||||
<glyph unicode="n" horiz-adv-x="610" d="M543.997 0l-136.998 0 0 264.493c0,55.9982 -2.99716,92.169 -8.83777,108.512 -5.99431,16.4972 -15.4981,29.1518 -28.8188,38.3226 -13.3463,9.17079 -29.3311,13.6793 -48.0057,13.6793 -24.0029,0 -45.4953,-6.50665 -64.5029,-19.4943 -19.1613,-13.0133 -32.1746,-30.3558 -39.168,-51.6689 -7.17268,-21.518 -10.6566,-61.1727 -10.6566,-119.169l0 -234.675 -136.998 0 0 518.995 126.982 0 0 -76.1585c45.4953,58.1756 102.672,87.1737 171.837,87.1737 30.3302,0 58.1756,-5.5076 83.3312,-16.3435 25.3349,-10.9896 44.3425,-24.8226 57.1765,-41.6784 12.9877,-16.9839 22.0048,-36.1452 27,-57.6632 5.17458,-21.4924 7.6594,-52.1556 7.6594,-92.169l0 -322.156z"/>
|
||||
<glyph unicode="o" horiz-adv-x="610" d="M39.9877 265.825c0,45.6746 11.1689,89.8378 33.686,132.515 22.4915,42.8312 54.3331,75.3388 95.4991,97.8303 41.1661,22.4915 86.9944,33.8397 137.818,33.8397 78.5153,0 142.685,-25.5143 192.843,-76.5172 50.1575,-51.1566 75.1595,-115.48 75.1595,-193.483 0,-78.669 -25.3349,-143.838 -75.8255,-195.507 -50.6699,-51.6689 -114.327,-77.4906 -191.178,-77.4906 -47.4934,0 -92.835,10.8103 -135.999,32.3283 -42.9849,21.4924 -75.8255,53.001 -98.317,94.6538 -22.5171,41.4991 -33.686,92.169 -33.686,151.83zm141.02 -7.32638c0,-51.4896 12.1679,-90.9906 36.5038,-118.324 24.4896,-27.5124 54.4868,-41.1661 90.3246,-41.1661 35.6585,0 65.6557,13.6537 89.8378,41.1661 24.1566,27.333 36.3245,67.167 36.3245,119.323 0,50.8236 -12.1679,89.9915 -36.3245,117.325 -24.1822,27.5124 -54.1794,41.1661 -89.8378,41.1661 -35.8378,0 -65.835,-13.6537 -90.3246,-41.1661 -24.3359,-27.333 -36.5038,-66.834 -36.5038,-118.324z"/>
|
||||
<glyph unicode="r" horiz-adv-x="389" d="M203.013 0l-137.024 0 0 518.995 127.008 0 0 -73.6737c21.8254,34.8387 41.4991,57.6889 58.9953,68.5247 17.4962,10.8103 37.3492,16.1642 59.5076,16.1642 31.3293,0 61.5058,-8.68407 90.5039,-25.8473l-42.4981 -119.656c-23.1831,14.9858 -44.6756,22.4915 -64.5029,22.4915 -19.3406,0 -35.6585,-5.32828 -49.0048,-15.8311 -13.3207,-10.6566 -23.8236,-29.6642 -31.5086,-57.3302 -7.6594,-27.6661 -11.4763,-85.6623 -11.4763,-173.835l0 -160.002z"/>
|
||||
<glyph unicode="t" horiz-adv-x="332" d="M308.989 518.995l0 -108.999 -93.9878 0 0 -210.16c0,-42.6775 0.819735,-67.5001 2.66414,-74.4934 1.8444,-7.01898 5.84061,-12.834 12.3473,-17.5218 6.32733,-4.48293 13.9867,-6.81405 23.1575,-6.81405 12.834,0 31.1756,4.32923 55.3321,13.167l11.5019 -106.668c-31.8416,-13.6793 -67.8331,-20.4934 -108.179,-20.4934 -24.6689,0 -46.8274,4.14991 -66.6547,12.4753 -19.8273,8.35105 -34.3264,19.1869 -43.4972,32.3539 -9.3501,13.3207 -15.6774,31.1499 -19.3406,53.8207 -2.84346,16.0105 -4.32923,48.3388 -4.32923,97.1642l0 227.169 -62.9915 0 0 108.999 62.9915 0 0 103.005 136.998 81.0001 0 -184.005 93.9878 0z"/>
|
||||
<glyph unicode="{" horiz-adv-x="389" d="M28.9981 200.989l0 117.017c23.8236,1.33207 41.6784,4.81594 53.8464,10.8359 11.9886,5.815 22.3122,15.6518 31.1499,29.4848 8.83777,13.833 14.8321,31.1756 18.1623,52.0019 2.51044,15.6774 3.84251,42.8312 3.84251,81.6661 0,63.1708 2.99716,107.18 8.83777,132.182 5.84061,25.0019 16.3179,44.983 31.6623,60.1481 15.3444,15.1651 37.6566,27 66.834,35.8378 19.8273,5.84061 51.1566,8.83777 93.8341,8.83777l25.8217 0 0 -116.992c-36.3245,0 -59.482,-1.9981 -69.8312,-6.17363 -10.3235,-3.99621 -17.8292,-10.1698 -22.8245,-18.4953 -4.84156,-8.35105 -7.32638,-22.5171 -7.32638,-42.6775 0,-20.4934 -1.33207,-59.5076 -3.99621,-116.659 -1.66509,-32.3283 -5.84061,-58.3293 -12.6803,-78.5153 -6.83966,-19.981 -15.4981,-36.4782 -26.1547,-49.4915 -10.5029,-12.9877 -26.667,-26.4877 -48.5181,-40.5 19.3406,-10.9896 35.0181,-24.0029 47.3397,-38.835 12.3473,-14.8321 21.6717,-32.8406 28.1784,-54.0001 6.66035,-21.1594 10.8359,-49.6708 12.834,-85.15 1.9981,-54.0001 2.99716,-88.6851 2.99716,-103.671 0,-21.518 2.66414,-36.5038 7.83872,-45.0086 5.14896,-8.32543 12.9877,-14.8321 23.6442,-19.1613 10.5029,-4.50854 33.353,-6.66035 68.4991,-6.66035l0 -117.017 -25.8217 0c-44.0095,0 -77.6699,3.50949 -101.16,10.5029 -23.3368,6.99337 -43.1642,18.6746 -59.1746,34.9924 -16.1642,16.1898 -27,36.3501 -32.5076,60.353 -5.48198,23.8236 -8.32543,61.6595 -8.32543,113.149 0,59.8407 -2.66414,98.8293 -7.83872,116.684 -7.17268,26.1547 -17.9829,44.8293 -32.482,55.9982 -14.4991,11.3226 -36.6831,17.6499 -66.6803,19.315z"/>
|
||||
<glyph unicode="}" horiz-adv-x="389" d="M355.996 200.989c-23.8236,-1.33207 -41.6528,-4.81594 -53.667,-10.6566 -12.1679,-5.99431 -22.4915,-15.8311 -31.1499,-29.6642 -8.50475,-13.833 -14.6784,-31.1756 -18.3416,-52.0019 -2.51044,-15.6774 -3.84251,-42.6775 -3.84251,-81.1538 0,-63.1708 -2.81784,-107.334 -8.50475,-132.515 -5.6613,-25.0019 -16.1642,-45.1623 -31.483,-60.3274 -15.3444,-15.1651 -37.8359,-27 -67.3464,-35.8378 -19.8273,-5.84061 -51.1566,-8.83777 -93.8341,-8.83777l-25.8217 0 0 117.017c34.9924,0 57.8169,2.1518 68.6528,6.66035 10.6822,4.32923 18.6746,10.6566 23.6699,19.0076 5.17458,8.32543 7.68502,22.3122 7.83872,42.3188 0.179317,19.8273 1.51139,57.8426 3.84251,113.841 1.66509,33.9934 5.99431,60.9934 13.167,81.4868 7.14707,20.3397 16.6509,37.6822 28.4858,51.8482 12.0142,14.166 27.1793,26.4877 45.6746,37.3236 -24.0029,15.6774 -41.6784,30.9962 -52.668,45.8283 -15.3444,21.518 -25.8473,48.8511 -31.3293,82.1784 -3.50949,22.6708 -5.99431,72.8283 -7.32638,150.319 -0.333017,24.3359 -2.51044,40.6794 -6.68596,48.8511 -3.99621,7.99242 -11.3226,14.3197 -22.0048,18.649 -10.6566,4.50854 -34.3264,6.68596 -71.317,6.68596l0 116.992 25.8217 0c44.0095,0 77.6699,-3.50949 101.186,-10.3235 23.3112,-6.83966 42.9849,-18.5209 58.9953,-34.8387 15.9848,-16.4972 26.8207,-36.6831 32.482,-60.6604 5.68691,-23.8492 8.50475,-61.6851 8.50475,-113.175 0,-59.5076 2.51044,-98.4963 7.32638,-116.659 7.17268,-26.1803 18.0086,-44.8549 32.6869,-56.0238 14.6528,-11.3226 36.9905,-17.6499 66.9877,-19.315l0 -117.017z"/>
|
||||
</font>
|
||||
<style type="text/css">
|
||||
<![CDATA[
|
||||
@font-face { font-family:"Arial";font-variant:normal;font-style:normal;font-weight:bold;src:url("#FontID0") format(svg)}
|
||||
.fil0 {fill:#373435}
|
||||
.fil1 {fill:#373435}
|
||||
.fil2 {fill:#373435;fill-rule:nonzero}
|
||||
.fnt0 {font-weight:bold;font-size:3.9037px;font-family:'Arial'}
|
||||
]]>
|
||||
</style>
|
||||
</defs>
|
||||
<g id="Layer_x0020_1">
|
||||
<metadata id="CorelCorpID_0Corel-Layer"/>
|
||||
<g transform="matrix(0.576293 0 0 1 -8.27317 4.15816)">
|
||||
<text x="17.5" y="12.5" class="fil0 fnt0">Nr. Comanda:{Article}</text>
|
||||
</g>
|
||||
<g transform="matrix(0.576293 0 0 1 -8.27317 7.72657)">
|
||||
<text x="17.5" y="12.5" class="fil0 fnt0">Nr. Art.:{NrArt}</text>
|
||||
</g>
|
||||
<g transform="matrix(0.576293 0 0 1 -8.33607 11.0472)">
|
||||
<text x="17.5" y="12.5" class="fil0 fnt0">Serial No.:{Serial}</text>
|
||||
</g>
|
||||
<g id="_1503869020736">
|
||||
<path class="fil1" d="M13.9026 6.1147c-0.0969,0.0226 -0.5344,0.3421 -0.5861,0.348 -0.0365,0.0041 -0.3442,-0.227 -0.3951,-0.2642 -0.0499,-0.0364 -0.0741,-0.0672 -0.136,-0.0838 0,0.0623 0.0141,0.1755 0.0234,0.2513 0.0277,0.2244 0.0714,0.489 0.1349,0.7076 0.086,0.2957 0.1778,0.558 0.3056,0.8116 0.2029,0.4024 0.3688,0.6622 0.6587,1.008 0.7996,0.9535 2.1521,1.6354 3.4012,1.6354 0.8602,0 1.4215,-0.0956 2.1368,-0.4273 0.2518,-0.1167 0.4901,-0.2561 0.7094,-0.4077 0.3749,-0.2591 0.6465,-0.5227 0.9323,-0.8626 0.0294,-0.035 0.0411,-0.0435 0.0679,-0.0786 0.57,-0.7469 0.8516,-1.4248 0.9811,-2.3706 0.0101,-0.0742 0.0259,-0.2049 0.0259,-0.2671 -0.0958,-0.0641 -0.1973,-0.1198 -0.293,-0.1831 -0.3674,-0.243 -0.2819,-0.2176 -0.5911,0.0133 -0.3726,0.278 -0.1599,0.0504 -0.3023,0.6684 -0.032,0.1389 -0.0657,0.2528 -0.1072,0.3873 -0.2015,0.6534 -0.7073,1.2896 -1.2311,1.6992 -0.1584,0.1239 -0.4254,0.286 -0.6008,0.37 -1.2009,0.5747 -2.7309,0.4386 -3.7667,-0.4035 -0.1586,-0.1289 -0.3761,-0.3128 -0.4993,-0.4714 -0.2438,-0.3139 -0.3987,-0.4932 -0.5704,-0.8948 -0.1469,-0.3437 -0.2981,-0.8086 -0.2981,-1.1854z"/>
|
||||
<path class="fil1" d="M12.7854 5.5653c0.092,0.0616 0.1745,0.1224 0.2711,0.1868 0.3448,0.2298 0.2204,0.2304 0.5604,0.0037 0.1015,-0.0677 0.1895,-0.1261 0.2857,-0.1905 0,-0.6008 0.3296,-1.3796 0.7036,-1.8788 0.1683,-0.2248 0.5135,-0.5784 0.7579,-0.7439 0.6122,-0.4147 1.1468,-0.6373 1.9084,-0.674 0.2685,-0.013 0.0473,-0.0281 0.3856,-0.001 0.2398,0.0192 0.2983,0.0032 0.5892,0.0702 0.4301,0.0991 0.855,0.2746 1.2086,0.513 0.7053,0.4753 1.2198,1.1687 1.4592,1.984 0.0526,0.1792 0.1303,0.5118 0.1303,0.7305 0.0881,-0.0235 0.4644,-0.3425 0.5128,-0.348 0.0656,0.0175 0.2282,0.1315 0.301,0.1752 0.0656,0.0395 0.2453,0.1592 0.3034,0.1728l-0.0573 -0.4922c-0.1187,-0.6931 -0.4034,-1.4203 -0.8244,-1.9778 -0.177,-0.2344 -0.4287,-0.5477 -0.6595,-0.7324 -0.1682,-0.1347 -0.2514,-0.2282 -0.466,-0.3765 -0.6841,-0.4728 -1.6125,-0.835 -2.5349,-0.835 -0.8789,0 -1.3878,0.1016 -2.106,0.4215 -1.3809,0.6151 -2.4156,1.9744 -2.669,3.4847 -0.0144,0.0857 -0.0219,0.1508 -0.0342,0.2406 -0.0101,0.0742 -0.0259,0.2049 -0.0259,0.2671z"/>
|
||||
<polygon class="fil2" points="14.8273,3.5997 16.8077,3.5997 17.5,4.8137 18.3014,3.5997 20.1392,3.5997 18.658,5.6752 20.2482,7.9549 18.3014,7.9549 17.5,6.5521 16.5476,7.9549 14.7434,7.9549 16.328,5.6752 "/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 18 KiB |
63
dist/conf/label_template_ok.svg
vendored
63
dist/conf/label_template_ok.svg
vendored
@@ -1,63 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Creator: CorelDRAW -->
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" width="35mm" height="25mm" version="1.1" style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd; clip-rule:evenodd"
|
||||
viewBox="0 0 35 25"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:xodm="http://www.corel.com/coreldraw/odm/2003">
|
||||
<defs>
|
||||
<font id="FontID0" horiz-adv-x="722" font-variant="normal" style="fill-rule:nonzero" font-style="normal" font-weight="700">
|
||||
<font-face
|
||||
font-family="Arial">
|
||||
<font-face-src>
|
||||
<font-face-name name="Arial Bold"/>
|
||||
</font-face-src>
|
||||
</font-face>
|
||||
<missing-glyph><path d="M0 0z"/></missing-glyph>
|
||||
<glyph unicode="." horiz-adv-x="277" d="M71.0096 0l0 136.998 136.998 0 0 -136.998 -136.998 0z"/>
|
||||
<glyph unicode=":" horiz-adv-x="332" d="M98.0096 381.997l0 136.998 136.998 0 0 -136.998 -136.998 0zm0 -381.997l0 136.998 136.998 0 0 -136.998 -136.998 0z"/>
|
||||
<glyph unicode="A" horiz-adv-x="722" d="M718.011 0l-156.185 0 -61.8388 162.999 -287.163 0 -59.482 -162.999 -153.342 0 277.993 715.987 153.162 0 286.856 -715.987zm-265.005 284.013l-99.4954 264.979 -96.6775 -264.979 196.173 0z"/>
|
||||
<glyph unicode="C" horiz-adv-x="722" d="M531.009 264.006l139.995 -43.0105c-21.4924,-78.8227 -57.3302,-137.331 -107.334,-175.654 -50.0038,-38.1689 -113.328,-57.3302 -190.179,-57.3302 -95.1661,0 -173.323,32.482 -234.649,97.4972 -61.1727,64.9896 -91.836,153.828 -91.836,266.67 0,119.143 30.8169,211.825 92.3227,277.813 61.5058,66.0143 142.506,99.0086 242.847,99.0086 87.6604,0 158.824,-26.001 213.49,-77.8236 32.6613,-30.6888 56.9972,-74.6727 73.3407,-132.182l-143.018 -33.9934c-8.47914,36.9905 -26.1547,66.3217 -52.9754,87.8397 -27,21.4924 -59.687,32.149 -98.0096,32.149 -53.1803,0 -96.3445,-18.982 -129.339,-57.1509 -33.1737,-38.0152 -49.6708,-99.6747 -49.6708,-185.004 0,-90.3246 16.3435,-154.827 48.8511,-193.176 32.6613,-38.5019 74.9801,-57.6632 127.161,-57.6632 38.5019,0 71.65,12.1679 99.316,36.6831 27.6661,24.4896 47.6727,62.8122 59.687,115.326z"/>
|
||||
<glyph unicode="N" horiz-adv-x="722" d="M73.0077 0l0 715.987 140.328 0 294.669 -479.827 0 479.827 134.001 0 0 -715.987 -144.837 0 -290.161 470.656 0 -470.656 -134.001 0z"/>
|
||||
<glyph unicode="S" horiz-adv-x="667" d="M34.9924 232.011l141.02 13.9867c8.47914,-47.1604 25.4886,-81.6661 51.3103,-103.825 25.8473,-22.1841 60.686,-33.1737 104.516,-33.1737 46.315,0 81.3331,9.83682 104.824,29.5105 23.5162,19.648 35.3255,42.6518 35.3255,68.9858 0,17.0095 -4.99526,31.3293 -14.8321,43.3435 -9.8112,11.8349 -27.1537,22.1585 -51.8226,30.8169 -16.8302,6.01993 -55.1784,16.3435 -115.173,31.3549 -77.1576,19.315 -131.337,42.9849 -162.487,71.1633 -43.8302,39.501 -65.6813,87.6604 -65.6813,144.504 0,36.4782 10.3492,70.8302 30.8425,102.646 20.6727,31.8416 50.3369,55.9982 89.1718,72.6746 38.835,16.6765 85.483,25.0019 140.482,25.0019 89.5048,0 157.005,-19.8273 202.167,-59.6613 45.3416,-39.834 69.0115,-92.835 71.3426,-159.336l-144.991 -4.99526c-6.17363,36.9905 -19.3406,63.5039 -39.501,79.668 -20.186,16.1642 -50.5162,24.3359 -90.8369,24.3359 -41.6784,0 -74.3397,-8.68407 -97.8303,-26.001 -15.1651,-11.1689 -22.8501,-26.001 -22.8501,-44.6756 0,-17.0095 7.17268,-31.5086 21.518,-43.4972 18.1623,-15.4981 62.3255,-31.5086 132.49,-48.1594 70.1642,-16.5228 122.012,-33.8397 155.494,-51.5152 33.686,-17.8292 60.02,-41.9858 79.002,-72.8283 19.0076,-30.8425 28.5114,-68.8321 28.5114,-113.994 0,-41.0124 -11.3482,-79.5143 -34.1727,-115.352 -22.8245,-35.8122 -54.9991,-62.4792 -96.6775,-79.8217 -41.6528,-17.4962 -93.6547,-26.1547 -155.827,-26.1547 -90.5039,0 -160.002,20.8264 -208.495,62.6585 -48.4925,41.6528 -77.3369,102.493 -86.8407,182.34z"/>
|
||||
<glyph unicode="a" horiz-adv-x="556" d="M173.989 358.993l-123.985 22.0048c13.9867,50.6699 38.1689,88.1728 72.3416,112.509 34.1471,24.3359 84.9963,36.5038 152.317,36.5038 61.1727,0 106.847,-7.17268 136.845,-21.6717 29.8179,-14.4991 51.0029,-32.8406 63.1708,-55.1784 12.1679,-22.3378 18.316,-63.1708 18.316,-122.832l-1.9981 -160.002c0,-45.4953 2.17742,-79.1557 6.50665,-100.827 4.32923,-21.6717 12.501,-44.8293 24.4896,-69.4982l-135.999 0c-3.48387,8.99147 -7.99242,22.3378 -13.167,39.9877 -2.1518,8.17173 -3.81689,13.5 -4.81594,16.0105 -23.3368,-23.0038 -48.3388,-40.167 -75.0058,-51.6689 -26.667,-11.5019 -54.9991,-17.3169 -85.1756,-17.3169 -53.1547,0 -95.1661,14.4991 -125.829,43.4972 -30.6632,28.8188 -46.0076,65.502 -46.0076,109.819 0,29.1774 7.01898,55.3321 21.0057,78.3359 14.0123,22.8245 33.5067,40.5 58.8416,52.668 25.1556,12.1679 61.5058,22.8245 108.999,31.9953 63.9906,12.0142 108.487,23.3368 133.156,33.6604l0 13.833c0,26.667 -6.48103,45.6746 -19.4943,57.1765 -13.167,11.3482 -37.8359,17.0095 -74.0067,17.0095 -24.4896,0 -43.4972,-4.84156 -57.1509,-14.6784 -13.833,-9.6575 -24.8482,-26.8207 -33.353,-51.3359zm184.005 -110.997c-17.4962,-5.84061 -45.316,-12.834 -83.4849,-21.0057 -38.0152,-8.14612 -63.0171,-16.1642 -74.6727,-23.8236 -17.8292,-12.834 -26.8463,-28.8444 -26.8463,-48.3388 0,-19.315 7.17268,-35.8378 21.518,-49.8245 14.3197,-14.0123 32.482,-21.0057 54.6661,-21.0057 24.6689,0 48.3388,8.17173 70.8302,24.3359 16.4972,12.501 27.4867,27.5124 32.6613,45.4953 3.50949,11.6812 5.32828,33.9934 5.32828,66.834l0 27.333z"/>
|
||||
<glyph unicode="c" horiz-adv-x="556" d="M523.99 365.013l-135 -24.0029c-4.48293,26.8207 -14.8321,46.9811 -30.9962,60.6604 -16.1642,13.5 -36.9905,20.3397 -62.6585,20.3397 -34.1727,0 -61.5058,-11.8349 -81.8454,-35.5048 -20.3141,-23.6699 -30.4839,-63.1708 -30.4839,-118.682 0,-61.6595 10.3235,-105.157 30.9962,-130.645 20.6727,-25.5143 48.3388,-38.1689 82.9982,-38.1689 26.001,0 47.3397,7.48008 63.8369,22.3122 16.6509,14.8577 28.3321,40.3463 35.1718,76.6709l135 -23.0038c-14.0123,-61.9925 -40.8331,-108.82 -80.5134,-140.482 -39.6547,-31.6623 -92.835,-47.4934 -159.669,-47.4934 -75.6718,0 -136.153,23.9773 -181.161,71.8293 -45.1623,47.9801 -67.6538,114.327 -67.6538,199.17 0,85.816 22.6452,152.496 67.8331,200.323 45.1623,47.8264 106.309,71.6756 183.493,71.6756 62.9915,0 113.175,-13.6793 150.498,-40.8331 37.1699,-27.1793 63.8369,-68.4991 80.1547,-124.164z"/>
|
||||
<glyph unicode="d" horiz-adv-x="610" d="M547.993 0l-126.982 0 0 76.1585c-21.185,-29.6642 -46.3407,-51.8226 -75.1851,-66.834 -28.8188,-14.8321 -57.9963,-22.3122 -87.3274,-22.3122 -59.8407,0 -110.997,23.9773 -153.675,72.1623 -42.4981,48.1594 -63.8113,115.147 -63.8113,201.322 0,87.9934 20.6471,155.007 62.1462,200.835 41.4991,45.8283 93.8341,68.6784 157.184,68.6784 57.9963,0 108.333,-24.1822 150.652,-72.3416l0 258.319 136.998 0 0 -715.987zm-365.986 269.488c0,-55.4858 7.6594,-95.6528 22.8245,-120.475 22.1585,-36.0171 53.001,-54.0001 92.6813,-54.0001 31.483,0 58.3293,13.5 80.3084,40.5 22.1841,27 33.1737,67.1414 33.1737,120.808 0,59.8407 -10.6566,102.851 -32.149,129.185 -21.518,26.334 -48.8511,39.501 -82.3578,39.501 -32.482,0 -59.6613,-13.0133 -81.6661,-39.0143 -21.8254,-26.001 -32.815,-64.8359 -32.815,-116.505z"/>
|
||||
<glyph unicode="e" horiz-adv-x="556" d="M372.006 163.998l136.998 -23.0038c-17.4962,-50.1575 -45.3416,-88.3265 -83.1775,-114.66 -37.9896,-26.1547 -85.483,-39.3217 -142.327,-39.3217 -90.1709,0 -157.005,29.4848 -200.169,88.4802 -34.1727,47.3397 -51.3359,107.001 -51.3359,179.163 0,86.021 22.5171,153.521 67.3464,202.167 44.8293,48.8511 101.647,73.187 170.326,73.187 77.0039,0 137.844,-25.5143 182.494,-76.5172 44.4962,-51.0029 65.835,-129.16 63.8369,-234.495l-343.008 0c0.999052,-40.6537 12.0142,-72.3416 33.1737,-94.9868 21.0057,-22.6708 47.3397,-34.019 78.669,-34.019 21.4924,0 39.501,5.84061 54.0001,17.4962 14.6784,11.6812 25.668,30.5095 33.1737,56.5105zm7.99242 138.996c-0.999052,39.834 -11.1689,70.1642 -30.6632,90.8369 -19.4943,20.8264 -43.1642,31.1756 -71.1633,31.1756 -29.8435,0 -54.5124,-11.0152 -74.0067,-32.8406 -19.4943,-21.8254 -28.9981,-51.6689 -28.6651,-89.1718l204.498 0z"/>
|
||||
<glyph unicode="i" horiz-adv-x="277" d="M72.0086 589.005l0 126.982 136.998 0 0 -126.982 -136.998 0zm0 -589.005l0 518.995 136.998 0 0 -518.995 -136.998 0z"/>
|
||||
<glyph unicode="l" horiz-adv-x="277" d="M72.0086 0l0 715.987 136.998 0 0 -715.987 -136.998 0z"/>
|
||||
<glyph unicode="m" horiz-adv-x="889" d="M61.9925 518.995l126.009 0 0 -70.8302c45.1623,54.5124 99.0086,81.8454 161.488,81.8454 33.1737,0 62.0181,-6.83966 86.354,-20.519 24.4896,-13.6537 44.4962,-34.3264 59.9944,-61.9925 22.8245,27.6661 47.4934,48.3388 73.8274,61.9925 26.334,13.6793 54.5124,20.519 84.5096,20.519 37.9896,0 70.1642,-7.68502 96.6519,-23.1831 26.334,-15.4981 46.0076,-38.1689 58.9953,-68.1661 9.5038,-22.0048 14.166,-57.8169 14.166,-107.334l0 -331.327 -136.998 0 0 296.155c0,51.5152 -4.66224,84.6889 -14.166,99.521 -12.6547,19.4943 -32.3283,29.3311 -58.6623,29.3311 -19.1613,0 -37.3236,-5.84061 -54.3331,-17.4962 -16.8302,-11.8349 -29.1518,-28.9981 -36.6575,-51.5152 -7.5057,-22.6708 -11.1689,-58.3293 -11.1689,-107.155l0 -248.841 -136.998 0 0 284.013c0,50.3112 -2.51044,82.9982 -7.32638,97.4972 -4.84156,14.6528 -12.3473,25.668 -22.6708,32.815 -10.1698,7.17268 -24.1822,10.6822 -41.6784,10.6822 -21.1594,0 -40.167,-5.6613 -56.9972,-17.0095 -17.0095,-11.5019 -28.9981,-27.8198 -36.3245,-49.3378 -7.352,-21.4924 -11.0152,-57.1509 -11.0152,-106.822l0 -251.838 -136.998 0 0 518.995z"/>
|
||||
<glyph unicode="n" horiz-adv-x="610" d="M543.997 0l-136.998 0 0 264.493c0,55.9982 -2.99716,92.169 -8.83777,108.512 -5.99431,16.4972 -15.4981,29.1518 -28.8188,38.3226 -13.3463,9.17079 -29.3311,13.6793 -48.0057,13.6793 -24.0029,0 -45.4953,-6.50665 -64.5029,-19.4943 -19.1613,-13.0133 -32.1746,-30.3558 -39.168,-51.6689 -7.17268,-21.518 -10.6566,-61.1727 -10.6566,-119.169l0 -234.675 -136.998 0 0 518.995 126.982 0 0 -76.1585c45.4953,58.1756 102.672,87.1737 171.837,87.1737 30.3302,0 58.1756,-5.5076 83.3312,-16.3435 25.3349,-10.9896 44.3425,-24.8226 57.1765,-41.6784 12.9877,-16.9839 22.0048,-36.1452 27,-57.6632 5.17458,-21.4924 7.6594,-52.1556 7.6594,-92.169l0 -322.156z"/>
|
||||
<glyph unicode="o" horiz-adv-x="610" d="M39.9877 265.825c0,45.6746 11.1689,89.8378 33.686,132.515 22.4915,42.8312 54.3331,75.3388 95.4991,97.8303 41.1661,22.4915 86.9944,33.8397 137.818,33.8397 78.5153,0 142.685,-25.5143 192.843,-76.5172 50.1575,-51.1566 75.1595,-115.48 75.1595,-193.483 0,-78.669 -25.3349,-143.838 -75.8255,-195.507 -50.6699,-51.6689 -114.327,-77.4906 -191.178,-77.4906 -47.4934,0 -92.835,10.8103 -135.999,32.3283 -42.9849,21.4924 -75.8255,53.001 -98.317,94.6538 -22.5171,41.4991 -33.686,92.169 -33.686,151.83zm141.02 -7.32638c0,-51.4896 12.1679,-90.9906 36.5038,-118.324 24.4896,-27.5124 54.4868,-41.1661 90.3246,-41.1661 35.6585,0 65.6557,13.6537 89.8378,41.1661 24.1566,27.333 36.3245,67.167 36.3245,119.323 0,50.8236 -12.1679,89.9915 -36.3245,117.325 -24.1822,27.5124 -54.1794,41.1661 -89.8378,41.1661 -35.8378,0 -65.835,-13.6537 -90.3246,-41.1661 -24.3359,-27.333 -36.5038,-66.834 -36.5038,-118.324z"/>
|
||||
<glyph unicode="r" horiz-adv-x="389" d="M203.013 0l-137.024 0 0 518.995 127.008 0 0 -73.6737c21.8254,34.8387 41.4991,57.6889 58.9953,68.5247 17.4962,10.8103 37.3492,16.1642 59.5076,16.1642 31.3293,0 61.5058,-8.68407 90.5039,-25.8473l-42.4981 -119.656c-23.1831,14.9858 -44.6756,22.4915 -64.5029,22.4915 -19.3406,0 -35.6585,-5.32828 -49.0048,-15.8311 -13.3207,-10.6566 -23.8236,-29.6642 -31.5086,-57.3302 -7.6594,-27.6661 -11.4763,-85.6623 -11.4763,-173.835l0 -160.002z"/>
|
||||
<glyph unicode="t" horiz-adv-x="332" d="M308.989 518.995l0 -108.999 -93.9878 0 0 -210.16c0,-42.6775 0.819735,-67.5001 2.66414,-74.4934 1.8444,-7.01898 5.84061,-12.834 12.3473,-17.5218 6.32733,-4.48293 13.9867,-6.81405 23.1575,-6.81405 12.834,0 31.1756,4.32923 55.3321,13.167l11.5019 -106.668c-31.8416,-13.6793 -67.8331,-20.4934 -108.179,-20.4934 -24.6689,0 -46.8274,4.14991 -66.6547,12.4753 -19.8273,8.35105 -34.3264,19.1869 -43.4972,32.3539 -9.3501,13.3207 -15.6774,31.1499 -19.3406,53.8207 -2.84346,16.0105 -4.32923,48.3388 -4.32923,97.1642l0 227.169 -62.9915 0 0 108.999 62.9915 0 0 103.005 136.998 81.0001 0 -184.005 93.9878 0z"/>
|
||||
<glyph unicode="{" horiz-adv-x="389" d="M28.9981 200.989l0 117.017c23.8236,1.33207 41.6784,4.81594 53.8464,10.8359 11.9886,5.815 22.3122,15.6518 31.1499,29.4848 8.83777,13.833 14.8321,31.1756 18.1623,52.0019 2.51044,15.6774 3.84251,42.8312 3.84251,81.6661 0,63.1708 2.99716,107.18 8.83777,132.182 5.84061,25.0019 16.3179,44.983 31.6623,60.1481 15.3444,15.1651 37.6566,27 66.834,35.8378 19.8273,5.84061 51.1566,8.83777 93.8341,8.83777l25.8217 0 0 -116.992c-36.3245,0 -59.482,-1.9981 -69.8312,-6.17363 -10.3235,-3.99621 -17.8292,-10.1698 -22.8245,-18.4953 -4.84156,-8.35105 -7.32638,-22.5171 -7.32638,-42.6775 0,-20.4934 -1.33207,-59.5076 -3.99621,-116.659 -1.66509,-32.3283 -5.84061,-58.3293 -12.6803,-78.5153 -6.83966,-19.981 -15.4981,-36.4782 -26.1547,-49.4915 -10.5029,-12.9877 -26.667,-26.4877 -48.5181,-40.5 19.3406,-10.9896 35.0181,-24.0029 47.3397,-38.835 12.3473,-14.8321 21.6717,-32.8406 28.1784,-54.0001 6.66035,-21.1594 10.8359,-49.6708 12.834,-85.15 1.9981,-54.0001 2.99716,-88.6851 2.99716,-103.671 0,-21.518 2.66414,-36.5038 7.83872,-45.0086 5.14896,-8.32543 12.9877,-14.8321 23.6442,-19.1613 10.5029,-4.50854 33.353,-6.66035 68.4991,-6.66035l0 -117.017 -25.8217 0c-44.0095,0 -77.6699,3.50949 -101.16,10.5029 -23.3368,6.99337 -43.1642,18.6746 -59.1746,34.9924 -16.1642,16.1898 -27,36.3501 -32.5076,60.353 -5.48198,23.8236 -8.32543,61.6595 -8.32543,113.149 0,59.8407 -2.66414,98.8293 -7.83872,116.684 -7.17268,26.1547 -17.9829,44.8293 -32.482,55.9982 -14.4991,11.3226 -36.6831,17.6499 -66.6803,19.315z"/>
|
||||
<glyph unicode="}" horiz-adv-x="389" d="M355.996 200.989c-23.8236,-1.33207 -41.6528,-4.81594 -53.667,-10.6566 -12.1679,-5.99431 -22.4915,-15.8311 -31.1499,-29.6642 -8.50475,-13.833 -14.6784,-31.1756 -18.3416,-52.0019 -2.51044,-15.6774 -3.84251,-42.6775 -3.84251,-81.1538 0,-63.1708 -2.81784,-107.334 -8.50475,-132.515 -5.6613,-25.0019 -16.1642,-45.1623 -31.483,-60.3274 -15.3444,-15.1651 -37.8359,-27 -67.3464,-35.8378 -19.8273,-5.84061 -51.1566,-8.83777 -93.8341,-8.83777l-25.8217 0 0 117.017c34.9924,0 57.8169,2.1518 68.6528,6.66035 10.6822,4.32923 18.6746,10.6566 23.6699,19.0076 5.17458,8.32543 7.68502,22.3122 7.83872,42.3188 0.179317,19.8273 1.51139,57.8426 3.84251,113.841 1.66509,33.9934 5.99431,60.9934 13.167,81.4868 7.14707,20.3397 16.6509,37.6822 28.4858,51.8482 12.0142,14.166 27.1793,26.4877 45.6746,37.3236 -24.0029,15.6774 -41.6784,30.9962 -52.668,45.8283 -15.3444,21.518 -25.8473,48.8511 -31.3293,82.1784 -3.50949,22.6708 -5.99431,72.8283 -7.32638,150.319 -0.333017,24.3359 -2.51044,40.6794 -6.68596,48.8511 -3.99621,7.99242 -11.3226,14.3197 -22.0048,18.649 -10.6566,4.50854 -34.3264,6.68596 -71.317,6.68596l0 116.992 25.8217 0c44.0095,0 77.6699,-3.50949 101.186,-10.3235 23.3112,-6.83966 42.9849,-18.5209 58.9953,-34.8387 15.9848,-16.4972 26.8207,-36.6831 32.482,-60.6604 5.68691,-23.8492 8.50475,-61.6851 8.50475,-113.175 0,-59.5076 2.51044,-98.4963 7.32638,-116.659 7.17268,-26.1803 18.0086,-44.8549 32.6869,-56.0238 14.6528,-11.3226 36.9905,-17.6499 66.9877,-19.315l0 -117.017z"/>
|
||||
</font>
|
||||
<style type="text/css">
|
||||
<![CDATA[
|
||||
@font-face { font-family:"Arial";font-variant:normal;font-style:normal;font-weight:bold;src:url("#FontID0") format(svg)}
|
||||
.fil0 {fill:#373435}
|
||||
.fil1 {fill:black}
|
||||
.fnt0 {font-weight:bold;font-size:3.9037px;font-family:'Arial'}
|
||||
]]>
|
||||
</style>
|
||||
</defs>
|
||||
<g id="Layer_x0020_1">
|
||||
<metadata id="CorelCorpID_0Corel-Layer"/>
|
||||
<g transform="matrix(0.576293 0 0 1 -8.27317 4.15816)">
|
||||
<text x="17.5" y="12.5" class="fil0 fnt0">Nr. Comanda:{Article}</text>
|
||||
</g>
|
||||
<g transform="matrix(0.576293 0 0 1 -8.27317 7.72657)">
|
||||
<text x="17.5" y="12.5" class="fil0 fnt0">Nr. Art.:{NrArt}</text>
|
||||
</g>
|
||||
<g transform="matrix(0.576293 0 0 1 -8.33607 11.0472)">
|
||||
<text x="17.5" y="12.5" class="fil0 fnt0">Serial No.:{Serial}</text>
|
||||
</g>
|
||||
<g id="_1503865902032">
|
||||
<path class="fil1" d="M12.82 7.2323c-0.1161,0.0271 -0.6403,0.41 -0.7023,0.417 -0.0438,0.005 -0.4125,-0.272 -0.4735,-0.3166 -0.0598,-0.0436 -0.0888,-0.0806 -0.163,-0.1004 0,0.0747 0.0169,0.2103 0.0281,0.3011 0.0331,0.269 0.0855,0.5861 0.1616,0.848 0.103,0.3544 0.2131,0.6687 0.3663,0.9726 0.2431,0.4823 0.4418,0.7936 0.7893,1.208 0.9583,1.1426 2.579,1.9598 4.0759,1.9598 1.0308,0 1.7035,-0.1145 2.5607,-0.512 0.3018,-0.1399 0.5873,-0.307 0.8502,-0.4886 0.4492,-0.3106 0.7746,-0.6264 1.1172,-1.0338 0.0352,-0.0419 0.0492,-0.052 0.0813,-0.0942 0.6831,-0.895 1.0205,-1.7074 1.1757,-2.8408 0.0122,-0.0889 0.0311,-0.2456 0.0311,-0.3201 -0.1148,-0.0768 -0.2364,-0.1435 -0.3512,-0.2195 -0.4402,-0.2912 -0.3377,-0.2606 -0.7083,0.016 -0.4465,0.3331 -0.1917,0.0604 -0.3623,0.801 -0.0383,0.1665 -0.0787,0.3029 -0.1284,0.4642 -0.2415,0.783 -0.8476,1.5453 -1.4754,2.0363 -0.1897,0.1484 -0.5097,0.3427 -0.7199,0.4433 -1.4392,0.6888 -3.2727,0.5256 -4.5139,-0.4835 -0.1901,-0.1546 -0.4507,-0.3749 -0.5984,-0.5649 -0.2922,-0.3762 -0.4778,-0.591 -0.6835,-1.0723 -0.1761,-0.412 -0.3573,-0.9691 -0.3573,-1.4206z"/>
|
||||
<path class="fil1" d="M11.4812 6.5739c0.1103,0.0738 0.2091,0.1467 0.3248,0.2238 0.4133,0.2755 0.2641,0.2761 0.6717,0.0045 0.1215,-0.0811 0.227,-0.1511 0.3423,-0.2283 0,-0.7199 0.395,-1.6532 0.8432,-2.2515 0.2017,-0.2693 0.6154,-0.6932 0.9082,-0.8915 0.7337,-0.4969 1.3743,-0.7636 2.287,-0.8077 0.3218,-0.0155 0.0567,-0.0336 0.4622,-0.0011 0.2873,0.023 0.3574,0.0038 0.706,0.0841 0.5154,0.1187 1.0246,0.3291 1.4484,0.6147 0.8452,0.5696 1.4617,1.4005 1.7486,2.3776 0.063,0.2147 0.1562,0.6133 0.1562,0.8754 0.1055,-0.0282 0.5565,-0.4104 0.6145,-0.417 0.0786,0.021 0.2734,0.1575 0.3607,0.2099 0.0787,0.0473 0.2939,0.1908 0.3636,0.2071l-0.0687 -0.5898c-0.1423,-0.8307 -0.4834,-1.7021 -0.9879,-2.3701 -0.2122,-0.2809 -0.5138,-0.6564 -0.7903,-0.8778 -0.2016,-0.1613 -0.3013,-0.2735 -0.5584,-0.4512 -0.8199,-0.5666 -1.9324,-1.0006 -3.0378,-1.0006 -1.0533,0 -1.6632,0.1218 -2.5238,0.5051 -1.6549,0.7371 -2.8948,2.3661 -3.1985,4.176 -0.0172,0.1027 -0.0262,0.1807 -0.0409,0.2883 -0.0122,0.0889 -0.0311,0.2456 -0.0311,0.3201z"/>
|
||||
<path class="fil1" d="M16.4195 7.4518l-1.4213 -1.41 -1.0534 1.0643 2.4473 2.4582 3.8738 -3.8629 -1.0537 -1.0423 -0.1758 0.164c-0.0315,0.0363 -0.0538,0.0557 -0.0893,0.0863l-0.6063 0.6008c-0.003,0.0034 -0.0071,0.0084 -0.0101,0.0119l-0.1755 0.1757c-0.0032,0.0032 -0.0077,0.0078 -0.0109,0.011l-0.2499 0.2549c-0.0507,0.0484 -0.0461,0.0309 -0.092,0.0836 -0.1863,0.2139 -1.3182,1.3079 -1.3829,1.4045z"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 18 KiB |
BIN
dist/conf/refused.png
vendored
BIN
dist/conf/refused.png
vendored
Binary file not shown.
|
Before Width: | Height: | Size: 104 KiB |
191
print_label.py
191
print_label.py
@@ -143,96 +143,6 @@ def create_label_pdf(text, svg_template=None):
|
||||
return generator.create_label_pdf(article, nr_art, serial, pdf_filename, image_path, selected_template)
|
||||
|
||||
|
||||
def find_ghostscript():
|
||||
"""
|
||||
Find GhostScript executable. Search order:
|
||||
1. Bundled inside the PyInstaller .exe (ghostscript/bin/ in _MEIPASS)
|
||||
2. System-level installation (C:\\Program Files\\gs\\...)
|
||||
Returns the full path to gswin64c.exe / gswin32c.exe, or None.
|
||||
"""
|
||||
# 1 ── Bundled location (PyInstaller one-file build)
|
||||
if getattr(sys, 'frozen', False) and hasattr(sys, '_MEIPASS'):
|
||||
for exe_name in ['gswin64c.exe', 'gswin32c.exe']:
|
||||
bundled = os.path.join(sys._MEIPASS, 'ghostscript', 'bin', exe_name)
|
||||
if os.path.exists(bundled):
|
||||
print(f"Using bundled GhostScript: {bundled}")
|
||||
return bundled
|
||||
|
||||
# 2 ── System installation (newest version first)
|
||||
for program_files in [r"C:\Program Files", r"C:\Program Files (x86)"]:
|
||||
gs_base = os.path.join(program_files, "gs")
|
||||
if os.path.exists(gs_base):
|
||||
for version_dir in sorted(os.listdir(gs_base), reverse=True):
|
||||
for exe_name in ["gswin64c.exe", "gswin32c.exe"]:
|
||||
gs_path = os.path.join(gs_base, version_dir, "bin", exe_name)
|
||||
if os.path.exists(gs_path):
|
||||
return gs_path
|
||||
return None
|
||||
|
||||
|
||||
def print_pdf_with_ghostscript(pdf_path, printer_name):
|
||||
"""
|
||||
Print PDF via GhostScript mswinpr2 device for true vector quality.
|
||||
GhostScript sends native vector data to the printer driver, avoiding
|
||||
the low-DPI rasterisation that causes dotted/pixelated output.
|
||||
|
||||
Returns True on success, False if GhostScript is unavailable or fails.
|
||||
"""
|
||||
gs_path = find_ghostscript()
|
||||
if not gs_path:
|
||||
print("GhostScript not found – skipping to SumatraPDF fallback.")
|
||||
return False
|
||||
|
||||
# Build environment: if running as a bundled exe, point GS_LIB at the
|
||||
# extracted lib/ folder so GhostScript can find its .ps init files.
|
||||
env = os.environ.copy()
|
||||
if getattr(sys, 'frozen', False) and hasattr(sys, '_MEIPASS'):
|
||||
bundled_lib = os.path.join(sys._MEIPASS, 'ghostscript', 'lib')
|
||||
if os.path.isdir(bundled_lib):
|
||||
env['GS_LIB'] = bundled_lib
|
||||
print(f"GS_LIB → {bundled_lib}")
|
||||
|
||||
try:
|
||||
# -sDEVICE=mswinpr2 : native Windows printer device (vector path)
|
||||
# -dNOPAUSE / -dBATCH : batch mode, no user prompts
|
||||
# -r600 : 600 DPI matches typical thermal-printer head
|
||||
# -dTextAlphaBits=4 : anti-aliasing for text
|
||||
# -dGraphicsAlphaBits=4
|
||||
# -dNOSAFER : allow file access needed for fonts
|
||||
# The printer paper size and orientation are already configured
|
||||
# in the driver – do not override them here.
|
||||
cmd = [
|
||||
gs_path,
|
||||
"-dNOPAUSE",
|
||||
"-dBATCH",
|
||||
"-sDEVICE=mswinpr2",
|
||||
"-dNOSAFER",
|
||||
"-r600",
|
||||
"-dTextAlphaBits=4",
|
||||
"-dGraphicsAlphaBits=4",
|
||||
f"-sOutputFile=%printer%{printer_name}",
|
||||
pdf_path,
|
||||
]
|
||||
print(f"Printing with GhostScript (vector quality) to: {printer_name}")
|
||||
result = subprocess.run(
|
||||
cmd,
|
||||
check=True,
|
||||
capture_output=True,
|
||||
text=True,
|
||||
timeout=60,
|
||||
env=env,
|
||||
creationflags=subprocess.CREATE_NO_WINDOW if os.name == "nt" else 0,
|
||||
)
|
||||
print(f"✅ Label sent via GhostScript: {printer_name}")
|
||||
return True
|
||||
except subprocess.CalledProcessError as e:
|
||||
print(f"GhostScript print failed (exit {e.returncode}): {e.stderr.strip() if e.stderr else ''}")
|
||||
return False
|
||||
except Exception as e:
|
||||
print(f"GhostScript error: {e}")
|
||||
return False
|
||||
|
||||
|
||||
def print_to_printer(printer_name, file_path):
|
||||
"""
|
||||
Print file to printer (cross-platform).
|
||||
@@ -261,28 +171,13 @@ def print_to_printer(printer_name, file_path):
|
||||
elif SYSTEM == "Windows":
|
||||
# Windows: Print PDF silently without any viewer opening
|
||||
try:
|
||||
if WIN32_AVAILABLE:
|
||||
import win32print
|
||||
|
||||
if file_path.endswith('.pdf'):
|
||||
# Try silent printing methods (no viewer opens)
|
||||
import os
|
||||
|
||||
printed = False
|
||||
|
||||
# Method 1: GhostScript (best quality – true vector path).
|
||||
# Tried first regardless of whether we are running as a
|
||||
# script or as the packaged .exe, because GhostScript is
|
||||
# a system-level installation and will be present on the
|
||||
# machine independently of how this app is launched.
|
||||
# If GhostScript is not installed it returns False
|
||||
# immediately and we fall through to SumatraPDF.
|
||||
printed = print_pdf_with_ghostscript(file_path, printer_name)
|
||||
|
||||
if printed:
|
||||
return True
|
||||
|
||||
# Method 2: SumatraPDF (bundled inside exe or external)
|
||||
# Method 1: SumatraPDF – sends the PDF at its exact page size
|
||||
# (35 mm × 25 mm) directly to the printer driver with no scaling.
|
||||
# The printer must already have a 35 mm × 25 mm label stock
|
||||
# configured in its driver settings.
|
||||
sumatra_paths = []
|
||||
|
||||
# Get the directory where this script/exe is running
|
||||
@@ -318,20 +213,47 @@ def print_to_printer(printer_name, file_path):
|
||||
try:
|
||||
print(f"Using SumatraPDF: {sumatra_path}")
|
||||
print(f"Sending to printer: {printer_name}")
|
||||
# "noscale" = print the PDF at its exact page size.
|
||||
# Do NOT add "landscape" – the printer driver
|
||||
# already knows the orientation from its own settings.
|
||||
result = subprocess.run([
|
||||
|
||||
# Locate the conf folder that contains
|
||||
# SumatraPDF-settings.txt so SumatraPDF reads
|
||||
# our pre-configured PrintScale = noscale.
|
||||
sumatra_dir = os.path.dirname(sumatra_path)
|
||||
settings_candidates = [
|
||||
# conf\ next to the exe (script mode)
|
||||
os.path.join(os.path.dirname(os.path.abspath(__file__)), 'conf'),
|
||||
# same folder as SumatraPDF.exe
|
||||
sumatra_dir,
|
||||
]
|
||||
if getattr(sys, 'frozen', False):
|
||||
settings_candidates.insert(0, os.path.join(os.path.dirname(sys.executable), 'conf'))
|
||||
appdata_dir = next(
|
||||
(d for d in settings_candidates
|
||||
if os.path.exists(os.path.join(d, 'SumatraPDF-settings.txt'))),
|
||||
None
|
||||
)
|
||||
|
||||
# Build command:
|
||||
# -print-settings noscale : send PDF at exact page size (35x25 mm)
|
||||
# -appdata-dir : use our settings file (PrintScale=noscale)
|
||||
# -silent / -exit-when-done : no UI, exit after spooling
|
||||
# IMPORTANT: file_path must come LAST
|
||||
cmd = [
|
||||
sumatra_path,
|
||||
"-print-to",
|
||||
printer_name,
|
||||
file_path,
|
||||
"-print-settings",
|
||||
"noscale",
|
||||
"-print-to", printer_name,
|
||||
"-print-settings", "noscale",
|
||||
"-silent",
|
||||
"-exit-when-done"
|
||||
], check=False, creationflags=subprocess.CREATE_NO_WINDOW,
|
||||
capture_output=True, text=True, timeout=30)
|
||||
"-exit-when-done",
|
||||
]
|
||||
if appdata_dir:
|
||||
cmd += ["-appdata-dir", appdata_dir]
|
||||
print(f"SumatraPDF appdata-dir: {appdata_dir}")
|
||||
cmd.append(file_path)
|
||||
|
||||
result = subprocess.run(
|
||||
cmd,
|
||||
check=False,
|
||||
creationflags=subprocess.CREATE_NO_WINDOW,
|
||||
capture_output=True, text=True, timeout=30)
|
||||
if result.returncode != 0:
|
||||
print(f"SumatraPDF returned code {result.returncode}")
|
||||
if result.stderr:
|
||||
@@ -343,9 +265,32 @@ def print_to_printer(printer_name, file_path):
|
||||
except Exception as e:
|
||||
print(f"SumatraPDF error: {e}")
|
||||
|
||||
# Do not launch default PDF viewers (Adobe/Edge/etc.) as fallback.
|
||||
# Method 2: win32api ShellExecute "print" verb – last resort,
|
||||
# uses whatever PDF application is registered as the default
|
||||
# handler. This may briefly open the viewer, but it will
|
||||
# send the job to the correct physical printer.
|
||||
if not printed and WIN32_AVAILABLE:
|
||||
try:
|
||||
import win32api
|
||||
print(f"Trying win32api ShellExecute print fallback → {printer_name}")
|
||||
# Set the target printer as default temporarily is
|
||||
# unreliable; instead, rely on the user having already
|
||||
# selected the right default printer in Windows.
|
||||
win32api.ShellExecute(
|
||||
0, # hwnd
|
||||
"print", # operation
|
||||
file_path, # file
|
||||
None, # parameters
|
||||
".", # working dir
|
||||
0 # show-command (SW_HIDE)
|
||||
)
|
||||
print("Label sent via ShellExecute print fallback.")
|
||||
printed = True
|
||||
except Exception as se_err:
|
||||
print(f"win32api ShellExecute fallback failed: {se_err}")
|
||||
|
||||
if not printed:
|
||||
print("SumatraPDF not found or failed. PDF saved as backup only (no viewer launched).")
|
||||
print("All print methods failed. PDF saved as backup only.")
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user