home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / volume.14 / text0010.txt < prev    next >
Encoding:
Internet Message Format  |  1989-01-07  |  5.9 KB

  1. From: uunet!mcvax!rhi.hi.is!marius (Marius Olafsson)
  2.  
  3. >From article <167@longway.TIC.COM>, by BROOKS@CSSS-A.PRIME.COM (David Brooks):
  4. > From: BROOKS@CSSS-A.PRIME.COM (David Brooks)
  5. > Nobody, but nobody, knows how to design eth and thorn.  If any
  6. > Icelanders(?) would post a bitmap AND a PostScript definition of these
  7. > four glyphs, many of us would be grateful.
  8.  
  9. Following is a small PostScript-program that defines a font
  10. containing only the two ISO8859/1 letters 'eth' and 'thorn', both
  11. in upper and lower case, as they should look like in Times-Roman.
  12. The encoding vector puts them at the their places in the ISO 8859/1
  13. character set. After defining the font the program uses it to print
  14. a few copies of the letters in several sizes.  Note that upper case 
  15. 'Eth' is defined by using 'D' in the built-in Times-Roman font.
  16.  
  17. The letters are not typographically perfect, most notably the lower
  18. case 'eth' (which is a very difficult and often badly designed letter),
  19. but should suffice.
  20.  
  21. All fonts (almost) that Adobe sells, define these letters with the
  22. same names as used below. They are also defined in the built-in fonts
  23. with PostScript 42.2 and later. In that case, all that is needed to use
  24. them is to include them in the 'Encoding'-vector.
  25.  
  26. --
  27. Marius Olafsson        marius@rhi.hi.is
  28. University of Iceland    ..!mcvax!hafro!rhi!marius
  29.  
  30. %%%%%%%%%%%%%%%%%%%%%%%%%% PostScript begins %%%%%%%%%%%%%%%%%%%%%%%%%%
  31.  
  32. /BuildCharDict 10 dict def 
  33.  
  34. /IceFont 7 dict def
  35.  
  36. IceFont begin
  37.  
  38.   /FontType 3 def 
  39.   /FontMatrix [.001 0 0 .001 0 0] def 
  40.   /FontBBox [-103 -191 1042 822 ]def 
  41.  
  42.   /Encoding 256 array def 
  43.   0 1 255 {Encoding exch /.notdef put} for
  44.   Encoding (\320) 0 get /Eth put
  45.   Encoding (\360) 0 get /eth put
  46.   Encoding (\336) 0 get /Thorn put
  47.   Encoding (\376) 0 get /thorn put
  48.  
  49.   /CharacterDefs 5 dict def
  50.   CharacterDefs begin
  51.    /.notdef {} def
  52.    /Eth    % definition for the upper case 'Eth'. It is implemented
  53.            % as a Times-Roman 'D' with a line through its left side.
  54.     { /Times-Roman findfont 1000 scalefont setfont
  55.       /trD (D) def
  56.       0 0 moveto
  57.       gsave
  58.        trD stringwidth
  59.        trD false charpath flattenpath pathbbox
  60.       grestore
  61.       setcachedevice % width should be like on 'D'
  62.  
  63.       newpath
  64.         0 0 moveto
  65.         trD show
  66.  
  67.         13 369 moveto
  68.         313 369 lineto
  69.         313 411 lineto
  70.         13 411 lineto
  71.         13 369 lineto
  72.       fill
  73.     } def
  74.    /eth    % definition for the lower case 'eth'. It should look like
  75.            % an 'o' with a curved ascender from its right side, and
  76.            % a crossline at a 90 degree angle to the ascender. Note that
  77.            % the crossline is not quite right in this case.
  78.     { 522 0 0 -18 540 738 setcachedevice % width should be like on 'o'
  79.       newpath
  80.         0.91 0.91 scale
  81.         261 6 moveto
  82.         50 4 48 445 261 445 curveto
  83.         490 445 490 4 261 4 curveto
  84.         261 -15 moveto
  85.         -44 -15 -44 469 261 469 curveto
  86.         324 469 373 430 403 401 curveto
  87.         420 438 340 563 276 608 curveto
  88.         162 555 lineto
  89.         137.36 582.3 lineto
  90.         248.5 632.3 lineto
  91.         211 666 157 700 110 712 curveto
  92.         130.4 721 lineto
  93.         183.4 710 240.4 681 291.7 651.3 curveto
  94.         404.76 703.3 lineto
  95.         425.4 679 lineto
  96.         323.4 631 lineto
  97.         596 434 543 -15 261 -15 curveto
  98.       eofill
  99.     } def
  100.    /Thorn  % definition for the upper case 'Thorn'. It should look similar
  101.            % to a 'P' but the circle lies lower
  102.     { 594 0 0 0 513 666 setcachedevice % width should be like on 'P'
  103.       newpath
  104.         32 3 moveto
  105.         32 16 lineto
  106.         92 16 129 25 133 65 curveto
  107.         133 600 lineto
  108.         133 639 98 654 32 654 curveto
  109.         32 660 lineto
  110.         307 660 lineto 
  111.         307 654 lineto 
  112.         246 654 211 636 208 600 curveto
  113.         208 540 lineto
  114.         350 540 lineto
  115.         470 537 548 461 548 360 curveto
  116.         548 261 467 175 309 173 curveto
  117.         276 174 242 176 208 180 curveto
  118.         208 65 lineto
  119.         208 34 243 16 307 16 curveto
  120.         307 3 lineto
  121.         31 3 lineto
  122.         208 224 moveto
  123.         208 475 lineto
  124.         208 496 246 501 298 501 curveto
  125.         438 501 478 413 478 351 curveto
  126.         478 264 435 204 285 204 curveto
  127.         258 203 236 217 208 224 curveto
  128.       eofill
  129.     } def
  130.    /thorn  % definition for the lower case 'thorn'. It should look like
  131.            % a 'p' with an ascender as high as the 'l'.
  132.     { 504 0 0 -234 468 702 setcachedevice % width should be like on 'p'
  133.       newpath
  134.         5 -217 moveto
  135.         5 -202 lineto
  136.         57 -202 95 -185 95 -130 curveto
  137.         95 578 lineto
  138.         95 615 55 628 40 628 curveto
  139.         28 628 11 622 5 619 curveto
  140.         5 631 lineto
  141.         158 689 lineto
  142.         158 387 lineto
  143.         213 441 254 466 294 466 curveto
  144.         410 466 470 337 470 237 curveto
  145.         470 135 389 -18 261 -18 curveto
  146.         224 -18 189 -2 158 26 curveto
  147.         158 -136 lineto
  148.         158 -187 182 -204 234 -204 curveto
  149.         234 -217 lineto
  150.         5 -217 lineto
  151.         158 87 moveto
  152.         158 341 lineto
  153.         176 364 216 404 254 404 curveto
  154.         359 404 393 298 393 206 curveto
  155.         393 140 366 24 258 24 curveto
  156.         212 24 178 50 158 87 curveto
  157.       eofill
  158.     } def
  159.   end
  160.  
  161.   /BuildChar
  162.     { BuildCharDict begin
  163.  
  164.         /char exch def
  165.         /fontdict exch def
  166.  
  167.         /charname fontdict /Encoding get
  168.           char get def
  169.  
  170.         /charproc fontdict /CharacterDefs get
  171.           charname get def
  172.  
  173.         gsave charproc grestore
  174.       end
  175.     } def
  176. end
  177.  
  178. /IceTimes-Roman IceFont definefont pop
  179.  
  180.  
  181. /IceTimes-Roman findfont 150 scalefont setfont
  182. 30 700 moveto
  183. <D0F0DEFE> show
  184.  
  185. /IceTimes-Roman findfont 200 scalefont setfont
  186. 30 520 moveto
  187. <D0F0DEFE> show
  188.  
  189. /IceTimes-Roman findfont 250 scalefont setfont
  190. 30 320 moveto
  191. <D0F0> show
  192.  
  193. /IceTimes-Roman findfont 250 scalefont setfont
  194. 30 100 moveto
  195. <DEFE> show
  196.  
  197. showpage
  198.  
  199. %%%%%%%%%%%%%%%%%%%%%%%%%%% PostScript ends %%%%%%%%%%%%%%%%%%%%%%%%%%%
  200.  
  201.  
  202. Volume-Number: Volume 14, Number 12
  203.  
  204.