🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.text.tex
Article #11366

Re: Making fonts with Metafont -- the answer

#11366
From: rusty wright
Date: Wed, 28 Feb 1990 19:04
529 lines
19424 bytes
For those that like to eyeball other people's local.mf here is what I
use.  This has mode def's that have been collected over the ages.
Some of the more recent mode def's (the ones before white_setup) are
from Doug Henderson.  white_setup.mf follows in a separate article.

% It is customary to input another file to supplement the PLAIN base.
% This supplementary file adds analogous modes, corresponding to
% local output devices, and it redefines `localfont' as appropriate.
% The values of screen_rows and screen_cols should also be updated.
% The auxiliary file should set base_version := base_version&"/localname".
% Remember that the present file PLAIN.MF should not be changed;
% all local changes should be confined to a separate file.

% this file can be loaded after PLAIN.MF.
% it introduces conventions that are commonly used at ucb css.
base_version := base_version&"/ucb css";
message "Updating to "&base_name&" version "&base_version&".";

% screen default dimensions for SUN workstations graphic windows
def sun_setup =
    screen_rows := 400;
    screen_cols := 480;
enddef;

% ibm color graphics (640x200)
def ibm_color_graphics_setup =
    screen_rows:=200;
    screen_cols:=640;
enddef;

% ibm enhanced color graphics (640x350)
% ibm enhanced mono graphics (640x350)
def ibm_enhanced_color_graphics_setup =
    screen_rows:=350;
    screen_cols:=640;
enddef;

% hercules graphics card (720x348)
def hercules_setup =
    screen_rows:=348;
    screen_cols:=720;
enddef;

% hp vectra pc (640x400)
% at&t pc-6300 (olivetti m24) (640x400)
% ncr pc6/pc4i (640x400)
% toshiba t3100 (640x400)
def hp_vectra_setup =
    screen_rows:=400;
    screen_cols:=640;
enddef;

% wyse wy-700 (1280x800)
def wyse_wysevenzerozero_setup =
    screen_rows:=800;
    screen_cols:=1280;
enddef;

% mds genius vhr (736x1008)
def mds_genius_vhr_setup =
    screen_rows:=1008;
    screen_cols:=736;
enddef;


% if a mode_def includes the statement:
%	let font_setup = white_setup
% it will replace the cmbase.mf font_setup with this corrected version.
input white_setup               


% what modes exist in this preload?
mode_def help =
    for i=1 upto number_of_modes:
	message mode_name[i];
    endfor; 
    save ?; % only use this once.  it doesn't make sense to repeat
enddef;

let ? = help_;

% Here are conventions for local output devices:

% copying aps mode: for the Linotype Linotronic 100
mode_def linoonezerozero =
    proofing := 0;		% no, we're not making proofs
    fontmaking := 1;		% yes, we are making a font
    tracingtitles := 0;		% yes, show titles online
    pixels_per_inch := 1270;	% that's roughly 18 per pt
    blacker := .2;		% (this value is conjectural)
    fillin := .2;		% (ditto)
    o_correction := 1;		% (ditto)
enddef;

% copying aps mode: for the Linotype Linotronic 300
mode_def linothree =
    proofing := 0;		% no, we're not making proofs
    fontmaking := 1;		% yes, we are making a font
    tracingtitles := 1;		% yes, show titles online
    pixels_per_inch := 2540;	% that's roughly 35 per pt
    blacker := .2;		% (this value is conjectural)
    fillin := .2;			% (ditto)
    o_correction := 1;		% (ditto)
enddef;

% Apple LaserWriter mode (Canon engine)
mode_def laserwriter =
    proofing := 0;		% no, we're not making proofs
    fontmaking := 1;		% yes, we are making a font
    tracingtitles := 0;		% no, don't show titles at all
    pixels_per_inch := 300;	% the new Canon engine at 300/inch
    blacker := 0.3;		% Canon engine isn't black enough
    fillin := 0.15;		% very small compensation for diagonal fillin
    o_correction := .4;		% but don't overshoot as much
enddef;

% sun mode: for the Sun Workstation for proofing
mode_def sun =
    proofing := 0;		% no, we're not making proofs
    fontmaking := 1;		% yes, we are making a font
    tracingtitles := 0;		% no, don't show titles
    pixels_per_inch := 120;	% really lowres
    blacker := 0.65;		% make the pens a bit blacker
    fillin := 0.2;		% compensate for diagonal fillin
    o_correction := 0.4;	% don't overshoot as much
enddef;

% realsun mode: for the Sun Workstation for windows
mode_def realsun =
    proofing := 0;		% no, we're not making proofs
    fontmaking := 1;		% yes, we are making a font
    tracingtitles := 0;		% no, don't show titles
    pixels_per_inch := 82;	% really lowres
    blacker := 0.65;		% make the pens a bit blacker
    fillin := 0.2;		% compensate for diagonal fillin
    o_correction := 0.4;	% don't overshoot as much
enddef;

% epson mode: for printers like the epson fx series
mode_def epson =
    proofing := 0;		% no, we're not making proofs
    fontmaking := 1;		% yes, we are making a font
    tracingtitles := 0;		% no, don't show titles in the log
    pixels_per_inch := 240;	% lowres
    blacker := 0;		% don't make the pens any blacker
    fillin := 0;		% and don't compensate for fillin
    o_correction := 0.2;	% but suppress most overshoots
    aspect_ratio := 9/10;	% 216 dots/inch vertical
    enddef;

% lowest possible resolution recommended
mode_def lowest =
    proofing := 0;		% no, we're not making proofs
    fontmaking := 1;		% yes, we are making a font
    tracingtitles := 0;		% no don't show titles in the log
    pixels_per_inch := 101;	% lowest DEK recommends
    blacker := 0;			% no additional blackness
    fillin := 0;			% no compensation for fillin
    o_correction := 1;		% no reduction in overshoot
enddef;

% graphics mode
mode_def graphics =
    proofing := 0;		% no, we're not making proofs
    fontmaking := 0;		% no, we are not making a font
    tracingtitles := 1;		% yes, show titles in the log
    pixels_per_inch := 1000;
    o_correction := 1;		% no reduction in overshoot
enddef;

% for onscreen viewing of CGA proofs (full screen)
mode_def cgaoneproof =
    proofing := 2;		% yes, we're making full proofs
    fontmaking := 0;		% no, we're not making a font
    tracingtitles := 0;		% no don't show titles online
    pixels_per_inch := 2602;	% make it easy to view one char on screen
    blacker := 0;			% no additional blackness
    fillin := 0;			% no compensation for fillin
    o_correction := 1;		% no reduction in overshoot
    aspect_ratio := 265/640;	% adjust for screen skewing also
enddef;

% for onscreen viewing of CGA proofs (full screen)
mode_def cgaomniproof =
    cgaoneproof_;		% same as cgaoneproof except...
    pixels_per_inch := 1301;	% make it easy to see 3 or 6 chars on screen
enddef;

% for onscreen viewing of CGA smoke proofs (tick marks)
mode_def cgasmoke =
    cgaoneproof_;		% same as cgaproof mode, except:
    proofing := 1;		% yes, we're making unlabeled proofs
    extra_setup := extra_setup&"grayfont black"; % with solid black pixels
    let makebox=maketicks;	% make the boxes less obtrusive
enddef;

% for onscreen viewing of EGA ?test proofs (full screen)
mode_def egaoneproof =
    proofing := 2;		% yes, we're making full proofs
    fontmaking := 0;		% no, we're not making a font
    tracingtitles := 0;		% no don't show titles online
    pixels_per_inch := 2602;	% change to 1300 for use with 3test or 6test
    blacker := 0;		% no additional blackness
    fillin := 0;		% no compensation for fillin
    o_correction := 1;		% no reduction in overshoot
    aspect_ratio := 500/640;	% adjust for screen skewing also
enddef;

% for onscreen viewing of EGA 3test+6test proofs
mode_def egaomniproof =
    egaoneproof_;		% same as egaoneproof mode, except:
    pixels_per_inch := 1301;	% make it easy to view on the screen
enddef;

% for onscreen viewing of EGA smoke proofs (tick marks)
mode_def egasmoke =
    egaoneproof_;		% same as egaoneproof mode, except:
    proofing := 1;		% yes, we're making unlabeled proofs
    extra_setup := extra_setup&"grayfont black"; % with solid black pixels
    let makebox=maketicks;	% make the boxes less obtrusive
enddef;

% for onscreen viewing of HGC proofs (full box)
mode_def hgconeproof =
    proofing := 2;		% yes, we're making full proofs
    fontmaking := 0;		% no, we're not making a font
    tracingtitles := 0;		% no don't show titles online
    pixels_per_inch := 2602;	% make it easy to view one char on screen
    blacker := 0;		% no additional blackness
    fillin := 0;		% no compensation for fillin
    o_correction := 1;		% no reduction in overshoot
    aspect_ratio := 520/720;	% adjust for screen skewing also
enddef;

% for onscreen viewing of HGC proofs (full box)
mode_def hgcomniproof =
    hgconeproof_;		% same as hgconeproof, except...
    pixels_per_inch := 1301;	% make it easy to view 3 or 6 chars on screen
enddef;

% for onscreen viewing of HGC smoke proofs (tick marks)
mode_def hgcsmoke =
    hgconeproof_;		% same as hgconeproof mode, except:
    proofing := 1;		% yes, we're making unlabeled proofs
    extra_setup := extra_setup&"grayfont black";	% with solid black pixels
    let makebox=maketicks;	% make the boxes less obtrusive
enddef;

% previewlow mode: for Textset previewer at lowest resolution
mode_def previewlow =
    proofing := 0;		% no, we're not making proofs
    fontmaking := 1;		% yes, we are making a font
    tracingtitles := 0;		% no, don't show titles
    pixels_per_inch := 80;	% really REALLY lowres
    blacker := 0.65;		% make the pens a bit blacker
    fillin := 0.2;		% compensate for diagonal fillin
    o_correction := 0.4;	% don't overshoot as much
enddef;

% previewmed mode: for Textset previewer at medium resolution
mode_def previewmed =
    proofing := 0;		% no, we're not making proofs
    fontmaking := 1;		% yes, we are making a font
    tracingtitles := 0;		% no, don't show titles
    pixels_per_inch := 118;	% really lowres
    blacker := 0.65;		% make the pens a bit blacker
    fillin := 0.2;		% compensate for diagonal fillin
    o_correction := 0.4;	% don't overshoot as much
enddef;

% previewhigh mode: for Textset previewer at highest resolution
mode_def previewhigh =
    proofing := 0;		% no, we're not making proofs
    fontmaking := 1;		% yes, we are making a font
    tracingtitles := 0;		% no, don't show titles
    pixels_per_inch := 300;	% not so lowres
    blacker := 0.65;		% make the pens a bit blacker
    fillin := 0.2;		% compensate for diagonal fillin
    o_correction := 0.4;	% don't overshoot as much
enddef;

% mode for macintosh (72 dots per inch)
mode_def macintosh =
    pixels_per_inch := 72;	% ultra lowres
    blacker := 0;		% imagewriter is black enough
    o_correction := 0.2;	% don't overshoot too much
    fillin := 0;		% it fills in the diagonals
    proofing := 0;		% no, we're not making proofs
    fontmaking := 1;		% yes, we are making a font
    tracingtitles := 0;		% no, don't show titles
enddef;

% mode for Imagewriter (144 dots per inch)
mode_def imagewriter =
    pixels_per_inch := 144;	% lowres
    blacker := 0;		% imagewriter is black enough
    o_correction := 0.2;	% don't overshoot too much
    fillin := 0;		% it fills in the diagonals
    proofing := 0;		% no, we're not making proofs
    fontmaking := 1;		% yes, we are making a font
    tracingtitles := 0;		% no, don't show titles
enddef;

% Ricoh 4080: for the TI Omnilaser (Stan Osborne's values TUGboat 8,2,134)
mode_def RicohFortyEighty =
    let font_setup = white_setup;	% use the write-white font_setup
    proofing := 0;		% no, we're not making proofs
    fontmaking := 1;		% yes, we are making a font
    tracingtitles := 0;		% no, don't show titles at all
    pixels_per_inch := 300;	% Ricoh write-white engine.
    blacker := 0.2;		% Don't overblack the small fonts
    fillin := -0.2;		% reverse comp. for diagonal fillin
    o_correction := 0.5;	% but don't overshoot as much
enddef;

% imagen mode: for the Imagen 8/300 (Canon engine)
mode_def imagen =
    proofing := 0;		% no, we're not making proofs
    fontmaking := 1;		% yes, we are making a font
    tracingtitles := 0;		% no, don't show titles in the log
    pixels_per_inch := 300;
    blacker := 0;		% Canon engine is black enough
    fillin := 0.2;		% and it tends to fill in diagonals
    o_correction := 0.6;	%
enddef;

% canon mode: for the old Imagen (Canon LBP10)
mode_def canon =
    proofing := 0;		% no, we're not making proofs
    fontmaking := 1;		% yes, we are making a font
    tracingtitles := 0;		% no, don't show titles in the log
    pixels_per_inch := 240;
    blacker := 0.2;		% make pens a wee bit blacker
    fillin := 0.2;		% and compensate for fillin
    o_correction := 0.4;	% but don't overshoot as much
enddef;

% for the QMS (Xerox engine)
mode_def qms =
    proofing := 0;		% no, we're not making proofs
    fontmaking := 1;		% yes, we are making a font
    tracingtitles := 0;		% no, don't show titles in the log
    pixels_per_inch := 300;
    blacker := 0.3;		% (this value not yet tested)
    fillin := 0.2;		% (ditto)
    o_correction := 0.5;	% (ditto)
enddef;

% dover mode: for the Xerox Dover
mode_def dover =
    proofing := 0.0;		% no, we're not making proofs
    fontmaking := 1;		% yes, we are making a font
    tracingtitles := 0;		% no, don't show titles in the log
    pixels_per_inch := 384;
    blacker := 1.2;		% make pens somewhat blacker
    fillin := 0.0;		% no compensation for fillin
    o_correction := 0.6;	% but don't overshoot as much
enddef;

% aps mode: for the Autologic APS-Micro5
mode_def aps =
    proofing := 0;		% no, we're not making proofs
    fontmaking := 1;		% yes, we are making a font
    tracingtitles := 1;		% yes, show titles online
    pixels_per_inch := 722.909;	% that's roughly 10 per pt
    blacker := 0.2;		% make pens a teeny bit blacker
    fillin := 0.2;		% but compensate for diagonal fillin
    o_correction := 1;		% and keep the full overshoot
enddef;

% crs mode: for the Alphatype CRS
mode_def crs =
     proofing := 0;		% no, we're not making proofs
    fontmaking := 1;		% yes, we are making a font
    tracingtitles := 1;		% yes, show titles online
    begingroup
	interim warningcheck := 0;	% (we need to go past 4096)
	pixels_per_inch := 4000+4000/3	% HIGH res
    endgroup;
    blacker := 4.0;		% make pens a lot blacker
    fillin := 0.0;		% but don't compensate for fillin
    o_correction := 1.0;	% and keep the full overshoot
enddef;

% boise mode: for the HP 2680A
mode_def boise =
    proofing := 0;		% no, we're not making proofs
    fontmaking := 1;		% yes, we are making a font
    tracingtitles := 0;		% no, don't show titles in the log
    pixels_per_inch := 180;
    blacker := 0.55;		% make pens a bit blacker
    fillin := 0.1;		% and compensate for diagonal fillin
    o_correction := 0.3;	% but don't overshoot much
enddef;

% DD mode: for the DataDisc (usually with mag=magstep 2=1.44)
mode_def DD =
    proofing := 0;		% no, we're not making proofs
    fontmaking := 1;		% yes, we are making a font
    tracingtitles := 0;		% no, don't show titles in the log
    pixels_per_inch := 70;	% really lowres
    blacker := 0.0;		% don't make the pens any blacker
    fillin := 0.0;		% and don't compensate for fillin
    o_correction := 0.2;	% but suppress most overshoots
enddef;

% newDD mode: for DataDisc with special aspect ratio
mode_def newDD =
    proofing := 0;		% no, we're not making proofs
    fontmaking := 1;		% yes, we are making a font
    tracingtitles := 0;		% no, don't show titles in the log
    pixels_per_inch := 70;	% really lowres
    blacker := 0;			% don't make the pens any blacker
    fillin := 0;			% and don't compensate for fillin
    o_correction := .2;		% but suppress most overshoots
    aspect_ratio := 4/3;		% this is the new feature...
enddef;

% cg mode: for the Compugraphic 8600
mode_def cg =
    proofing := 0;		% no, we're not making proofs
    fontmaking := 1;		% yes, we are making a font
    tracingtitles := 1;		% yes, show titles online
    pixels_per_inch := 1301.5;	% a bit less than 20 per pt
    blacker := .2;		% make pens a teeny bit blacker
    fillin := .2;			% but compensate for diagonal fillin
    o_correction := 1;		% and keep the full overshoot
    aspect_ratio := 1569/1301.5;	% strange, no?
enddef;

% corona mode: for the Corona LP-300 (Canon engine)
mode_def corona =
    proofing := 0;		% no, we're not making proofs
    fontmaking := 1;		% yes, we are not making a font
    tracingtitles := 0;		% no titles in the log
    pixels_per_inch := 300;
    blacker := .3;		% (this value is conjectural)
    fillin := .2;			% (ditto)
    o_correction := .6;		% (ditto)
enddef;

% varityper mode: for the VT-600 version 42.5
mode_def varityper =
    proofing := 0;		% no, we're not making proofs
    fontmaking := 1;		% yes, we are making a font
    tracingtitles := 0;		% no, don't show titles in the log
    pixels_per_inch := 600;
    blacker := 0;			% (this value is conjectural)
    fillin := .2;			% (ditto)
    o_correction := .6;		% (ditto)
enddef;

% default ucb wssg output device
localfont := laserwriter;

% Macros to add mode information specials to fonts.

def mode_special(suffix $) =
    string s, d;
    s := str$;
    d := decimal scantokens s;
    special s&" := "&d&";"
enddef;

def font_mode_specials =
    p_p_i = pixels_per_inch/mag;
    if fontmaking > 0:
	begingroup;
	save d, s, p;
	save pixels_per_inch;
	string p;
	pixels_per_inch := p_p_i;
	special jobname;
	mode_special(mag);
	p := substring(0,length(mode_name[mode])-1) of mode_name[mode];
	special "mode := "&p&";";
	mode_special(pixels_per_inch);
	mode_special(blacker);
	mode_special(fillin);
	mode_special(o_correction);
	endgroup;
    fi
enddef;

inner end;
def bye =
    if fontmaking > 0:
	font_mode_specials;
    fi
    end
enddef;

outer bye, end;

% Finally, here are macros for Xerox-world font info:

% string s names the font family, e.g., "CMR"
def font_family expr s =
    headerbyte 49: BCPL_string(s, 20);
    special "identifier "&s 
enddef;

% string s names the scheme, e.g. "TEX TEXT"
def coding_scheme expr s =
    headerbyte 9: BCPL_string(s, 40);
    special "codingscheme "&s
enddef;
%
% integer x gives the family member number,
def font_face_byte expr x =
    headerbyte 72: x;	% which should be between 0 and 255
    special "fontfacebyte";
    numspecial x
enddef;

% string s becomes an n-byte BCPL string
def BCPL_string(expr s, n) =
    for l := if length(s) >= n : n-1 else: length(s) fi: l
	for k := 1 upto l: , substring (k-1, k) of s
	endfor
	for k := l+2 upto n: , 0
	endfor
    endfor
enddef;
--

--------------------------------------
	rusty c. wright
	rusty@violet.berkeley.edu ucbvax!violet!rusty
Technical Details
Message-ID: <RUSTY.90Feb28110413@garnet.berkeley.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uwm.edu!zaphod.mps.ohio-state.edu!mips!apple!bionet!agate!ucbvax!rusty
References: <3652@plains.UUCP> <4706@jarthur.Claremont.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uwm.edu!zaphod.mps.ohio-state.edu!mips!apple!bionet!agate!ucbvax!rusty
From: rusty@garnet.berkeley.edu (rusty wright)
Newsgroups: comp.text.tex
Subject: Re: Making fonts with Metafont -- the answer
Message-ID: <RUSTY.90Feb28110413@garnet.berkeley.edu>
Date: 28 Feb 90 19:04:13 GMT
References: <3652@plains.UUCP> <4706@jarthur.Claremont.EDU>
Sender: usenet@ucbvax.BERKELEY.EDU
Organization: /garnet_a/rusty/.organization
Lines: 529
In-reply-to: dhosek@jarthur.Claremont.EDU's message of 28 Feb 90 06:07:14 GMT