summaryrefslogtreecommitdiff
path: root/fonts/doublestroke/dsrom.mf
blob: 444039164d1cb0ae3d2331db86b9e6fa2eab0b28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
% The Computer Modern Roman family of fonts (by D. E. Knuth, 1979--1985)
% Modified for Double Stroke Characters (by Olaf Kummer, 1995)

% This file was renamed from {\tt roman.mf} to {\tt dsrom.mf}
% and modified for double stroke characters by Olaf Kummer, 1995.
% The parameters doublestroke_curvedist and doublestroke_twist
% were added by Olaf Kummer, 1996.
% Version 1.0

mode_setup; font_setup;

% New parameters
if unknown doublestroke_thin#: doublestroke_thin#:=cap_hair#; fi
if unknown doublestroke_thick#: doublestroke_thick#:=cap_stem#; fi
if unknown doublestroke_dist#: doublestroke_dist#:=0.9cap_stem#; fi
if unknown doublestroke_curvedist#: doublestroke_curvedist#:=1.1cap_stem#; fi

if unknown doublestroke_twist:
 boolean doublestroke_twist; doublestroke_twist:=serifs;
fi

% Calculate new parameters
define_whole_blacker_pixels(doublestroke_thick,doublestroke_thin);
define_whole_pixels(doublestroke_dist,doublestroke_curvedist);

% Add new macros

% Fit stroke to curve
def curve_stroke(suffix @)(expr xpos,width,patha,pathb) =
x@1l=x@2l=xpos=x@1r-width=x@2r-width;
y@1l=y@1r=2h; y@2l=y@2r=-h;
z@3=(patha)intersectionpoint(z@1l..z@2l);
z@4=(pathb)intersectionpoint(z@1l..z@2l);
z@5=(pathb)intersectionpoint(z@1r..z@2r);
z@6=(patha)intersectionpoint(z@1r..z@2r);
fill z@3--z@4--z@5--z@6--cycle;
enddef;

input dsromu;  % upper case (majuscules)
input dsromo;  % other characters

bye.