]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.3.114
authorfred <fred>
Wed, 27 Mar 2002 00:34:11 +0000 (00:34 +0000)
committerfred <fred>
Wed, 27 Mar 2002 00:34:11 +0000 (00:34 +0000)
CHANGES
buildscripts/mf-to-table.py
lily/afm.cc
lily/all-font-metrics.cc
lily/include/afm.hh
lily/include/tfm.hh

diff --git a/CHANGES b/CHANGES
index 8f22b247881909a75a26bff40e59f6dc5334d988..6e3fa7d01a7a6de597afa642c577a48ef113e56a 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,33 @@
-1.3.112.jcn3
+1.3.113.jcn2
 ============
 
+* Moved all documentation from regtest to individual example files.
+
+* Added feature to lilypond-book to write out \header texidoc string.
+
+* Reincluded simple FAQ in tarball.
+
+* Fixed lyrics with bar-enrgaver example.
+
+* Renamed LyricVoice to LyricsVoice.
+
+1.3.113.uu1
+===========
+
+* Checksums for AFM fonts: make sure that TFM and AFM files match.
+One FAQ less to be asked.
+
+* Made point-and-click switchable, default: off 
+
+* Bugfix: don't make multimeasure rests from failed span-requests.
+
+* Bugfix: mark with string arguments, eg. letters..
+
+* Bugfix: direction of staccato dots. 
+
+1.3.113
+=======
+
 * Added stems to font for use in markup text.
 
 * Fixed markup text kerning, see input/test/metronome.ly.
index 4c87408117cd194c885b7aa023647ceedd1bc05c..1dfb64f4e2462a8531109e549b1e46e984a4cf4e 100644 (file)
@@ -43,6 +43,19 @@ class Char_metric:
                pass
 
 
+def tfm_checksum (fn):
+       s = open (fn).read ()
+       s = s[ 12 * 2 : ]
+       cs_bytes = s[:4]
+
+       shift = 24
+       cs = 0
+       for b in cs_bytes:
+               cs = cs  + (ord (b) << shift)
+               shift = shift - 8
+
+       return cs
+  
 def parse_logfile (fn):
        (autolines, deps) = read_log_file (fn)
        charmetrics = []
@@ -163,7 +176,11 @@ for opt in options:
 
 for filenm in files:
        (g,m, deps) =  parse_logfile (filenm)
+       cs = tfm_checksum (re.sub ('.log$', '.tfm', filenm))
        afm = open (afmfile_nm, 'w')
+
+       afm.write ("TfmCheckSum %u\n" % cs) 
+       
        write_afm_metric (afm, g,m)
        write_tex_defs (open (texfile_nm, 'w'), g, m)
        write_deps (open (depfile_nm, 'wb'), deps, [texfile_nm, afmfile_nm])
index 1745b683a35ac6c0217b71e5d3766d722367836a..b9224648bec3d5e9612b8bdad1787e130a1dbb81 100644 (file)
@@ -12,6 +12,7 @@
 
 Adobe_font_metric::Adobe_font_metric (AFM_Font_info * fi)
 {
+  checksum_ = 0;
   font_inf_ = fi;
 
   for (int i= 256; i--;)
@@ -28,10 +29,10 @@ Adobe_font_metric::Adobe_font_metric (AFM_Font_info * fi)
 
 
 SCM
-Adobe_font_metric::make_afm (AFM_Font_info *fi)
+Adobe_font_metric::make_afm (AFM_Font_info *fi, unsigned int checksum)
 {
   Adobe_font_metric * fm = new Adobe_font_metric (fi);
-
+  fm->checksum_ = checksum;
   return fm->self_scm();    
 }
 
@@ -89,7 +90,21 @@ SCM
 read_afm_file (String nm)
 {
   FILE *f = fopen (nm.ch_C() , "r");
+  char s[2048];
+  char *check_key = "TfmCheckSum"; 
+  fgets (s, sizeof (s), f);
+
+  unsigned int cs = 0;  
+  if (strncmp (s, check_key, strlen (check_key)) == 0)
+    {
+      sscanf (s + strlen (check_key), "%ud", &cs);
+    }
+  else
+    {
+      rewind (f);
+    }
 
+    
   AFM_Font_info * fi;
   int ok = AFM_parseFile (f, &fi, ~1);
 
@@ -100,7 +115,7 @@ read_afm_file (String nm)
     }
   fclose (f);
 
-  return Adobe_font_metric::make_afm (fi);
+  return Adobe_font_metric::make_afm (fi, cs);
 }
 
   
index 3a8b325a68e595d54d4777a8ad4d263629243108..fd34ea57a210a6aef74f2b7bf8495ebf13e06cd1 100644 (file)
@@ -75,7 +75,24 @@ All_font_metrics::find_afm (String name)
 
       afm_p_dict_->set (sname,val);
 
-      scm_unprotect_object (val);      
+      scm_unprotect_object (val);
+
+
+      Adobe_font_metric *afm
+       = dynamic_cast<Adobe_font_metric*> (unsmob_metrics (val) );
+      Tex_font_metric * tfm = find_tfm (name);
+
+      if (tfm->info_.checksum != afm->checksum_)
+       {
+         String s = _("Font checksum mismatch");
+         s+= "\n";
+         s += " TFM: " + to_str ((int) tfm->info_.checksum);
+         s += " AFM: " + to_str ((int) afm->checksum_);
+         s += "\n";
+         s += _(" Rebuild all AFM files, and remove all .pk and .tfm files");
+
+         error (s);
+       }
     }
   
   return dynamic_cast<Adobe_font_metric*> (unsmob_metrics (val));
index 79d7461f9812649d72840acdd9dc188de2a8bc02..73f2268a1d83ba396a24ed3923006b1dce5c1605 100644 (file)
@@ -28,8 +28,9 @@ struct Adobe_font_metric : Font_metric
 
   String str () const;
   ~Adobe_font_metric ();
-  static SCM make_afm (AFM_Font_info*);
+  static SCM make_afm (AFM_Font_info*, unsigned);
 
+  unsigned int checksum_;
 protected:
   Array<int> ascii_to_metric_idx_;
   Dictionary<int> name_to_metric_dict_;
index 22e17c87cd14327aea5e47d6683d01517e04317b..068ca68ae225cc1eebc045b8af1bcd866439d0ef 100644 (file)
@@ -155,13 +155,14 @@ public:
 
   String str () const;
 
-private:
-  Tex_font_metric ();
+
   
   Tfm_info info_;
   Tfm_header header_;
   Array<Tex_font_char_metric> char_metrics_;
   Array<int> ascii_to_metric_idx_;
+private:
+  Tex_font_metric ();
 };