LSR: Update.
[lilypond.git] / tex / lilypond-tex-metrics.tex
blob5a4450b47907086a3f15917c4260b2750fd06ae7
2 % lilymetrics.tex
4 \catcode `\@=11\relax
6 \newdimen\lily@globalscale
7 \newdimen\lily@localscale
8 \newbox\lily@metricsbox
9 \newwrite\lily@metricsfile
11 \def\lilyglobalscale#1{%
12 \lily@globalscale #1pt
15 \def\lilymetricsfile#1{%
16 \immediate\openout\lily@metricsfile #1\relax
19 \begingroup
20 \catcode `P=12
21 \catcode `T=12
22 \lowercase{%
23 \def\x{%
24 \def\lily@rempt##1.##2PT{%
25 ##1\ifnum ##2 > \z@ .##2\fi
29 \expandafter\endgroup\x
31 \def\lily@strippt{%
32 \expandafter\lily@rempt
35 \long\def\lilygetmetrics#1#2#3#4{%
36 \lily@localscale #3\lily@globalscale
37 % convert pt to 1000*sp (1000/65536)
38 \lily@localscale 0.015259\lily@localscale
39 \font\lily@font = #2 scaled \lily@localscale
40 \setbox\lily@metricsbox\hbox{%
41 \lily@font
42 #4%
44 \edef\lily@wd{\the\wd\lily@metricsbox}%
45 \edef\lily@ht{\the\ht\lily@metricsbox}%
46 \edef\lily@dp{\the\dp\lily@metricsbox}%
47 \immediate\write\lily@metricsfile{%
48 ("#1" . (\lily@strippt\lily@wd
49 \space\lily@strippt\lily@ht
50 \space\lily@strippt\lily@dp))%
54 \catcode `\@=13\relax
56 \endinput