home *** CD-ROM | disk | FTP | other *** search
/ VRML Tools for 3D Cyberspace / VRML_Tools_For_3D_Cyberspace.iso / t_space2 / set66 < prev    next >
Text File  |  1996-07-01  |  8KB  |  432 lines

  1. %%BeginResource: procset Adobe_typography_AI3 1.0 0
  2. %%Title: (Typography Operators)
  3. %%Version: 1.0 
  4. %%CreationDate:(5/31/90) ()
  5. %%Copyright: ((C) 1987-1990 Adobe Systems Incorporated All Rights Reserved)
  6.  
  7. currentpacking true setpacking
  8. userdict /Adobe_typography_AI3 46 dict dup begin put
  9. /initialize            % - initialize -
  10. {
  11. /TZ
  12.  where
  13.     {
  14.     pop
  15.     }
  16.     {
  17.     Adobe_typography_AI3 begin
  18.     Adobe_typography_AI3
  19.         {
  20.         dup xcheck
  21.             {
  22.             bind
  23.             } if
  24.         pop pop
  25.         } forall
  26.     end
  27.     Adobe_typography_AI3 begin
  28.     } ifelse
  29. } def
  30. /terminate            % - terminate -
  31. {
  32. currentdict Adobe_typography_AI3 eq
  33.     {
  34.     end
  35.     } if
  36. } def
  37.  
  38. % [ number value stream [ array for encoding modification ] modifyEncoding ==> [ modified array ]
  39. /modifyEncoding
  40. {
  41.     /_tempEncode exch ddef
  42.     
  43.     % pointer for sequential encodings
  44.     /_pntr 0 ddef
  45.     
  46.     {
  47.         % get bottom object
  48.         counttomark -1 roll
  49.  
  50.         % is it a mark ?
  51.         dup type dup /marktype eq         
  52.         {
  53.             % exit
  54.             pop pop exit
  55.         }
  56.         {
  57.             % ... object ... type ....
  58.  
  59.             % insert if a nametype
  60.             /nametype eq
  61.             {
  62.                 % insert the name at _pntr and increment pointer
  63.                 _tempEncode /_pntr dup load dup 3 1 roll 1 add ddef 3 -1 roll
  64.                 put
  65.             }
  66.             {
  67.                 % reset _pntr if it's a number
  68.                 /_pntr exch ddef                    
  69.             }
  70.             ifelse
  71.         }
  72.         ifelse
  73.     }
  74.     loop    
  75.     
  76.     % return the modified encoding
  77.     _tempEncode
  78. }
  79. def
  80.  
  81. /TE    % Set std platform encoding     % (encoding pairs) TE -
  82. {
  83.     StandardEncoding 256 array copy modifyEncoding 
  84.     /_nativeEncoding exch def
  85. } def
  86.  
  87. % re-define font
  88. % expected arguments
  89. % for 'normal fonts : 
  90. %    [ /_Helvetica-Bold/Helvetica-Bold direction fontScript defaultEncoding TZ
  91. %
  92. % for cartographic, pictographic, and expert fonts :
  93. %     [ ... number value stream ... /_Helvetica-Bold/Helvetica-Bold 
  94. %    direction fontScript defaultEncoding TZ
  95. /TZ        
  96. {
  97.     % platform dependent coding flag
  98.     /_useNativeEncoding exch def
  99.  
  100.     % pop fontScript & direction
  101.     pop pop
  102.     
  103.     % create a new dictionary with length
  104.     % equal to original dictionary length + 2
  105.     % copy all the key/value pairs except FID
  106.     findfont dup length 2 add dict
  107.     
  108.     begin
  109.     
  110.         % copy all the values but the FID
  111.         % into the new dictionary
  112.         mark exch
  113.         {
  114.             1 index /FID ne { def } if cleartomark mark
  115.         }
  116.         forall
  117.         % discard last mark
  118.         pop
  119.         
  120.         % define FontName
  121.         /FontName exch def
  122.         
  123.         % if no re-encoding stream is present
  124.         % then if the base encoding vector of the font
  125.         % is the same as StandardEncoding
  126.         % and the use platform encoding flag is true
  127.         % then install AI platform encoding
  128.         % else leave the base encoding in effect
  129.  
  130.         counttomark 0 eq
  131.         {
  132.             Encoding StandardEncoding eq 1 _useNativeEncoding eq and
  133.             {
  134.                 /Encoding _nativeEncoding def
  135.             }
  136.             if
  137.             % clean up
  138.             cleartomark
  139.         }
  140.         {    
  141.             % custom encoding to be done
  142.             % start off with a copy of the font's standard encoding
  143.             /Encoding load 256 array copy 
  144.             modifyEncoding /Encoding exch def
  145.         }
  146.         ifelse        
  147.         FontName currentdict
  148.     end
  149.     
  150.     % register the new font
  151.     definefont pop
  152. }
  153. def
  154.  
  155. % text painting operators
  156. /tr                    % string tr ax ay string 
  157. {
  158. _ax _ay 3 2 roll
  159. } def
  160. /trj                % string trj cx cy fillchar ax ay string 
  161. {
  162. _cx _cy _sp _ax _ay 6 5 roll
  163. } def
  164.  
  165. /a0
  166. {
  167. /Tx    % text                            % textString Tx -
  168.     {
  169.     dup 
  170.     currentpoint 3 2 roll
  171.     tr _psf
  172.     newpath moveto
  173.     tr _ctm _pss
  174.     } ddef
  175. /Tj    % justified text                % textString Tj -
  176.     {
  177.     dup
  178.     currentpoint 3 2 roll
  179.     trj _pjsf
  180.     newpath moveto
  181.     trj _ctm _pjss
  182.     } ddef
  183.     
  184. } def
  185. /a1
  186. {
  187. W B
  188. } def
  189.  
  190. /e0
  191. {
  192. /Tx    % text                            % textString Tx -
  193.     {
  194.     tr _psf
  195.     } ddef
  196. /Tj    % justified text                % textString Tj -
  197.     {
  198.     trj _pjsf
  199.     } ddef
  200. } def
  201.  
  202. /e1
  203. {
  204. W F 
  205. } def
  206.  
  207.  
  208. /i0
  209. {
  210. /Tx    % text                            % textString Tx -
  211.     {
  212.     tr sp
  213.     } ddef
  214. /Tj    % justified text                % textString Tj -
  215.     {
  216.     trj jsp
  217.     } ddef
  218. } def
  219.  
  220. /o0
  221. {
  222. /Tx    % text                            % textString Tx -
  223.     {
  224.     tr sw rmoveto
  225.     } ddef
  226. /Tj    % justified text                % textString Tj -
  227.     {
  228.     trj swj rmoveto
  229.     } ddef
  230. } def
  231.  
  232. /r0
  233. {
  234. /Tx    % text                            % textString Tx -
  235.     {
  236.     tr _ctm _pss
  237.     } ddef
  238. /Tj    % justified text                % textString Tj -
  239.     {
  240.     trj _ctm _pjss
  241.     } ddef
  242. } def
  243. /r1
  244. {
  245. W S
  246. } def
  247.  
  248. % font operators
  249.  
  250. % Binding
  251. /To    % begin text                     % bindType To -
  252. {
  253.     pop _ctm currentmatrix pop
  254. } def
  255.  
  256. /TO    % end text                    % TO -
  257. {
  258.     Te _ctm setmatrix newpath
  259. } def
  260.  
  261. % Text paths
  262. /Tp    % begin text path                % a b c d tx ty startPt Tp -
  263. {
  264.     pop _tm astore pop _ctm setmatrix 
  265.     2 dict begin /W {} def /h {} def
  266. } def
  267.  
  268. /TP    % end text path                    % TP -
  269. {
  270.     end
  271.     iTm 0 0 moveto
  272. } def
  273.  
  274. % Render mode & matrix operators
  275. /Tr    % begin render                    % render Tr - 
  276. {
  277.     Te currentpoint newpath moveto
  278.     dup 8 eq {pop 0} {dup 9 eq {pop 1} if} ifelse
  279.     dup /_render exch ddef
  280.     _renderStart exch get load exec
  281. } def
  282.  
  283. /iTm % internal set text matrix        % - iTm -    (uses _tm as implicit argument)
  284. {
  285. _ctm setmatrix _tm concat 0 _rise translate _hs 1 scale
  286. } def
  287.  
  288. /Tm % set text matrix                % a b c d tx ty Tm -
  289. {
  290. _tm astore pop iTm 0 0 moveto
  291. } def
  292.  
  293. /Td % translate text matrix         % tx ty Td -
  294. {
  295. _mtx translate _tm _tm concatmatrix pop iTm 0 0 moveto
  296. } def
  297.  
  298. /Te    % end render                    % - Te -
  299. {
  300.     _render -1 eq {} {_renderEnd _render get dup null ne {load exec} {pop} ifelse} ifelse
  301.     /_render -1 ddef
  302. } def
  303.  
  304.  
  305. % Attributes
  306. /Ta    % set alignment                    % alignment Ta -
  307. {
  308. pop
  309. } def
  310.  
  311. /Tf    % set font name and size        % fontname size Tf -
  312. {
  313. dup 1000 div /_fScl exch ddef
  314. exch findfont exch scalefont setfont
  315. } def
  316.  
  317. /Tl    % set leading                    % leading paragraphLeading Tl -
  318. {
  319. pop
  320. 0 exch _leading astore pop
  321. } def
  322.  
  323. /Tt    % set user tracking                % userTracking Tt -
  324. {
  325. pop
  326. } def
  327.  
  328. /TW % set word spacing                % minSpace optSpace maxSpace TW -
  329. {
  330. 3 npop
  331. } def
  332.  
  333. /Tw    % set computed word spacing        % wordSpace Tw
  334. {
  335. /_cx exch ddef
  336. } def
  337.  
  338. /TC % set character spacing            % minSpace optSpace maxSpace TC -
  339. {
  340. 3 npop
  341. } def
  342.  
  343. /Tc    % set computed char spacing     % charSpace Tc -
  344. {
  345. /_ax exch ddef
  346. } def
  347.  
  348. /Ts % set super/subscripting (rise)    % rise Ts -
  349. {
  350. /_rise exch ddef
  351. currentpoint
  352. iTm
  353. moveto
  354. } def
  355.  
  356. /Ti    % set indentation                % firstStartIndent otherStartIndent stopIndent Ti -
  357. {
  358. 3 npop
  359. } def
  360.  
  361. /Tz % set horizontal scaling        % scalePercent Tz -
  362. {
  363. 100 div /_hs exch ddef
  364. iTm
  365. } def
  366.  
  367. /TA % set pairwise kerning            % autoKern TA -
  368.                                     %    autoKern = 0 -> no pair kerning
  369.                                     %             = 1 -> automatic pair kerning
  370. {
  371. pop
  372. } def
  373.  
  374. /Tq % set hanging quotes            % hangingQuotes Tq -
  375.                                     %    hangingQuotes     = 0 -> no hanging quotes
  376.                                     %                     = 1 -> hanging quotes
  377. {
  378. pop
  379. } def
  380.  
  381.  
  382. % Text Bodies
  383. /TX {pop} def
  384.  
  385. %/Tx    % non-justified text            % textString Tx -
  386. %/Tj    % justified text                % textString Tj -
  387.  
  388. /Tk    % kern                            % autoKern kernValue Tk -
  389.                                     %      autoKern = 0 -> manual kern, = 1 -> auto kern
  390.                                     %    kernValue = kern value in em/1000 space
  391. {
  392. exch pop _fScl mul neg 0 rmoveto
  393. } def
  394. /TK    % non-printing kern                % autoKern kernValue TK -
  395. {
  396. 2 npop
  397. } def
  398.  
  399. /T* % carriage return & line feed    % - T* -
  400. {
  401. _leading aload pop neg Td
  402. } def
  403.  
  404. /T*- % carriage return & negative line feed    % - T*- -
  405. {
  406. _leading aload pop Td
  407. } def
  408.  
  409. /T-    % print a discretionary hyphen    % - T- -
  410. {
  411. _hyphen Tx
  412. } def
  413.  
  414. /T+    % discretionary hyphen hyphen    % - T+ -
  415. {} def
  416.  
  417. /TR    % reset pattern matrix             % a b c d tx ty TR -
  418. {
  419. _ctm currentmatrix pop     
  420. _tm astore pop 
  421. iTm 0 0 moveto 
  422. } def
  423.  
  424. /TS    % special chars                    % textString justified TS -
  425. {
  426. 0 eq {Tx} {Tj} ifelse
  427. } def
  428.  
  429. currentdict readonly pop end
  430. setpacking
  431.  
  432. %%EndResource