From a3bf13a80e768da24cb01673c1cc191d8c2a8bbf Mon Sep 17 00:00:00 2001 From: Mats Bengtsson Date: Mon, 25 Jan 1999 23:01:39 +0100 Subject: [PATCH] patch::: 1.1.24.mb1: Re: LilyPond 1.1.24 "Hacking Apart Together" pl 24.mb1 - bf: Correct units now used in the .afm files. --- Generated by (address unknown) using package-diff 0.62, >From = lilypond-1.1.24, To = lilypond-1.1.24.mb1 usage cd lilypond-source-dir; patch -E -p1 < lilypond-1.1.24.mb1.diff Patches do not contain automatically generated files or (urg) empty directories, i.e., you should rerun autoconf, configure and possibly make outdirs. --state 1.1.24 1.1.24.mb1 ++state --- Documentation/tex/refman.yo | 1 - NEWS | 10 +++++++++- VERSION | 2 +- buildscripts/mf-to-table.py | 4 ++-- buildscripts/tfmtoafm.sh | 7 +++++-- lily/afm-reader.cc | 25 ++++++++++++++++--------- lily/afm.cc | 4 ++-- lily/include/afm.hh | 3 ++- lily/lookup.cc | 7 ++----- 9 files changed, 39 insertions(+), 24 deletions(-) diff --git a/Documentation/tex/refman.yo b/Documentation/tex/refman.yo index 6845476a00..67be77b94d 100644 --- a/Documentation/tex/refman.yo +++ b/Documentation/tex/refman.yo @@ -1425,7 +1425,6 @@ COMMENT( 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 diff --git a/NEWS b/NEWS index 3063077d1c..b83847bb03 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,12 @@ -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 diff --git a/VERSION b/VERSION index 3311ca71d7..ddbb383d79 100644 --- a/VERSION +++ b/VERSION @@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond 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. diff --git a/buildscripts/mf-to-table.py b/buildscripts/mf-to-table.py index 4d4b505197..aab7f94a2b 100644 --- a/buildscripts/mf-to-table.py +++ b/buildscripts/mf-to-table.py @@ -112,7 +112,7 @@ class Indentable_file(File): class Afm_file (File): def print_f_dimen(self, f): - f = f * 1000 + f = f * 1000 / self.fontsize dimstr = '%.2f' % f @@ -189,7 +189,7 @@ class Log_reader: 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) diff --git a/buildscripts/tfmtoafm.sh b/buildscripts/tfmtoafm.sh index e29420dbcc..f598a8657a 100644 --- a/buildscripts/tfmtoafm.sh +++ b/buildscripts/tfmtoafm.sh @@ -9,8 +9,9 @@ if [ $# -ne 1 ]; then 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 @@ -18,10 +19,12 @@ 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 < Box @@ -29,16 +30,17 @@ String 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 a= String_convert::split_arr (s, ';'); for (int i=0; i < a.size (); i++) { @@ -47,18 +49,18 @@ read_char_metric (String s) Array 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 ()) { @@ -66,7 +68,7 @@ Adobe_font_metric::read_char_metrics (Data_file &input) 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; @@ -108,9 +110,14 @@ read_afm_file (String fn) 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); } @@ -145,7 +152,7 @@ read_afm_file (String fn) if (key == "StartCharMetrics") { input.get_line (); - afm.read_char_metrics (input); + afm.read_char_metrics (input, font_size); } if (key == "EndFontMetrics") break; diff --git a/lily/afm.cc b/lily/afm.cc index e98155d12e..010e3e373d 100644 --- a/lily/afm.cc +++ b/lily/afm.cc @@ -59,8 +59,8 @@ Adobe_font_char_metric::dimensions () const { 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; } diff --git a/lily/include/afm.hh b/lily/include/afm.hh index fea4592ad5..02591602df 100644 --- a/lily/include/afm.hh +++ b/lily/include/afm.hh @@ -21,6 +21,7 @@ struct Adobe_font_char_metric : Character_metric { Real WX_; String N_; Box B_; + int size_; Box &bbox(); String &name(); Real &width(); @@ -53,7 +54,7 @@ struct Adobe_font_metric : Font_metric { 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; diff --git a/lily/lookup.cc b/lily/lookup.cc index 585aacaa3e..da8272b549 100644 --- a/lily/lookup.cc +++ b/lily/lookup.cc @@ -80,11 +80,8 @@ Lookup::afm_find (String s, bool warn) 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 ()), -- 2.39.5