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