% Compute the font construction parameters for the Computer
% Modern Roman family.  Some other Computer Modern families
% compute their parameters as modifications of these.

u#:=               % unit width
    (if design_size < 10: ((design_size*15)+50)
%elseif design_size < 12: ((design_size*17.5)+25)
                    else: (-(0.062437562437*design_size*design_size) +
                           (18.8736263736*design_size) +
                           (17.5074925074))fi)/360pt#;

width_adj#:=       % width adjustment for certain characters
                          0pt#;

serif_fit#:=       % extra sidebar near lowercase serifs
                          0pt#;

cap_serif_fit#:=   % extra sidebar near uppercase serifs
    (if design_size <  9: ((-0.5*design_size*design_size)+
                           (13.5*design_size)-35)
 elseif design_size < 10: ((design_size*4)+10)
                    else: (((0.022893772893*design_size*design_size) +
                           (3.4963369963*design_size) +
                           (12.7472527472))+0.002)fi)/360pt#;

letter_fit#:=      % extra space added to all sidebars
    (if design_size <  6: (-(design_size*20)+150)
 elseif design_size <  7: (-(design_size*10)+90)
 elseif design_size <  8: (-(design_size*20)+160)
 elseif design_size < 17: (0)
                    else: (-36)fi)/360pt#;    

body_height#:=     % height of tallest characters
    (if design_size < 10: (design_size*270)
                    else: (-(0.14568764568*design_size*design_size) +
                           (273.205128205*design_size) -
                           (17.482517482))fi)/360pt#;

asc_height#:=      % height of lowercase ascenders
                          (design_size*250)/360pt#;

cap_height#:=      % height of caps
    (if design_size < 10: (design_size*246)
                    else: (-(0.0228937728937*design_size*design_size) +
                           (246.503663003*design_size) -
                           (2.74725274725))fi)/360pt#;

fig_height#:=      % height of numerals
    (if design_size < 10: ((design_size*232)+0.00006)
                    else: ((0.0270562770562*design_size*design_size) +
                           (231.404761904*design_size) +
                           (3.24675324675))fi)/360pt#;

x_height#:=        % height of lowercase without ascenders
    (if design_size < 10: (design_size*155)
                    else: (-(0.010406260406*design_size*design_size) +
                           (155.22893772*design_size) -
                           (1.2487512487))fi)/360pt#;

math_axis#:=       % axis of symmetry for math symbols
    (if design_size < 10: (design_size*90)
                    else: (-(0.00520313020313*design_size*design_size) +
                           (90.1144688644*design_size) -
                           (0.624375624375))fi)/360pt#;

bar_height#:=      % height of crossbar in lowercase e
    (if design_size < 10: (design_size*87)
                    else: ((-(0.087412587412*design_size*design_size) +
                           (88.923076923*design_size) -
                           (10.4895104895))+0.0008)fi)/360pt#;

comma_depth#:=     % depth of comma below baseline
    (if design_size < 10: (design_size*70)
                    else: ((0.010406260406*design_size*design_size) +
                           (69.771062271*design_size) +
                           (1.2487512487))fi)/360pt#;

desc_depth#:=      % depth of lowercase descenders
    (if design_size < 10: (design_size*70)
                    else: ((0.010406260406*design_size*design_size) +
                           (69.771062271*design_size) +
                           (1.2487512487))fi)/360pt#;

crisp#:=           % diameter of serif corners
                          0/360pt#;

tiny#:=            % diameter of rounded corners
    (if design_size <  6: ((design_size*10)+10)
 elseif design_size <  7: (70)
 elseif design_size <  8: (design_size*10)
                    else: (80)fi)/360pt#;      

fine#:=            % diameter of sharply rounded corners
    (if design_size <  6: (design_size*10)
 elseif design_size <  7: (60)
 elseif design_size <  8: ((design_size*10)-10)
                    else: (70)fi)/360pt#;      

thin_join#:=       % width of extrafine details
    (if design_size <  6: (design_size*10)
 elseif design_size <  7: (60)
 elseif design_size <  8: ((design_size*10)-10)
 elseif design_size < 10: (70)
%elseif design_size < 12: ((design_size*2.5)+45)
                    else: ((0.046828171828*design_size*design_size) +
                           (1.4697802197*design_size) +
                           (50.6193806193))fi)/360pt#;

hair#:=            % lowercase hairline breadth
    (if design_size <  8: ((design_size*5)+50)
 elseif design_size < 10: (90)
%elseif design_size < 12: ((design_size*2.5)+65)
                    else: ((0.046828171828*design_size*design_size) +
                           (1.4697802197*design_size) +
                           (70.6193806193))fi)/360pt#;

stem#:=            % lowercase stem breadth
    (if design_size <  9: ((design_size*20)+60)
 elseif design_size < 10: ((design_size*10)+150)
 elseif design_size < 12: ((design_size*15)+100)
                    else: ((design_size*9.4696969696)+166.36363637)fi)/360pt#;

