Mystery properties:
bar-number-engraver.cc: "barScriptPadding" vertical space for numbers
-mark-engraver.cc: "markScriptPadding" vertical space for marks
span-bar-engraver.cc: "singleStaffBracket" do single staffs get a bracket?
bar-column-engraver.cc: "barColumnPriority"
bar-number-engraver.cc: "barNumberBreakPriority" Control horizontal ordering
-pl 24.jcn1
+--- ../lilypond-1.1.24/NEWS Mon Jan 25 22:38:25 1999
+++ b/NEWS Mon Jan 25 22:36:28 1999
+@@ -1,3 +1,6 @@
+pl 24.mb1
+ - bf: Correct units now used in the .afm files.
+
+ pl 24, Hacking Apart Together (Jan 25)
+
+ pl 23.jbr1pl 24.jcn1
- bf: rest collisions
- separate tfm-reader
- bf: :|: should not have thin lines
MAJOR_VERSION=1
MINOR_VERSION=1
PATCH_LEVEL=24
-MY_PATCH_LEVEL=jcn1
+MY_PATCH_LEVEL=mb1
# use the above to send patches: MY_PATCH_LEVEL is always empty for a
# released version.
class Afm_file (File):
def print_f_dimen(self, f):
- f = f * 1000
+ f = f * 1000 / self.fontsize
dimstr = '%.2f' % f
afm.write ('FontName %s\n' % name)
afm.start ('FontMetrics')
afm.start ('CharMetrics')
-
+ afm.fontsize = atof(tags[2])
elif label == "group":
ly.indent()
ly.print_lit(name)
fi
font=$1
+size=`echo $font | sed "s/[^0-9]*//"`
afm=$1.afm
-fontfile=`locate $1.tfm`
+fontfile=`kpsewhich $1.tfm`
t1=/tmp/tfmtoafm1-$$
t2=/tmp/tfmtoafm2-$$
rm -f $t1 $t2 $font $afm
for i in `seq 1 127`; do printf "%d Character-%d\n" $i $i >> $t1; done
tfmtodit $fontfile $t1 $font
rm $t1
+scaling=`nawk -v OFMT='%.5f' '/designsize/ {print $2/'$size/1000} $font`
tail -127 $font | cut -f 1-2 > $t1
cat $t1 | cut -d, -f 1-2 > $t2
rm $t1
-nl -ba $t2 | sed "s/,/ /g" | sed "s/^ *//" | sed "s/$/ /" | sed "s/^[0-9]*/C &;/" | sed "s/\([0-9]\)\([0-9][0-9][0-9][0-9][0-9]\) /\1.\2 /"g | sed "s/-[0-9]*/&; B 0.00 0.00 /" > $t1
+nl -ba $t2 | nawk -F '[ \t,]+' '{print "C "$2";\t"$3";\tB 0.00 0.00 "$4/'"$scaling"'" "$5/'"$scaling"'";"}' > $t1
+
cat > $afm <<EOF
FontName cmr
StartFontMetrics
#include "afm.hh"
#include "data-file.hh"
#include "string-convert.hh"
+#include <ctype.h>
Box
strip_leading_white (String c)
{
int i=0;
- while (c[i] == ' ')
+ while (isspace(c[i]))
i++;
c = c.cut_str (i, INT_MAX);
return c;
}
Adobe_font_char_metric
-read_char_metric (String s)
+read_char_metric (String s, int size)
{
Adobe_font_char_metric char_metric;
+ char_metric.size_ = size;
Array<String> a= String_convert::split_arr (s, ';');
for (int i=0; i < a.size (); i++)
{
Array<String> b = String_convert::split_arr (c, ' ');
if (b[0] == "C")
char_metric.C_ = b[1].value_i ();
- if (b[0] == "WX")
+ else if (b[0] == "WX")
char_metric.WX_ = b[1].value_f ();
- if (b[0] == "N")
+ else if (b[0] == "N")
char_metric.N_ = strip_leading_white (b[1]);
- if (b[0] == "B")
+ else if (b[0] == "B")
char_metric.B_ = parse_box (b.slice (1, b.size()));
}
return char_metric;
}
void
-Adobe_font_metric::read_char_metrics (Data_file &input)
+Adobe_font_metric::read_char_metrics (Data_file &input, int size)
{
while (!input.eof_b ())
{
String s= input.get_line ();
if (s == "EndCharMetrics")
return ;
- Adobe_font_char_metric afm_char =read_char_metric (s);
+ Adobe_font_char_metric afm_char =read_char_metric (s, size);
char_metrics_.push (afm_char);
int i = char_metrics_.size ()-1;
ascii_to_metric_idx_ [afm_char.C_] = i;
assert (!input.eof_b ());
+ int i = fn.index_i(".afm");
+ for (; i>0 && isdigit(fn[--i]); )
+ {}
+ int font_size = String_convert::dec2_i(fn.cut_str(i+1,INT_MAX));
+
Adobe_font_metric afm;
- for (int i=0; i < 256; i++)
+ for (i=0; i < 256; i++)
{
afm.ascii_to_metric_idx_.push (-1);
}
if (key == "StartCharMetrics")
{
input.get_line ();
- afm.read_char_metrics (input);
+ afm.read_char_metrics (input, font_size);
}
if (key == "EndFontMetrics")
break;
{
Box b= B_;
- b[X_AXIS] *= 1/1000.0;
- b[Y_AXIS] *= 1/1000.0;
+ b[X_AXIS] *= size_ / 1000.0;
+ b[Y_AXIS] *= size_ / 1000.0;
return b;
}
Real WX_;
String N_;
Box B_;
+ int size_;
Box &bbox();
String &name();
Real &width();
Adobe_font_char_metric const &find_ascii (int ascii,bool warn) const;
String str () const;
Adobe_font_metric ();
- void read_char_metrics (Data_file &input);
+ void read_char_metrics (Data_file &input, int size);
Character_metric *get_char (int, bool) const;
Atom a;
if (m.code () < 0)
return a;
-
- a.dim_ = m.B_;
- a.dim_[X_AXIS] *= 1 / 1000.0;
- a.dim_[Y_AXIS] *= 1 / 1000.0;
-
+
+ a.dim_ = m.dimensions();
a.lambda_ = gh_list (ly_symbol ("char"),
gh_int2scm (m.code ()),