summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/fonts/source/public/musictex/musicbrh.mf
blob: 7a0abd2cfbd8bd333024e86d4b59a838bf77a444 (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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  this is musicbrg.mf  from Stanislav Kneifl
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%
% change firstbrace and lastbrace if you need smaller or larger braces
%

firstbrace:=20;  % smallest brace is 2*20 pt (\simeq 14mm)
lastbrace:=99;   % largest brace is 2*99 pt (\simeq 69mm)

def drawpianobracket (expr height) =
  u# := 1nhh#/5pt# * 1pt#;
  v# := (height/40) * 1pt#;
  define_pixels (u, v);
  beginchar (height-firstbrace, 1.25nhh#, 0, 0);
    z1 = origin;
    z2 = (4.7u, 7v);
    z3 = (3.6u, 16.5v);
    z4 = (1.9u, 25v);
    z5 = (2.28u, 32v);
    z6 = (w, 40v);
    penpos1 (max(1,0.1u), 125);
    penpos2 (1.2u, 180);
    penpos3 (3.2u, 195);
    penpos4 (2.5u, 180);
    penpos5 (1.14u, 180);
    penpos6 (max(2,0.3u), 150);
    penstroke z1e{dir 35}..z2e..z3e..z4e..z5e..{dir 60}z6e;
    currenttransform := identity reflectedabout ((0,0),(1,0));
    penstroke z1e{dir 35}..z2e..z3e..z4e..z5e..{dir 60}z6e;
    currenttransform := identity;
  endchar;
enddef;

for v=firstbrace upto lastbrace :
   drawpianobracket (v);
endfor;