home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1996 December / VPR9612A.ISO / WINTEX / AMS / AMSFONTS / SOURCES / AMSMODES.MF next >
Text File  |  1993-02-24  |  7KB  |  179 lines

  1. %% @mffile{
  2. %%     filename="amsmodes.mf",
  3. %%     version="2.1b",
  4. %%     date="30-NOV-1992",
  5. %%     filetype="Metafont: ",
  6. %%     copyright="Copyright (C) American Mathematical Society,
  7. %%            all rights reserved.  Copying of this file is
  8. %%            authorized only if either:
  9. %%            (1) you make absolutely no changes to your copy
  10. %%                including name; OR
  11. %%            (2) if you do make changes, you first rename it to some
  12. %%                other name.",
  13. %%     author="American Mathematical Society",
  14. %%     address="American Mathematical Society,
  15. %%            Technical Support Department,
  16. %%            P. O. Box 6248,
  17. %%            Providence, RI 02940,
  18. %%            USA",
  19. %%     telephone="401-455-4080 or (in the USA) 800-321-4AMS",
  20. %%     email="Internet: Tech-Support@Math.AMS.org",
  21. %%     codetable="ISO/ASCII",
  22. %%     checksumtype="line count",
  23. %%     checksum="178",
  24. %%     keywords="amsfonts, tex, metafont  ",
  25. %%     abstract=""
  26. %%     }
  27. %
  28. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  29. % This file is based on Stanford's WAITS.mf.  A few extra modes
  30. % are added and the file CURMODE.mf is input at the end if
  31. % the variable "mode" is unknown.
  32.  
  33. % This file can be loaded after PLAIN.MF.
  34. base_version:=base_version&"/WAITS";
  35.  
  36. % We make the following modification of "mode_def" from PLAIN in order
  37. % to accomodate modes not preloaded in MF.  Even though mode had been
  38. % set dependently on the command line (as with mode=talaris), when
  39. % mode_def came along to define "talaris" the assignment operator
  40. % (:=) wiped out that dependency and left mode hanging and undefined
  41. % when mode_setup was called.  We simply add a test to see whether
  42. % "mode" has been set to the mode being defined.
  43.  
  44. % Furthermore, if mode was set to a mode which was preloaded and
  45. % that mode was re-defined at run-time, the value of mode would
  46. % only pick up the old definition.  So, for the other case,
  47. % that the mode being defined already has a numeric realization,
  48. % we avoid redefining that mode's (behind-the-scenes) value.
  49.  
  50. % We also add the following macros to enable conditional "and"
  51. % and "or".  See The METAFONTBook, pp.288-9
  52.  
  53. def cand(text q) = startif true q else: false fi enddef;
  54. def cor(text q) = startif true true else: q fi enddef;
  55. tertiarydef p startif true = if p: enddef;
  56.  
  57.  
  58. def mode_def suffix $ =
  59.  if known($) cand
  60.    (numeric $ cand
  61.    ($<number_of_modes cand
  62.    (mode_name[$] = (str $ & "_")))):
  63.  else: if known(mode-$) cand (unknown mode): mode:= fi
  64.        $:=incr number_of_modes;
  65.        mode_name[$]:=str$ & "_";
  66.  fi
  67.  expandafter quote def scantokens mode_name[$] enddef;
  68.  
  69.  
  70. screen_rows:=400; screen_cols:=480;
  71.  
  72. % Here are conventions for local output devices:
  73.  
  74. mode_def pcscreen =  % pcscreen mode: for screen fonts (118dpi)
  75.  proofing:=0;      % no, we're not making proofs
  76.  fontmaking:=1;      % yes, we are making a font
  77.  tracingtitles:=0;    % no, don't show titles in the log
  78.  pixels_per_inch:=118;
  79.  blacker:=0;      % Canon engine is black enough
  80.  fillin:=0;      % and it tends to fill in diagonals
  81.  o_correction:=0;    % don't overshoot
  82.  enddef;          
  83.  
  84. mode_def epsonlq =  % epsonlq mode: for the Epson LQ and Toshiba
  85.  proofing:=0;      % no, we're not making proofs
  86.  fontmaking:=1;      % yes, we are making a font
  87.  tracingtitles:=0;    % no, don't show titles in the log
  88.  pixels_per_inch:=180;
  89.  blacker:=0;      % don't make pens any blacker
  90.  fillin:=0;      % and don't compensate for diagonal fillin
  91.  o_correction:=.3;    % but don't overshoot much
  92.  enddef;
  93.  
  94. mode_def epsonx =  % Epson 240dpi
  95.  proofing:=0;      % no, we're not making proofs
  96.  fontmaking:=1;      % yes, we are making a font
  97.  tracingtitles:=0;    % no, don't show titles in the log
  98.  pixels_per_inch:=240;    % lowres
  99.  blacker:=0;      % don't make the pens any blacker
  100.  fillin:=0;      % and don't compensate for fillin
  101.  o_correction:=.2;    % but suppress most overshoots
  102.  aspect_ratio:=9/10;    % 216 dots/inch vertical
  103.  enddef;
  104.  
  105. mode_def laser =  % laser mode: for the Apple LaserWriter or Canon 300dpi
  106.  proofing:=0;      % no, we're not making proofs
  107.  fontmaking:=1;      % yes, we are making a font
  108.  tracingtitles:=0;    % no, don't show titles in the log
  109.  pixels_per_inch:=300;
  110.  blacker:=0;      % Canon engine is black enough
  111.  fillin:=.2;      % and it tends to fill in diagonals
  112.  o_correction:=.6;    %
  113.  enddef;          
  114.  
  115. mode_def fourc =  % for 400dpi printers 
  116.  proofing:=0;      % no, we're not making proofs
  117.  fontmaking:=1;      % yes, we are making a font
  118.  tracingtitles:=0;    % no, don't show titles in the log
  119.  pixels_per_inch:=400;
  120.  blacker:=0;      % engine is black enough
  121.  fillin:=.2;      % and it tends to fill in diagonals
  122.  o_correction:=.6;    %
  123.  enddef;          
  124.  
  125. % macintosh mode: for screen fonts (72dpi) & imagewriter (144dpi)
  126. mode_def macintosh =  
  127.  proofing:=0;      % no, we're not making proofs
  128.  fontmaking:=1;      % yes, we are making a font
  129.  tracingtitles:=0;    % no, don't show titles in the log
  130.  pixels_per_inch:=72;
  131.  blacker:=0;      % Don't blacken
  132.  fillin:=0;      % 
  133.  o_correction:=0;    %
  134.  enddef;          
  135.  
  136. mode_def notimagewriter =  % notimagewriter mode: to get 129pk for screen
  137.        % Largest resolution which guarantees at least one point size less
  138.        % than imagewriter size.
  139.  proofing:=0;      % no, we're not making proofs
  140.  fontmaking:=1;      % yes, we are making a font
  141.  tracingtitles:=0;    % no, don't show titles in the log
  142.  pixels_per_inch:=129;
  143.  blacker:=0;      % Don't blacken
  144.  fillin:=0;      % 
  145.  o_correction:=0;    %
  146.  enddef;          
  147.  
  148. localfont:=laser;
  149.  
  150. % Finally, here are macros for Xerox-world font info:
  151.  
  152. def font_family expr s =  % string s names the font family, e.g., "CMR"
  153.  headerbyte 49: BCPL_string(s,20);
  154.  special "identifier "&s enddef;
  155. def coding_scheme expr s = % string s names the scheme, e.g. "TEX TEXT"
  156.  headerbyte 9: BCPL_string(s,40);
  157.  special "codingscheme "&s enddef;
  158. def font_face_byte expr x = % integer x gives the family member number,
  159.  headerbyte 72: x;          % which should be between 0 and 255
  160.  special "fontfacebyte"; numspecial x enddef;
  161.  
  162. def BCPL_string(expr s,n)= % string s becomes an n-byte BCPL string
  163.  for l:=if length(s)>=n: n-1 else: length(s) fi: l
  164.   for k:=1 upto l: , substring (k-1,k) of s endfor
  165.   for k:=l+2 upto n: , 0 endfor endfor enddef;
  166.  
  167. Xerox_world:=1;    % users can say `if known Xerox_world:...fi'
  168.  
  169. inner end;
  170. def bye=
  171.  if fontmaking>0: font_family font_identifier_;
  172.   coding_scheme font_coding_scheme_;
  173.   font_face_byte max(0,254-round 2designsize); fi
  174.  tracingstats:=1;  % at least for now we want this
  175.  end
  176.  enddef;
  177.  
  178. outer bye,end;
  179.