curve#:=           % lowercase curve breadth
    (if design_size <  9: ((design_size*25)+55)
 elseif design_size < 10: ((design_size*20)+100)
 elseif design_size < 40: ((-0.23934398934*design_size*design_size) +
                           (20.265567765*design_size) +
                           (121.278721278))
                    else: (548.951048934)fi)/360pt#;

ess#:=             % breadth in middle of lowercase s
    (if design_size <  7: (-(design_size*design_size*5) +
                           (design_size*105)-280)
 elseif design_size < 10: ((design_size*20)+70)
 elseif design_size < 12: ((design_size*15)+120)
                    else: ((design_size*9.4696969696)+186.36363637)fi)/360pt#;


flare#:=           % diameter of bulbs or breadth of terminals
    (if design_size <  6: ((design_size*20)+90)
 elseif design_size < 10: ((design_size*30)+30)
%elseif design_size < 12: ((design_size*15)+180)
                    else: ((0.280969030969*design_size*design_size) +
                           (8.8186813186*design_size) +
                           (213.71628317))fi)/360pt#;    

dot_size#:=        % diameter of dots
    (if design_size <  6: ((design_size*40)+20)
 elseif design_size < 10: ((design_size*30)+80)
 elseif design_size < 12: ((design_size*20)+180)
                    else: ((design_size*17.0454545454)+215.45454546)fi)/360pt#;

cap_hair#:=        % uppercase hairline breadth
    (if design_size <  9: ((design_size*5)+55)
 elseif design_size < 10: ((design_size*10)+10)
%elseif design_size < 12: ((design_size*2.5)+85)
                    else: ((0.046828171828*design_size*design_size) +
                           (1.4697802197*design_size) +
                           (90.6193806193))fi)/360pt#;

cap_stem#:=        % uppercase stem breadth
    (if design_size <  9: ((design_size*25)+65)
 elseif design_size < 10: ((design_size*30)+20)
 elseif design_size < 12: ((design_size*15)+170)
 elseif design_size < 30: ((-0.4995004995*design_size*design_size) +
                           (25.989010989*design_size) +
                           (110.059940059))
                    else: (440.179820179)fi)/360pt#;

cap_curve#:=       % uppercase curve breadth
    (if design_size <  9: ((design_size*30)+60)
 elseif design_size < 10: ((design_size*40)-30)
%elseif design_size < 12: ((design_size*15)+220)
 elseif design_size < 45: ((-0.23934398934*design_size*design_size) +
                           (20.265567765*design_size) +
                           (191.278721278))
                    else: (618.557692303)fi)/360pt#;

cap_ess#:=         % breadth in middle of uppercase s
    (if design_size <  6: ((design_size*50)-110)
 elseif design_size < 10: ((design_size*40)-50)
 elseif design_size < 12: ((design_size*15)+200)
                    else: ((design_size*9.46969696)+266.36363637)fi)/360pt#;

rule_thickness#:=  % thickness of lines in math symbols
    (if design_size <  7: ((design_size*3)+13)
 elseif design_size < 12: ((design_size*2)+20)
                    else: ((design_size*3.0303030303)+7.6363636364)fi)/100pt#;

dish#:=            % amount erased at top or bottom of serifs
    (if design_size <  8: ((design_size*1)+2)
                    else: (10)fi)/360pt#;

bracket#:=         % vertical distance from serif base to tangent
    (if design_size < 10: (design_size*20)
                    else: (-(0.145687645687*design_size*design_size) +
                           (23.2051282051*design_size) -
                           (17.4825174825))fi)/360pt#;

jut#:=             % protrusion of lowercase serifs
    (if design_size <  7: ((design_size*20)+50)
 elseif design_size < 10: ((design_size*30)-20)
 elseif design_size < 12: ((design_size*25)+30)
                    else: ((design_size*17.0454545454)+125.45454546)fi)/360pt#;

cap_jut#:=         % protrusion of uppercase serifs
    (if design_size <  8: ((design_size*30)+50)
 elseif design_size < 10: ((design_size*40)-30)
 elseif design_size < 12: ((design_size*20)+170)
                    else: ((design_size*17.0454545454)+205.45454546)fi)/360pt#;

beak_jut#:=        % horizontal protrusion of beak serifs
    (if design_size < 10: ((design_size*8)+20)
%elseif design_size < 12: ((design_size*7)+30)
                    else: ((-(0.024975024975*design_size*design_size) +
                           (7.5494505494*design_size) +
                           (27.0029970029))+0.0005)fi)/360pt#;

beak#:=            % vertical protrusion of beak serifs
    (if design_size < 10: (design_size*70)
                    else: ((0.010406260406*design_size*design_size) +
                           (69.771062271*design_size) +
                           (1.2487512487))fi)/360pt#;

