home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / next / programm / 7696 < prev    next >
Encoding:
Text File  |  1992-12-12  |  2.5 KB  |  95 lines

  1. Newsgroups: comp.sys.next.programmer
  2. Path: sparky!uunet!spool.mu.edu!umn.edu!csus.edu!news
  3. From: eps@futon.SFSU.EDU (Eric P. Scott)
  4. Subject: Bobbing for Apples (was How to generate the complete character set)
  5. Message-ID: <1992Dec12.072713.4197@csus.edu>
  6. Sender: news@csus.edu
  7. Reply-To: eps@cs.sfsu.edu
  8. Organization: San Francisco State University
  9. References: <1992Dec6.121136.22447@u.washington.edu>
  10. Date: Sat, 12 Dec 1992 07:27:13 GMT
  11. Lines: 82
  12.  
  13. What do you mean by "complete character set?"  Oftentimes a
  14. PostScript font will contain characters that aren't in its
  15. encoding vector.  Usually that occurs when it contains more
  16. characters than can be expressed in 8-bit ASCII ... but not
  17. always.
  18.  
  19. Try displaying the characters in the "Symbol" font by enumerating
  20. ASCII values.  Notice that position 240 (decimal) appears blank
  21. [/.notdef].
  22.  
  23. Now examine the file /NextLibrary/Fonts/Symbol.font/Symbol:
  24. |dup 238 /braceleftbt put
  25. |dup 239 /braceex put
  26. |% dup 240 /apple put
  27. |dup 241 /angleright put
  28.  
  29. Hey!  Something's commented out!
  30.  
  31. And look at Symbol.afm:
  32.  
  33. |C 238 ; WX 494 ; N braceleftbt ; B 201 -70 439 926 ;
  34. |C 239 ; WX 494 ; N braceex ; B 201 -80 255 935 ;
  35. |C 241 ; WX 329 ; N angleright ; B 21 -198 302 746 ;
  36.  
  37. Gee, there's something missing, but look at the end:
  38.  
  39. |C -1 ; WX 790 ; N apple ; B 56 -3 733 808 ;
  40.  
  41. [Similarly in the screen afms]
  42.  
  43. Of course, I would never suggest modifying one of NeXT's
  44. system files :-) :-) :-) , so just Preview (or print) the
  45. attached to see what the "censored" character is.
  46.  
  47.                     -=EPS=-
  48. -------
  49. %!PS-Adobe-2.0 EPSF-1.2
  50. %%BoundingBox: 0 0 540 704
  51. %%DocumentFonts: Helvetica Times-Roman Symbol
  52. %%EndComments
  53. gsave 72 216 translate
  54. /Helvetica findfont 18 scalefont setfont
  55. 155 470 moveto (Adobe Symbol Font) show
  56. 0 setgray
  57. /Times-Roman findfont 12 scalefont setfont
  58. 10 440 moveto 
  59. 32 32 224 {
  60.   dup 31 add 
  61.   currentpoint 4 2 roll
  62.   1 exch {
  63.     dup (???) cvs dup stringwidth pop 21 exch sub 0 rmoveto show
  64.     9 0 rmoveto (?) dup 0 3 index put show pop
  65.     14 sub 2 copy moveto
  66.   } for
  67.   moveto
  68.   67 448 rmoveto
  69. } bind for
  70. 1 dict begin
  71. /Symbol findfont dup length dict /newdict exch def
  72. {
  73.   1 index dup /FID ne {
  74.     /Encoding eq { dup length array copy } if
  75.     newdict 3 1 roll put
  76.   } { pop pop pop } ifelse
  77. } bind forall
  78. newdict /Encoding get 240 /apple put
  79. /A-Symbol newdict definefont pop
  80. end
  81. /A-Symbol findfont 12 scalefont setfont
  82. 10 440 moveto 
  83. 32 32 224 {
  84.   dup 31 add 
  85.   currentpoint 4 2 roll
  86.   1 exch {
  87.     46 0 rmoveto (?) dup 0 3 index put show pop
  88.     14 sub 2 copy moveto
  89.   } for
  90.   moveto
  91.   67 448 rmoveto
  92. } bind for
  93. grestore
  94. showpage
  95.