From 13def52dee5fffd9e1054c615734c4f2e4664321 Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 27 Mar 2002 00:34:11 +0000 Subject: [PATCH] lilypond-1.3.114 --- CHANGES | 29 ++++++++++++++++++++++++++++- buildscripts/mf-to-table.py | 17 +++++++++++++++++ lily/afm.cc | 21 ++++++++++++++++++--- lily/all-font-metrics.cc | 19 ++++++++++++++++++- lily/include/afm.hh | 3 ++- lily/include/tfm.hh | 5 +++-- 6 files changed, 86 insertions(+), 8 deletions(-) diff --git a/CHANGES b/CHANGES index 8f22b24788..6e3fa7d01a 100644 --- 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. diff --git a/buildscripts/mf-to-table.py b/buildscripts/mf-to-table.py index 4c87408117..1dfb64f4e2 100644 --- a/buildscripts/mf-to-table.py +++ b/buildscripts/mf-to-table.py @@ -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]) diff --git a/lily/afm.cc b/lily/afm.cc index 1745b683a3..b9224648be 100644 --- a/lily/afm.cc +++ b/lily/afm.cc @@ -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); } diff --git a/lily/all-font-metrics.cc b/lily/all-font-metrics.cc index 3a8b325a68..fd34ea57a2 100644 --- a/lily/all-font-metrics.cc +++ b/lily/all-font-metrics.cc @@ -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 (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 (unsmob_metrics (val)); diff --git a/lily/include/afm.hh b/lily/include/afm.hh index 79d7461f98..73f2268a1d 100644 --- a/lily/include/afm.hh +++ b/lily/include/afm.hh @@ -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 ascii_to_metric_idx_; Dictionary name_to_metric_dict_; diff --git a/lily/include/tfm.hh b/lily/include/tfm.hh index 22e17c87cd..068ca68ae2 100644 --- a/lily/include/tfm.hh +++ b/lily/include/tfm.hh @@ -155,13 +155,14 @@ public: String str () const; -private: - Tex_font_metric (); + Tfm_info info_; Tfm_header header_; Array char_metrics_; Array ascii_to_metric_idx_; +private: + Tex_font_metric (); }; -- 2.39.5