summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlgs/lib/font2c.ps
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/tlgs/lib/font2c.ps')
-rw-r--r--Master/tlpkg/tlgs/lib/font2c.ps180
1 files changed, 90 insertions, 90 deletions
diff --git a/Master/tlpkg/tlgs/lib/font2c.ps b/Master/tlpkg/tlgs/lib/font2c.ps
index 0dcdaab3a9f..9624f414780 100644
--- a/Master/tlpkg/tlgs/lib/font2c.ps
+++ b/Master/tlpkg/tlgs/lib/font2c.ps
@@ -1,19 +1,19 @@
% Copyright (C) 1992, 1993, 1994, 1995, 1999 Aladdin Enterprises. All rights reserved.
-%
+%
% This software is provided AS-IS with no warranty, either express or
% implied.
-%
+%
% This software is distributed under license and may not be copied,
% modified or distributed except as expressly authorized under the terms
% of the license contained in the file LICENSE in this distribution.
-%
+%
% For more information about licensing, please refer to
% http://www.ghostscript.com/licensing/. For information on
% commercial licensing, go to http://www.artifex.com/licensing/ or
% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
% San Rafael, CA 94903, U.S.A., +1(415)492-9861.
-% $Id: font2c.ps 6300 2005-12-28 19:56:24Z giles $
+% $Id$
% font2c.ps
% Write out a PostScript Type 0 or Type 1 font as C code
% that can be linked with the interpreter.
@@ -53,9 +53,9 @@
{ pop a_all }
{ % Check for executeonly or noaccess objects in protected.
dup protected exch known
- { protected exch get }
- { pop a_readonly }
- ifelse
+ { protected exch get }
+ { pop a_readonly }
+ ifelse
}
ifelse
} bind def
@@ -65,10 +65,10 @@
{ a_noaccess exch
{ exch pop
dup type dup /stringtype eq 1 index /arraytype eq or
- exch /packedarraytype eq or
- { getpa a_readonly and or }
- { pop pop a_all exit }
- ifelse
+ exch /packedarraytype eq or
+ { getpa a_readonly and or }
+ { pop pop a_all exit }
+ ifelse
}
forall
} bind def
@@ -147,12 +147,12 @@ end
/wca % <string> <prefix> <suffix> wca -
{ 0 4 -2 roll exch
{ % Stack: suffix n prefix char
- exch ws
- exch dup 19 ge { () wl pop 0 } if 1 add
- exch dup 32 ge 1 index 126 le and
- { 39 wb dup 39 eq 1 index 92 eq or { 92 wb } if wb 39 wb }
- { wt }
- ifelse (,)
+ exch ws
+ exch dup 19 ge { () wl pop 0 } if 1 add
+ exch dup 32 ge 1 index 126 le and
+ { 39 wb dup 39 eq 1 index 92 eq or { 92 wb } if wb 39 wb }
+ { wt }
+ ifelse (,)
} forall
pop pop ws
} bind def
@@ -180,12 +180,12 @@ end
% Convert an object to a string to be scanned at a later time.
/cvos % <obj> cvos <string>
{ % We'd like to use == and write directly to a string,
- % but we can't do the former because of operators,
- % and we can't do the latter because we can't predict
- % how long the string would have to be....
- wtempname (w) file dup 3 -1 roll wproc closefile
- wtempname status pop pop pop exch pop string
- wtempname (r) file dup 3 -1 roll readstring pop exch closefile
+ % but we can't do the former because of operators,
+ % and we can't do the latter because we can't predict
+ % how long the string would have to be....
+ wtempname (w) file dup 3 -1 roll wproc closefile
+ wtempname status pop pop pop exch pop string
+ wtempname (r) file dup 3 -1 roll readstring pop exch closefile
} bind def
% Write a string/name or null as an element of a string/name/null array.
@@ -195,10 +195,10 @@ end
{ pop (\t255,255,) wl
}
{ dup type /nametype eq { wnstring cvs } if
- dup type /stringtype ne { cvos (255,) ws } if
- dup length 256 idiv wt (,) ws
- dup length 256 mod wt
- (,) (,\n) wca
+ dup type /stringtype ne { cvos (255,) ws } if
+ dup length 256 idiv wt (,) ws
+ dup length 256 mod wt
+ (,) (,\n) wca
}
ifelse
} bind def
@@ -268,11 +268,11 @@ end def
/arraytype
{ woatt
{ aload pop 2 index 2 index exec
- { exch pop exec exit }
- { pop pop }
- ifelse
- }
- forall
+ { exch pop exec exit }
+ { pop pop }
+ ifelse
+ }
+ forall
} bind def
/booleantype
{ { (\tmake_true\(&) } { (\tmake_false\(&) } ifelse ws
@@ -285,12 +285,12 @@ end def
/nametype
{ (\tcode = (*pprocs->name_create)\(i_ctx_p, &) ws exch wt
(, ) ws wnstring cvs wcs % OK, names are short
- (\);) wl
- (\tif ( code < 0 ) return code;) wl
- true
+ (\);) wl
+ (\tif ( code < 0 ) return code;) wl
+ true
} bind def
/packedarraytype
- /arraytype load def
+ /arraytype load def
/realtype
{ (\tmake_real\(&) ws exch wt (, (float)) ws
wt (\);) wl true
@@ -298,10 +298,10 @@ end def
/stringtype
{ ({\tstatic const unsigned char s_[] = ) ws
dup dup can_wcs { wcs } { wcca } ifelse
- (;) wl
- (\tmake_const_string\(&) ws exch wt
- (, a_readonly, ) ws length wt (, (const byte *)s_\);) wl
- (}) wl true
+ (;) wl
+ (\tmake_const_string\(&) ws exch wt
+ (, a_readonly, ) ws length wt (, (const byte *)s_\);) wl
+ (}) wl true
} bind def
end def
% Write some other kind of object, if known.
@@ -325,70 +325,70 @@ end def
} bind def
/wnuma { % <name> <array> <element_C_type> <<type>_v> wnuma -
({\tstatic const ref_\() ws exch ws (\) a_[] = {) wl exch
- % Stack: name type_v array
+ % Stack: name type_v array
dup length 0 eq {
- (\t) ws 1 index ws (\(0\)) wl
+ (\t) ws 1 index ws (\(0\)) wl
} {
- dup {
- (\t) ws 2 index ws (\() ws wt (\),) wl
- } forall
+ dup {
+ (\t) ws 2 index ws (\() ws wt (\),) wl
+ } forall
} ifelse exch pop
- % Stack: name array
+ % Stack: name array
(\t};) wl
dup wcheck {
- (\tcode = (*pprocs->scalar_array_create)\(i_ctx_p, &) ws exch wt
- (, (const ref *)a_, ) ws dup length wt
- (, ) ws wpa (\);) wl
- (\tif ( code < 0 ) return code;) wl
+ (\tcode = (*pprocs->scalar_array_create)\(i_ctx_p, &) ws exch wt
+ (, (const ref *)a_, ) ws dup length wt
+ (, ) ws wpa (\);) wl
+ (\tif ( code < 0 ) return code;) wl
} {
- (\tmake_const_array\(&) ws exch wt
- (, avm_foreign|) ws dup wpa (, ) ws length wt
- (, (const ref *)a_\);) wl
+ (\tmake_const_array\(&) ws exch wt
+ (, avm_foreign|) ws dup wpa (, ) ws length wt
+ (, (const ref *)a_\);) wl
} ifelse
(}) wl
} bind def
/woatt [
- % Integers
+ % Integers
{ { { type /integertype eq } isall }
{ (long) (integer_v) wnuma true }
}
- % Integers + reals
+ % Integers + reals
{ { { type dup /integertype eq exch /realtype eq or } isall }
{ (float) (real_v) wnuma true }
}
- % Strings + nulls
+ % Strings + nulls
{ { { type dup /nulltype eq exch /stringtype eq or } isall }
{ ({) ws dup (sa_) exch wsna
- (\tcode = (*pprocs->string_array_create)\(i_ctx_p, &) ws exch wt
- (, \(const char *\)sa_, ) ws dup length wt (, ) ws wpa (\);) wl
- (\tif ( code < 0 ) return code;) wl
- (}) wl true
+ (\tcode = (*pprocs->string_array_create)\(i_ctx_p, &) ws exch wt
+ (, \(const char *\)sa_, ) ws dup length wt (, ) ws wpa (\);) wl
+ (\tif ( code < 0 ) return code;) wl
+ (}) wl true
}
}
- % Names
+ % Names
{ { { type /nametype eq } isall }
{ ({) ws dup (na_) exch wsna
- (\tcode = (*pprocs->name_array_create)\(i_ctx_p, &) ws 1 index wt
- (, \(const char *\)na_, ) ws dup length wt (\);) wl
- (\tif ( code < 0 ) return code;) wl
- wap (}) wl true
+ (\tcode = (*pprocs->name_array_create)\(i_ctx_p, &) ws 1 index wt
+ (, \(const char *\)na_, ) ws dup length wt (\);) wl
+ (\tif ( code < 0 ) return code;) wl
+ wap (}) wl true
}
}
- % Procedure
+ % Procedure
{ { iswproc }
{ dup cvos
- % Stack: name proc string
- ({\tstatic const unsigned char s_[] = ) ws
+ % Stack: name proc string
+ ({\tstatic const unsigned char s_[] = ) ws
dup dup can_wcs { wcs } { wcca } ifelse
- (;) wl
- (\tcode = (*pprocs->ref_from_string)\(i_ctx_p, &) ws 2 index wt
- (, \(const char *\)s_, ) ws length wt (\);) wl
- (\tif ( code < 0 ) return code;) wl
- wap (}) wl true
- wtempname deletefile
+ (;) wl
+ (\tcode = (*pprocs->ref_from_string)\(i_ctx_p, &) ws 2 index wt
+ (, \(const char *\)s_, ) ws length wt (\);) wl
+ (\tif ( code < 0 ) return code;) wl
+ wap (}) wl true
+ wtempname deletefile
}
}
- % Default
+ % Default
{ { pop true }
{ wother }
}
@@ -403,10 +403,10 @@ end def
{ counttomark 2 sub wtstring cvs
(v_[) exch concatstrings (]) concatstrings exch wo not
{ (Skipping ) print ==only (....\n) print }
- if
+ if
} forall
]
- % Stack: array of keys (names)
+ % Stack: array of keys (names)
({) ws dup (str_keys_) exch wsna
(\tstatic const cfont_dict_keys keys_ =) wl
(\t { 0, 0, ) ws length wt (, ) ws 3 -1 roll wt (, ) ws
@@ -424,13 +424,13 @@ end def
% Writes code to declare and initialize enc_keys_, str_keys, and keys_.
/wcdkeys % <dict> wcdkeys -
{ % Write keys present in StandardEncoding or ISOLatin1Encoding,
- % pushing other keys on the o-stack.
+ % pushing other keys on the o-stack.
(static const charindex enc_keys_[] = {) wl
dup [ exch 0 exch
{ pop decoding 1 index known
{ decoding exch get ({) ws dup -8 bitshift wt
- (,) ws 255 and wt (}, ) ws
- 1 add dup 5 mod 0 eq { (\n) ws } if
+ (,) ws 255 and wt (}, ) ws
+ 1 add dup 5 mod 0 eq { (\n) ws } if
}
{ exch }
ifelse
@@ -438,9 +438,9 @@ end def
forall pop
]
({0,0}\n};) wl
- % Write other keys.
+ % Write other keys.
(str_keys_) exch wsna
- % Write the declaration for keys_.
+ % Write the declaration for keys_.
(static const cfont_dict_keys keys_ = {) wl
(\tenc_keys_, countof\(enc_keys_\) - 1,) wl
(\t) ws dup length wt ( - \(countof\(enc_keys_\) - 1\), 0, ) ws
@@ -499,9 +499,9 @@ end def
(\t0\n};) wl
(static const unsigned char lengths_[] = {) wl
{ (\t) ws dup isnumber
- { pop 0 }
- { length 1 add }
- ifelse wt (,) wl
+ { pop 0 }
+ { length 1 add }
+ ifelse wt (,) wl
} cdforall
(\t0\n};) wl
(\tcode = \(*pprocs->num_dict_create\)\(i_ctx_p, &) ws wt
@@ -639,7 +639,7 @@ readonly def
{ % Stack: string index
2 copy 2 copy get //makefontprocnamemap exch get put pop
}
- for
+ for
} def
/writefont { font2cdict begin writefont end } def
@@ -649,11 +649,11 @@ readonly def
{ counttomark dup 2 eq exch 3 eq or
{ counttomark -1 roll cvn
(Converting ) print dup =only ( font.\n) print flush
- % Ensure that we get a clean copy of the font from the
- % file system.
+ % Ensure that we get a clean copy of the font from the
+ % file system.
2 { % do both local and global
- currentglobal not setglobal
- dup undefinefont
+ currentglobal not setglobal
+ dup undefinefont
} repeat
findfont setfont
(FontName is ) print currentfont /FontName get ==only (.\n) print flush