]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.1.24.mb1: Re: LilyPond 1.1.24 "Hacking Apart Together"
authorMats Bengtsson <mats.bengtsson@s3.kth.se>
Mon, 25 Jan 1999 22:01:39 +0000 (23:01 +0100)
committerMats Bengtsson <mats.bengtsson@s3.kth.se>
Mon, 25 Jan 1999 22:01:39 +0000 (23:01 +0100)
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
NEWS
VERSION
buildscripts/mf-to-table.py
buildscripts/tfmtoafm.sh
lily/afm-reader.cc
lily/afm.cc
lily/include/afm.hh
lily/lookup.cc

index 6845476a009a0cb43d7bf5e242b077a15056d432..67be77b94d61e594adb4bba72c3d3eea4bdfefa1 100644 (file)
@@ -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 3063077d1cde9ea605aebdddcb69d648dbfb872b..b83847bb03b78f3c1c48b3d399c9985982f5fef3 100644 (file)
--- 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 3311ca71d712e326c047780ccf0a6ed81aad8186..ddbb383d79ce3b47e5ee8df507b1b02f124ff3af 100644 (file)
--- 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.
index 4d4b505197d1469b1b98914af14595ac21b90224..aab7f94a2b2b0b663b49874740a0f7431b7e60ff 100644 (file)
@@ -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)
index e29420dbcc1bcdbfa6d405c714a51515ebb73487..f598a8657acf9d2b1bbd6e85f5e9c180da4c399a 100644 (file)
@@ -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 <<EOF
 FontName cmr
 StartFontMetrics
index 3b186d3558f9d6caefe34dfea4bcbf33aafe6e11..ce69ff0c9b17a25a5988938d4bcedf8cd1d7ba3d 100644 (file)
@@ -11,6 +11,7 @@
 #include "afm.hh"
 #include "data-file.hh"
 #include "string-convert.hh"
+#include <ctype.h>
 
 
 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<String> a= String_convert::split_arr (s, ';');
   for (int i=0; i < a.size (); i++)
     {
@@ -47,18 +49,18 @@ read_char_metric (String s)
       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 ())
     {
@@ -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;
index e98155d12e53c66cf320db819116bc8b5b03fdb9..010e3e373d31848b03ac788696bed69ff40ce113 100644 (file)
@@ -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;
 }
index fea4592ad5fc2ced77e818cccc72dec761ffa9d0..02591602dfac3518f14a828130b1fdd848a65034 100644 (file)
@@ -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;
index 585aacaa3eeb8ecc6637e91e7cc5ff7c047441ca..da8272b5494541ad2838bc8ddacf8665a6dc9986 100644 (file)
@@ -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 ()),