]> git.donarmstrong.com Git - lilypond.git/blob - tex/dimen.tex
release: 0.0.70pre
[lilypond.git] / tex / dimen.tex
1 %
2 % A tex file to help determine dims.
3 %
4
5 \font\musicfont=musix16
6 \font\slurfont=xslu16
7 \def\thefont{\musicfont}
8
9 \def\mb#1{{\thefont\char#1}}
10
11 \newdimen\wid
12 \newdimen\inc
13 \newdimen\here
14 \def\hruler#1{%
15         \wid=#1pt
16         \inc=\wid
17         \divide\inc by #1
18         \divide\wid by 2
19         \here=-\wid
20         \loop\ifdim\here<\wid\advance\here by\inc
21                 \hbox to0pt{\kern\here\vrule width0.05pt height 2pt\hss}%
22         \repeat%
23 }
24
25 \def\vruler#1{%
26         \wid=#1pt
27         \inc=\wid
28         \divide\inc by #1
29         \divide\wid by 2
30         \here=-\wid
31         \loop\ifdim\here<\wid\advance\here by\inc
32                 \vbox to0pt{\vskip\here\vrule width2pt height 0.05pt\vss}%
33         \repeat%
34 }
35 \def\twhrul{\hbox to 0pt{\hbox{\hruler{20}\vrule
36         width0.1pt height 3ptdepth 1pt}}}
37 \def\twvrul{\hbox{\vbox to 20pt{\vruler{20}\vrule
38         width3pt height 0.1pt}}}
39  
40 \def\doitem#1{
41         #1 %
42          %\twvrul%doesn't work
43         \hbox to 50pt{\qquad\twhrul\mb{#1}\hss}\setbox0=\hbox{\mb{#1}} width \the\wd0\ depth \the\dp0 \ height \the\ht0}
44
45 \newcount\n
46 \def\charn{\n=-1
47         \loop\ifnum\n<255\advance\n by1
48         \doitem{\number\n}\endgraf\repeat}
49
50
51         \charn
52
53 \bye