vair#:=            % vertical diameter of hairlines
    (if design_size <  6: ((design_size*10)+10)
 elseif design_size <  7: (70)
 elseif design_size <  8: (design_size*10)
 elseif design_size < 10: (80)
%elseif design_size < 12: ((design_size*2.5)+55)
                    else: (((0.046828171828*design_size*design_size) +
                           (1.4697802197*design_size) +
                           (60.6193806193))-0.00013)fi)/360pt#;

notch_cut#:=       % maximum breadth above or below notches
    (if design_size < 10: (design_size*100)
                    else: (-(0.728438228438*design_size*design_size) +
                           (116.02564102*design_size) -
                           (87.4125874125))fi)/100pt#;

bar#:=             % lowercase bar thickness
    (if design_size <  9: ((design_size*5)+55)
 elseif design_size < 10: ((design_size*10)+10)
 elseif design_size < 12: ((design_size*7.5)+35)
                    else: ((design_size*6.6287878787)+45.45454546)fi)/360pt#;

slab#:=            % serif and arm thickness
    (if design_size <  9: ((design_size*5)+55)
 elseif design_size < 10: ((design_size*10)+10)
 elseif design_size < 12: ((design_size*7.5)+35)
                    else: ((design_size*6.6287878787)+45.45454546)fi)/360pt#;

cap_bar#:=         % uppercase bar thickness
    (if design_size <  9: ((design_size*5)+55)
 elseif design_size < 10: ((design_size*10)+10)
 elseif design_size < 12: ((design_size*7.5)+35)
                    else: ((design_size*6.6287878787)+45.45454546)fi)/360pt#;

cap_band#:=        % uppercase thickness above/below lobes
    (if design_size <  9: ((design_size*5)+55)
 elseif design_size < 10: ((design_size*10)+10)
 elseif design_size < 12: ((design_size*7.5)+35)
                    else: ((design_size*6.6287878787)+45.45454546)fi)/360pt#;

cap_notch_cut#:=   % max breadth above/below uppercase notches
    (if design_size < 10: (design_size*100)
                    else: (-(0.72843822843*design_size*design_size) +
                           (116.025641025*design_size) -
                           (87.412587412))fi)/100pt#;

serif_drop#:=      % vertical drop of sloped serifs
    (if design_size < 12: (design_size*4)
                    else: ((design_size*design_size*0.0228937728937) +
                          (design_size * 3.49633699633) +
                          2.74725274725)fi)/360pt#;

stem_corr#:=       % for small refinements of stem breadth
    (if design_size <  8: ((design_size*1)+2)
                    else: (10)fi)/360pt#;

vair_corr#:=       % for small refinements of hairline height
    (if design_size <  7: ((design_size*2)-5)
 elseif design_size <  8: (-(design_size*design_size*0.5) +
                           (design_size*8.5) - 26)
                    else: (10)fi)/360pt#;

apex_corr#:=       % extra width at diagonal junctions
                           0pt#;

o#:=               % amount of overshoot for curves
    (if design_size <  7: ((design_size*5)+15)
 elseif design_size < 10: ((design_size*10)-20)
 elseif design_size < 12: ((design_size*5)+30)
                    else: ((design_size*1.8939393939)+67.2727272732)fi)/360pt#;

apex_o#:=          % amount of overshoot for diagonal junctions
    (if design_size <  7: ((design_size*5)+15)
 elseif design_size < 10: ((design_size*10)-20)
 elseif design_size < 12: ((design_size*5)+30)
                    else: ((design_size*1.8939393939)+67.2727272732)fi)/360pt#;

slant:=            % tilt ratio $(\Delta x/\Delta y)$
                           0;

fudge:=            % factor applied to weights of heavy characters
                           1;

math_spread:=      % extra openness of math symbols
    (if design_size < 10: (-(design_size*200)+2000)
 elseif design_size < 12: (-(design_size*100)+1000)
                    else: (-(design_size*37.8787878787)+254.545454)fi)/1000;

superness:=        % parameter for superellipses
                           1/sqrt2;

superpull:=        % extra openness inside bowls
                           1/6;

beak_darkness:=    % fraction of triangle inside beak serifs
                           11/30;

ligs:=             % level of ligatures to be included
    (if design_size <  6: (1)
                    else: (2)fi);

square_dots:=      % should dots be square?
                          false;

hefty:=            % should we try hard not to be overweight?
                          false;

serifs:=           % should serifs and bulbs be attached?
                          true;

monospace:=        % should all characters have the same width?
                          false;

variant_g:=        % should an italic-style g be used?
                          false;

low_asterisk:=     % should the asterisk be centered at the axis?
                          false;

math_fitting:=     % should math-mode spacing be used?
                          false;

