]> git.donarmstrong.com Git - lilypond.git/commitdiff
*** empty log message ***
authorJan Nieuwenhuizen <janneke@gnu.org>
Fri, 13 Aug 2004 15:53:22 +0000 (15:53 +0000)
committerJan Nieuwenhuizen <janneke@gnu.org>
Fri, 13 Aug 2004 15:53:22 +0000 (15:53 +0000)
20 files changed:
ChangeLog
lily/book-paper-def.cc
lily/dynamic-engraver.cc
lily/font-metric.cc
lily/font-select.cc
lily/include/modified-font-metric.hh [new file with mode: 0644]
lily/include/scaled-font-metric.hh [deleted file]
lily/lily-parser.cc
lily/modified-font-metric.cc
lily/paper-book.cc
lily/parser.yy
lily/script-engraver.cc
lily/text-item.cc
ly/book-paper-defaults.ly
ly/declarations-init.ly
scm/encoding.scm
scm/framework-ps.scm
scm/lily.scm
scripts/ps2png.py
tex/latin1.enc

index 097dd6d9d741675c112fca34d883c37d4f67f94d..488fa46b0e5d597bbc667725fc86ea65a58b5102 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,28 @@
+2004-08-13  Jan Nieuwenhuizen  <janneke@gnu.org>
+
+       * lily.scm: Mark un-internationlised user messages (with FIXME).
+
+       * lily/include/modified-font-metric.hh (struct
+       Modified_font_metric): New file.  (WAS: incorrectly named
+       scaled-font-metric.hh ?)
+
+       * lily/include/scaled-font-metric.hh: Remove.
+
+       * lily/text-item.cc (interpret_string): Identify and document
+       input-encoding problem.
+
+       * lily/paper-book.cc (pages): Do not use `paper' as variable name
+       for a Bookpaper.
+
+       * tex/latin1.enc: Replace /minus with /hyphen.  WL says that's the
+       latin1 name.
+
+       * scm/encoding.scm: For latin1 (input-)encoding, use
+       latin1.  (Cork.enc is NOT latin1 -- see man latin1).
+
+       * ly/book-paper-defaults.ly: Add a comment about suspicious TeX
+       inputencoding.
+
 2004-08-12  Heikki Junes  <hjunes@cc.hut.fi>
 
        * Documentation/topdocs/INSTALL.html: fixes.
index 0dfe5fb1514b75a78427a57bcad4cefb0aea15e4..d2ca7103f0a010c857567a3bd9cd34f948d1a4ff 100644 (file)
@@ -10,7 +10,7 @@
 #include "font-metric.hh"
 #include "ly-module.hh"
 #include "output-def.hh"
-#include "scaled-font-metric.hh"
+#include "modified-font-metric.hh"
 #include "virtual-font-metric.hh"
 
 Real
index 16a0a75f5668a1cd9f6d8296c4edbd832579b9f8..95e2c7df2997a5f7d3dc390b621bfb8d53777800 100644 (file)
@@ -313,6 +313,13 @@ Dynamic_engraver::finalize ()
 void
 Dynamic_engraver::typeset_all ()
 {
+  /* Simplistic slur collision handling.  This fixes simple collisions
+     like
+     
+         a\p( b)
+
+     which are unacceptable, but it most probably breaks for more
+     interesting cases.  Maybe make a new colission engraver.  */
   if (finished_line_spanner_ && slur_
       && get_slur_dir (slur_) == get_grob_direction (finished_line_spanner_))
     {
index 9af80e57387275317987361f05cc07388dde4317..6c61e77fb32b79093180b2d13cb985cc33fce3a3 100644 (file)
@@ -6,12 +6,12 @@
   (c) 1999--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 
     Mats Bengtsson <matsb@s3.kth.se> (the ugly TeX parsing in text_dimension)
- */
+*/
 
 #include <math.h>
 #include <ctype.h>
 
-#include "scaled-font-metric.hh"
+#include "modified-font-metric.hh"
 #include "virtual-methods.hh"
 #include "warn.hh"
 #include "stencil.hh"
index ef6ab87107799b7cf3f0f90359c2b257154cb821..f04da901b3d63d2d2db02a4cbe3a60b82541b6b7 100644 (file)
 #include "warn.hh"
 
 LY_DEFINE (ly_paper_get_font, "ly:paper-get-font", 2, 0, 0,
-          (SCM paper, SCM chain),
+          (SCM paper_smob, SCM chain),
 
           "Return a font metric satisfying the font-qualifiers "
           "in the alist chain @var{chain}.\n"
-          "(An alist chain is a list of alists, containing grob properties).\n")
+          "(An alist chain is a list of alists, "
+          "containing grob properties).\n")
 {
-  Output_def *pap = unsmob_output_def (paper);
-  SCM_ASSERT_TYPE (pap, paper, SCM_ARG1, __FUNCTION__, "paper definition");
+  Output_def *paper = unsmob_output_def (paper_smob);
+  SCM_ASSERT_TYPE (paper, paper_smob, SCM_ARG1,
+                  __FUNCTION__, "paper definition");
   
-  Font_metric *fm = select_font (pap, chain);
+  Font_metric *fm = select_font (paper, chain);
   return fm->self_scm ();
 }
 
 LY_DEFINE (ly_paper_get_number, "ly:paper-get-number", 2, 0, 0,
-          (SCM paper, SCM name),
+          (SCM paper_smob, SCM name),
           "Return the paper variable @var{name}.")
 {
-  Output_def *pap = unsmob_output_def (paper);
-  SCM_ASSERT_TYPE (pap, paper, SCM_ARG1, __FUNCTION__, "paper definition");
-  return scm_make_real (pap->get_dimension (name));
+  Output_def *paper = unsmob_output_def (paper_smob);
+  SCM_ASSERT_TYPE (paper, paper_smob, SCM_ARG1,
+                  __FUNCTION__, "paper definition");
+  return scm_make_real (paper->get_dimension (name));
 }
 
 bool
 wild_compare (SCM field_val, SCM val)
 {
-  return (val == SCM_BOOL_F || field_val == ly_symbol2scm ("*") || field_val == val);
+  return (val == SCM_BOOL_F
+         || field_val == ly_symbol2scm ("*")
+         || field_val == val);
 }
 
-
 /*
   TODO: this triggers a great number of font-loads (feta11 upto
   parmesan23). We could make a Delayed_load_font_metric for which the
   design size is specced in advance.
  */
-Font_metric*
-get_font_by_design_size (Output_defpaper, Real requested,
-                        SCM font_vector, SCM input_encoding_name)
+Font_metric *
+get_font_by_design_size (Output_def *paper, Real requested,
+                        SCM font_vector, SCM input_encoding)
 {
   int n = SCM_VECTOR_LENGTH (font_vector);
   Real size = 1e6;
@@ -66,50 +70,45 @@ get_font_by_design_size (Output_def* paper, Real requested,
       size = fm->design_size ();
       
       if (size > requested)
-       break ;
+       break;
       last_size = size; 
     }
 
   if (i == n)
-    {
-      i = n-1;
-    }
+    i = n - 1;
   else if (i > 0)
     {
       if ((requested / last_size) < (size / requested))
        {
-         i -- ;
+         i--;
          size = last_size;
        }
     }
 
-  Font_metric *fm = unsmob_metrics (scm_force (SCM_VECTOR_REF (font_vector, i)));
-  return
-    find_scaled_font (paper, fm, requested / size, input_encoding_name);
+  Font_metric *fm = unsmob_metrics (scm_force (SCM_VECTOR_REF (font_vector,
+                                                              i)));
+  return find_scaled_font (paper, fm, requested / size, input_encoding);
 
 }
 
-
 Font_metric*
-get_font_by_mag_step (Output_def* paper, Real requested_step,
-                     SCM font_vector, Real default_size, SCM input_encoding_name)
+get_font_by_mag_step (Output_def *paper, Real requested_step,
+                     SCM font_vector, Real default_size,
+                     SCM input_encoding)
 {
-  return get_font_by_design_size (paper,
-                                 default_size * pow (2.0, requested_step / 6.0),
-                                 font_vector, input_encoding_name);
+  return get_font_by_design_size (paper, default_size
+                                 * pow (2.0, requested_step / 6.0),
+                                 font_vector, input_encoding);
 }
 
-
-
 SCM
 properties_to_font_size_family (SCM fonts, SCM alist_chain)
 {
   return scm_call_2 (ly_scheme_function ("lookup-font"), fonts, alist_chain);
 }
 
-
 Font_metric *
-select_encoded_font (Output_def *paper, SCM chain, SCM encoding_name)
+select_encoded_font (Output_def *paper, SCM chain, SCM input_encoding)
 {
   SCM name = ly_assoc_chain (ly_symbol2scm  ("font-name"), chain);
   
@@ -119,18 +118,17 @@ select_encoded_font (Output_def *paper, SCM chain, SCM encoding_name)
       name = properties_to_font_size_family (fonts, chain);
     }
   else
-    name  = ly_cdr (name);
+    name = ly_cdr (name);
 
   if (ly_c_string_p (name))
     {
       SCM mag = ly_assoc_chain (ly_symbol2scm ("font-magnification"), chain);
-  
-      Real rmag = ly_c_pair_p (mag) ? robust_scm2double (ly_cdr (mag), 1.0) : 1;
-
-      Font_metric * fm = all_fonts_global->find_font (ly_scm2string (name));
-      
-      
-      return find_scaled_font (paper, fm, rmag, encoding_name);
+      Real rmag = (ly_c_pair_p (mag)
+                  ? robust_scm2double (ly_cdr (mag), 1.0)
+                  : 1);
+      Font_metric *fm = all_fonts_global->find_font (ly_scm2string (name));
+                  
+      return find_scaled_font (paper, fm, rmag, input_encoding);
     }
   else if (scm_instance_p (name))
     {
@@ -138,16 +136,15 @@ select_encoded_font (Output_def *paper, SCM chain, SCM encoding_name)
       SCM vec = scm_slot_ref (name, ly_symbol2scm ("size-vector"));
       
       SCM font_size = ly_assoc_chain (ly_symbol2scm ("font-size"), chain);
-      Real req = 0.0;
+      Real req = 0;
       if (ly_c_pair_p (font_size))
        req = ly_scm2double (ly_cdr (font_size));
 
-      return get_font_by_mag_step (paper, req,
-                                  vec, ly_scm2double (base_size), encoding_name);
+      return get_font_by_mag_step (paper, req, vec, ly_scm2double (base_size),
+                                  input_encoding);
     }
 
   assert (0);
-
   return 0;
 }
 
diff --git a/lily/include/modified-font-metric.hh b/lily/include/modified-font-metric.hh
new file mode 100644 (file)
index 0000000..9f264e7
--- /dev/null
@@ -0,0 +1,51 @@
+/*   
+  modified-font-metric.hh -- declare Font_metric
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 1999--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+#ifndef MODIFIED_FONT_METRIC_HH
+#define MODIFIED_FONT_METRIC_HH
+
+#include "font-metric.hh"
+
+/* Perhaps junk this, and move this to paper_def as interface? */
+struct Modified_font_metric : public Font_metric
+{
+public:
+  Box text_dimension (String);
+  
+  
+  static SCM make_scaled_font_metric (SCM, Font_metric*, Real);
+  virtual int count () const;
+  virtual Offset get_indexed_wxwy (int) const;
+  virtual int name_to_index (String) const;
+  virtual String coding_scheme () const;
+
+  virtual Font_metric * original_font () const;  
+
+protected:
+  
+  SCM coding_vector_;
+  SCM coding_table_;
+  SCM coding_mapping_;
+  SCM coding_description_;
+  friend SCM ly_font_encoding_alist (SCM);
+    
+  virtual Real design_size () const;
+  virtual void derived_mark () const; 
+  virtual Box get_indexed_char (int) const;
+  virtual int index_to_ascii (int) const;
+  virtual Box get_ascii_char (int) const;
+  Font_metric *orig_;
+  Real magnification_;
+  String coding_scheme_;
+
+  
+  Modified_font_metric (String, Font_metric*, Real);
+  Box tex_kludge (String) const;
+};
+
+#endif /* MODIFIED_FONT_METRIC_HH */
diff --git a/lily/include/scaled-font-metric.hh b/lily/include/scaled-font-metric.hh
deleted file mode 100644 (file)
index 5c9a048..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*   
-  scaled-font-metric.hh -- declare Font_metric
-  
-  source file of the GNU LilyPond music typesetter
-  
-  (c) 1999--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
-
-#ifndef SCALED_FONT_METRIC_HH
-#define SCALED_FONT_METRIC_HH
-
-#include "font-metric.hh"
-
-/* Perhaps junk this, and move this to paper_def as interface? */
-struct Modified_font_metric : public Font_metric
-{
-public:
-  Box text_dimension (String);
-  
-  
-  static SCM make_scaled_font_metric (SCM, Font_metric*, Real);
-  virtual int count () const;
-  virtual Offset get_indexed_wxwy (int) const;
-  virtual int name_to_index (String) const;
-  virtual String coding_scheme () const;
-
-  virtual Font_metric * original_font () const;  
-
-protected:
-  
-  SCM coding_vector_;
-  SCM coding_table_;
-  SCM coding_mapping_;
-  SCM coding_description_;
-  friend SCM ly_font_encoding_alist (SCM);
-    
-  virtual Real design_size () const;
-  virtual void derived_mark () const; 
-  virtual Box get_indexed_char (int) const;
-  virtual int index_to_ascii (int) const;
-  virtual Box get_ascii_char (int) const;
-  Font_metric *orig_;
-  Real magnification_;
-  String coding_scheme_;
-
-  
-  Modified_font_metric (String, Font_metric*, Real);
-  Box tex_kludge (String) const;
-};
-
-#endif /* SCALED_FONT_METRIC_HH */
index 3b106602b13ed36c45441077c0600de839c17dfb..c489c356f2982e5220af812f60767fcce6d04601 100644 (file)
@@ -29,7 +29,7 @@ Lily_parser::Lily_parser (Sources *sources)
   score_count_ = 0;
   lexer_ = 0;
   sources_ = sources;
-  default_duration_ = Duration (2,0);
+  default_duration_ = Duration (2, 0);
   error_level_ = 0;
   last_beam_start_ = SCM_EOL;
 
@@ -118,7 +118,10 @@ Lily_parser::parse_file (String init, String name, String out_name)
 void
 Lily_parser::parse_string (String ly_code)
 {
+#if 0
   SCM parent_prot = lexer_ ? lexer_->self_scm () : SCM_EOL;
+#endif
+
   Lily_lexer * parent = lexer_;
   lexer_ = (parent == 0 ? new Lily_lexer (sources_)
            : new Lily_lexer (*parent));
index 547756b1f464044d2ba695a18f12a2acc1133b75..875c87ef0cfb756d03e5912ece5da6ff3d5b25c1 100644 (file)
@@ -1,27 +1,35 @@
 /*
-  scaled-font-metric.cc -- declare Modified_font_metric
+  modified-font-metric.cc -- declare Modified_font_metric
   
   source file of the GNU LilyPond music typesetter
   
   (c) 1999--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include <ctype.h>
 
 #include "warn.hh"
-#include "scaled-font-metric.hh"
+#include "modified-font-metric.hh"
 #include "string.hh"
 #include "stencil.hh"
 
-Modified_font_metric::Modified_font_metric (String coding, Font_metric* m, Real magn)
+Modified_font_metric::Modified_font_metric (String input_encoding,
+                                           Font_metric *m, Real magn)
 {
+  /* UGR, FIXME:
+
+     THIS.coding_scheme == input encoding.
+     ORIG.coding_scheme () == font_encoding.
+
+     encoding is hairy enough by itself, should fix treacherous naming.   */
+  
+  coding_scheme_ = input_encoding;
+
   coding_vector_ = SCM_EOL;
   coding_mapping_ = SCM_EOL;
   coding_table_ = SCM_EOL;
   coding_description_ = SCM_EOL;
   
-  coding_scheme_ = coding;
   magnification_ = magn;
   
   SCM desc = m->description_;
@@ -37,8 +45,9 @@ Modified_font_metric::Modified_font_metric (String coding, Font_metric* m, Real
       && coding_scheme_ != "ASCII"
       && coding_scheme_ !=  orig_->coding_scheme ())
     {
-      coding_vector_ = scm_call_1 (ly_scheme_function ("get-coding-vector"),
-                                  scm_makfrom0str (coding_scheme_.to_str0 ()));
+      coding_vector_
+       = scm_call_1 (ly_scheme_function ("get-coding-vector"),
+                     scm_makfrom0str (coding_scheme_.to_str0 ()));
 
       if (!ly_c_vector_p (coding_vector_))
        {
@@ -46,29 +55,35 @@ Modified_font_metric::Modified_font_metric (String coding, Font_metric* m, Real
          coding_vector_ = scm_c_make_vector (256, ly_symbol2scm (".notdef"));
        }
 
-      
-      coding_table_ = scm_call_1 (ly_scheme_function ("get-coding-table"),
-                                 scm_makfrom0str (orig_->coding_scheme ().to_str0 ()));
-         
-      coding_mapping_  = scm_call_2 (ly_scheme_function ("make-encoding-mapping"),
-                                        coding_vector_,
-                                        coding_table_);
-
-      coding_description_= SCM_EOL;
-      coding_description_ = scm_acons (ly_symbol2scm ("input-name"),
-                                      scm_makfrom0str (coding_scheme_.to_str0 ()),
-                                      coding_description_);
-      coding_description_ = scm_acons (ly_symbol2scm ("input-vector"),
-                                      coding_vector_, coding_description_);
-      coding_description_ = scm_acons (ly_symbol2scm ("output-name"),
-                                      scm_makfrom0str (orig_->coding_scheme ().to_str0 ()),
-                                      coding_description_);
-      coding_description_ = scm_acons (ly_symbol2scm ("output-table"),
-                                      coding_table_,
-                                      coding_description_);
-      coding_description_ = scm_acons (ly_symbol2scm ("char-mapping"),
-                                      coding_mapping_,
-                                      coding_description_);
+      coding_table_
+       = scm_call_1 (ly_scheme_function ("get-coding-table"),
+                     scm_makfrom0str (orig_->coding_scheme ().to_str0 ()));
+
+      coding_mapping_
+       = scm_call_2 (ly_scheme_function ("make-encoding-mapping"),
+                     coding_vector_,
+                     coding_table_);
+
+      coding_description_ = SCM_EOL;
+      coding_description_
+       = scm_acons (ly_symbol2scm ("input-name"),
+                    scm_makfrom0str (coding_scheme_.to_str0 ()),
+                    coding_description_);
+      coding_description_
+       = scm_acons (ly_symbol2scm ("input-vector"),
+                    coding_vector_, coding_description_);
+      coding_description_
+       = scm_acons (ly_symbol2scm ("output-name"),
+                    scm_makfrom0str (orig_->coding_scheme ().to_str0 ()),
+                    coding_description_);
+      coding_description_
+       = scm_acons (ly_symbol2scm ("output-table"),
+                    coding_table_,
+                    coding_description_);
+      coding_description_
+       = scm_acons (ly_symbol2scm ("char-mapping"),
+                    coding_mapping_,
+                    coding_description_);
     } 
 }
 
@@ -89,7 +104,8 @@ LY_DEFINE (ly_font_encoding_alist, "ly:font-encoding-alist",
 }
 
 SCM
-Modified_font_metric::make_scaled_font_metric (SCM coding, Font_metric *m, Real s)
+Modified_font_metric::make_scaled_font_metric (SCM coding,
+                                              Font_metric *m, Real s)
 {
   /*
     UGH.
@@ -167,43 +183,39 @@ Modified_font_metric::derived_mark () const
   scm_gc_mark (coding_mapping_);
 }
 
+/* TODO: put this klutchness behind ly:option switch.  */  
 Box
 Modified_font_metric::tex_kludge (String text) const
 {
   Interval ydims;
-  Real w=0.0;
-
-  /*
-    TODO: put this klutchness behind ly:option switch.
-  */  
+  Real w = 0;
   for (int i = 0; i < text.length (); i++) 
     {
       switch (text[i]) 
        {
        case '\\':
-         // accent marks use width of base letter
+         /* Accent marks use width of base letter */
          if (i +1 < text.length ())
           {
-            if (text[i+1]=='\'' || text[i+1]=='`' || text[i+1]=='"' ||
-                text[i+1]=='^')
+            if (text[i+1]=='\'' || text[i+1]=='`' || text[i+1]=='"'
+                || text[i+1]=='^')
               {
                 i++;
                 break;
               }
-            // for string width \\ is a \ and \_ is a _.
+            /* For string width \\ is a \ and \_ is a _. */
             if (text[i+1]=='\\' || text[i+1]=='_')        
-              {
                 break;
-              }
           }
          
          for (i++; (i < text.length ()) && !isspace (text[i]) 
                 && text[i]!='{' && text[i]!='}'; i++)
            ;
          
-         // ugh.
-         i--; // Compensate for the increment in the outer loop!
+         /* Compensate for the auto-increment in the outer loop. */
+         i--;
          break;
+
        case '{':  // Skip '{' and '}'
        case '}':
          break;
@@ -211,7 +223,7 @@ Modified_font_metric::tex_kludge (String text) const
        default: 
          Box b = get_ascii_char ((unsigned char)text[i]);
          
-         // Ugh, use the width of 'x' for unknown characters
+         /* Use the width of 'x' for unknown characters */
          if (b[X_AXIS].length () == 0) 
            b = get_ascii_char ((unsigned char)'x');
          
@@ -232,9 +244,7 @@ Modified_font_metric::text_dimension (String text)
 {
   Box b; 
   if (coding_scheme_ == "TeX")
-    {
-      b = tex_kludge (text);
-    }
+    b = tex_kludge (text);
   else if (coding_scheme_ == "ASCII"
           || coding_scheme_ == "" 
           || coding_scheme_ ==  orig_->coding_scheme ())
@@ -274,13 +284,12 @@ Modified_font_metric::text_dimension (String text)
          
          int idx = orig_->name_to_index (chars);
          if (idx >= 0)
-           {
-             char_box = orig_->get_indexed_char (idx);
-           }
+           char_box = orig_->get_indexed_char (idx);
          
          char_box.scale (magnification_);
          if (!char_box[X_AXIS].is_empty ())
-           w += char_box[X_AXIS][RIGHT]; // length ?
+           /* length ? */
+           w += char_box[X_AXIS][RIGHT];
 
          ydims.unite (char_box[Y_AXIS]);
        }
@@ -288,7 +297,6 @@ Modified_font_metric::text_dimension (String text)
       if (ydims.is_empty ())
        ydims = Interval (0, 0);
 
-         
       b = Box (Interval (0, w), ydims);
     }
   
index 6121bf89461d8981257effd3ca872bc6203bef44..2f4ba4d82107bbb605de54db903447168e4fb8e9 100644 (file)
@@ -401,8 +401,7 @@ Paper_book::pages ()
     return pages_;
 
   pages_ = SCM_EOL;
-  Output_def *paper = bookpaper_;
-  SCM proc = paper->c_variable ("page-breaking");
+  SCM proc = bookpaper_->c_variable ("page-breaking");
   pages_ = scm_apply_0 (proc, scm_list_2 (lines (), self_scm ()));
   return pages_;
 }
index 0c9f9e54408b7f30139888559617555a10849453..085aca71c6ad04756869bb68120a174ff635eb85 100644 (file)
@@ -753,7 +753,7 @@ output_def_head:
                THIS->lexer_->add_scope (p->scope_);
        }
        | PAPER         {
-               Output_defp = get_paper (THIS);
+               Output_def *p = get_paper (THIS);
 
                if (p->parent_)
                        THIS->lexer_->add_scope (p->parent_->scope_);
index 4550fc7a3b208cd14edf823ddabff2180649c845..45fbb9d71c1839aff1820081b8cb925b40ba14a8 100644 (file)
@@ -214,6 +214,18 @@ Script_engraver::stop_translation_timestep ()
                                     ::quantised_position_proc, Y_AXIS);
            sc->set_property ("staff-padding", SCM_EOL);
          }
+       
+       /* Simplistic slur collision handling.  This fixes simple collisions
+          like
+          
+          a_\upbow( b)
+          
+          but it most probably breaks for more interesting cases.
+          Maybe make a new colission engraver.
+
+          
+          Assume that a SCRIPT that should collide with SLUR does not
+          have a negative priority. */
        SCM priority = sc->get_property ("script-priority");
        if (robust_scm2int (priority, 0) >= 0
            && slur_
index 10fdc67ec0fa7783d9568d811bf2da7fb8a653a0..b88ad73280b9027fce9213031dc22b8788568e5b 100644 (file)
@@ -4,8 +4,9 @@
   source file of the GNU LilyPond music typesetter
   
   (c) 1998--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  Jan Nieuwenhuizen <janneke@gnu.org>
- */
+                 Jan Nieuwenhuizen <janneke@gnu.org>
+*/
+
 #include <math.h>
 
 #include "warn.hh"
 #include "font-interface.hh"
 #include "virtual-font-metric.hh"
 #include "output-def.hh"
-#include "scaled-font-metric.hh"
+#include "modified-font-metric.hh"
 #include "ly-module.hh"
 
 MAKE_SCHEME_CALLBACK (Text_item, interpret_string, 4)
 SCM
-Text_item::interpret_string (SCM paper, SCM props, SCM encoding, SCM markup)
+Text_item::interpret_string (SCM paper_smob,
+                            SCM props, SCM input_encoding, SCM markup)
 {
-  Output_def *pap = unsmob_output_def (paper);
+  Output_def *paper = unsmob_output_def (paper_smob);
   
-  SCM_ASSERT_TYPE(pap, paper, SCM_ARG1, __FUNCTION__, "Paper definition");
-  SCM_ASSERT_TYPE(ly_c_string_p (markup), markup, SCM_ARG3, __FUNCTION__, "string");
-  SCM_ASSERT_TYPE(encoding == SCM_EOL
-                 || ly_c_symbol_p (encoding), encoding, SCM_ARG2, __FUNCTION__, "symbol");
+  SCM_ASSERT_TYPE (paper, paper_smob, SCM_ARG1,
+                  __FUNCTION__, "Paper definition");
+  SCM_ASSERT_TYPE (ly_c_string_p (markup), markup, SCM_ARG3,
+                  __FUNCTION__, "string");
+  SCM_ASSERT_TYPE (input_encoding == SCM_EOL || ly_c_symbol_p (input_encoding),
+                  input_encoding, SCM_ARG2, __FUNCTION__, "symbol");
   
   String str = ly_scm2string (markup);
-  if (!ly_c_symbol_p (encoding))
+  if (!ly_c_symbol_p (input_encoding))
     {
-      SCM var = ly_module_lookup (pap->scope_,
+      /* FIXME: input_encoding is set in *book*_paper
+
+         Options include:
+        
+         1. produce a bookpaper from a paper.
+        2. add BOOKPAPER parameter to all callers, ie, all MARKUPs.  */
+      
+      programming_error ("FIXME: looking up input_encoding in paper");
+      programming_error ("as a workaround, set inputencoding in your \\paper block");
+      SCM var = ly_module_lookup (paper->scope_,
                                  ly_symbol2scm ("inputencoding"));
       if (var != SCM_BOOL_F) 
-       encoding = scm_variable_ref (var);
+       input_encoding = scm_variable_ref (var);
       
     }
   
-  Font_metric *fm = select_encoded_font (pap, props, encoding);
+  Font_metric *fm = select_encoded_font (paper, props, input_encoding);
 
   SCM lst = SCM_EOL;      
   Box b;
@@ -63,10 +76,10 @@ Text_item::interpret_string (SCM paper, SCM props, SCM encoding, SCM markup)
 
 MAKE_SCHEME_CALLBACK (Text_item, interpret_markup, 3)
 SCM
-Text_item::interpret_markup (SCM paper, SCM props, SCM markup)
+Text_item::interpret_markup (SCM paper_smob, SCM props, SCM markup)
 {
   if (ly_c_string_p (markup))
-    return interpret_string (paper, props, SCM_EOL, markup);
+    return interpret_string (paper_smob, props, SCM_EOL, markup);
   else if (ly_c_pair_p (markup))
     {
       SCM func = ly_car (markup);
@@ -74,7 +87,7 @@ Text_item::interpret_markup (SCM paper, SCM props, SCM markup)
       if (!markup_p (markup))
        programming_error ("Markup head has no markup signature.");
       
-      return scm_apply_2 (func, paper, props, args);
+      return scm_apply_2 (func, paper_smob, props, args);
     }
   return SCM_EOL;
 }
@@ -90,22 +103,20 @@ Text_item::print (SCM grob)
   return interpret_markup (me->get_paper ()->self_scm (), chain, t);
 }
 
-
-/*
-  Ugh. Duplicated from Scheme.
- */
+/* Ugh. Duplicated from Scheme.  */
 bool
 Text_item::markup_p (SCM x)
 {
-  return
-    ly_c_string_p (x) ||
-    (ly_c_pair_p (x)
-     && SCM_BOOL_F != scm_object_property (ly_car (x), ly_symbol2scm ("markup-signature")));
+  return (ly_c_string_p (x)
+         || (ly_c_pair_p (x)
+             && SCM_BOOL_F
+             != scm_object_property (ly_car (x),
+                                     ly_symbol2scm ("markup-signature"))));
 }
 
 ADD_INTERFACE (Text_item,"text-interface",
-  "A scheme markup text, see @usermanref{Text-markup}.",
-  "text baseline-skip word-space");
+              "A scheme markup text, see @usermanref{Text-markup}.",
+              "text baseline-skip word-space");
 
 
 
index 6a415e5b11e2496cb8445f21a811280038c235cd..a3d1ced8bd7fdc87dcdec225d738d04874a54da1 100644 (file)
@@ -7,11 +7,16 @@
     pt = #(/  in 72.27)
     cm = #(* 10 mm)
 
-    inputencoding = #"TeX"
+    %% This is weird; `everyone' uses LATIN1?  How does I select TeX
+    %% input encoding in EMACS? -- jcn
+    %%%%inputencoding = #"TeX"
+    inputencoding = #"latin1"
+
     printpagenumber = ##t
-   %
-   % 20pt staff, 5 pt = 1.75 mm
-   %
+
+    %%
+    %% 20pt staff, 5 pt = 1.75 mm
+    %%
 
    outputscale = #1.7573
     
index 1ffa23fe4588535c828034022ac9700bfea0c344..ab2785d6c589a1c98f169924b069bc454d964ea7 100644 (file)
@@ -1,12 +1,18 @@
+\version "2.3.8"
+
+%% < 1.8 compatibility switch
 #(ly:set-option 'old-relative)
 
-\version "2.3.8"
+%% named durations
 breve = #(ly:make-duration -1 0)
 longa = #(ly:make-duration -2 0 )
 maxima = #(ly:make-duration -3 0)
 
 \include "music-functions-init.ly"
-\include "nederlands.ly"               % dutch
+
+%% default note names are dutch
+\include "nederlands.ly"
+
 \include "drumpitch-init.ly"           
 \include "chord-modifiers-init.ly"
 \include "script-init.ly"
@@ -20,46 +26,41 @@ start = -1
 stop = 1
 smaller = -1
 bigger = 1
-center=0
-
-%{
-
-should also set allowBeamBreak, but how to do it "portably"? (ie. also
-working with lyric sections)
+center = 0
 
-try \once \set Score.allowBeamBreak = ##t
-
-%}
+%% FIXME
+%% should also set allowBeamBreak, but how to do it "portably"? (ie. also
+%% working with lyric sections)
+%%
+%% try \once \set Score.allowBeamBreak = ##t
 
 %% rather name \newline, \newpage ?
 break = #(make-event-chord (list (make-penalty-music -10001 0)))
 noBreak = #(make-event-chord (list (make-penalty-music 10001 0)))
 pageBreak = #(make-event-chord (list (make-penalty-music -10001 -10001)))
-pagebreak = \pageBreak % ugh.
 noPageBreak = #(make-event-chord (list (make-penalty-music 0 10001)))
-noPagebreak = \noPageBreak % ugh
+
+%% why these defines?
+pagebreak = \pageBreak
+noPagebreak = \noPageBreak
 
 noBeam = #(make-music 'BeamForbidEvent) 
 pipeSymbol = #(make-music 'BarCheck)
 
-foo =  { \pageBreak }
+foo = { \pageBreak }
 
 \include "scale-definitions-init.ly"
 
-
 melisma = #(make-span-event 'ManualMelismaEvent START)
 melismaEnd = #(make-span-event 'ManualMelismaEvent STOP)
 
 \include "grace-init.ly"
-
-% ugh
 \include "midi-init.ly"
-
 \include "book-paper-defaults.ly"
 
 \paper {
-    mm = #(ly:output-def-lookup $defaultbookpaper  'mm)
-    unit = #(ly:output-def-lookup $defaultbookpaper  'unit)
+    mm = #(ly:output-def-lookup $defaultbookpaper 'mm)
+    unit = #(ly:output-def-lookup $defaultbookpaper 'unit)
 
     in = #(* 25.4 mm)
     pt = #(/  in 72.27)
@@ -73,27 +74,25 @@ melismaEnd = #(make-span-event 'ManualMelismaEvent STOP)
 
 
 partCombineListener = \paper {
- \context {
-         \Voice
-         \consists Note_heads_engraver
-         \consists Rest_engraver
-         \type "Recording_group_engraver"
-         recordEventSequence = #notice-the-events-for-pc
- }
- \context { \Score skipTypesetting = ##t }
   \context {
+       \Voice
+       \consists Note_heads_engraver
+       \consists Rest_engraver
+       \type "Recording_group_engraver"
+       recordEventSequence = #notice-the-events-for-pc
   }
   \context { \Score skipTypesetting = ##t }
 }
 
 #(set-part-combine-listener partCombineListener)
 
 \include "dynamic-scripts-init.ly"
 \include "spanners-init.ly"
-
 \include "property-init.ly"
 
-%% reset default duration
-unusedEntry =  { c4 }
+setDefaultDurationToQuarter = { c4 }
 
-%% must have size argument for GUILE 1.6 compat.
+%% MAKE-HASH-TABLE in GUILE 1.6 takes mandatory size parameter.
 #(define musicQuotes (make-hash-table 29))
 
 #(define toplevel-book-handler ly:parser-print-book)
index 6332a0688475a1c62454450c3a46b9eda6e6ce05..9c2b9906f3840e09cd2f7cee876d404c97a25468 100644 (file)
@@ -74,7 +74,7 @@ vector of symbols."
               (cons (cdr x) (delay (get-coding-from-file (cdr x))))))
        
        '(
-        ;; teTeX
+        ;; teTeX font (output) encodings
         ("TeX-typewriter-text" . "09fbbfac.enc") ;; cmtt10
         ("TeX-math-symbols" . "10037936.enc") ;; cmbsy
         ("ASCII-caps-and-digits" . "1b6d048e.enc") ;; cminch
@@ -84,15 +84,15 @@ vector of symbols."
         ("TeX-text-without-f-ligatures" . "0ef0afca.enc")
         ("Extended-TeX-Font-Encoding---Latin" . "tex256.enc")
         ("AdobeStandardEncoding" . "8a.enc")
-
-        ;; aliases
         ("T1" . "tex256.enc")
         ("adobe" . "8a.enc")
-        ;;("latin1" . "latin1.enc")
-        ("latin1" . "cork.enc")
         ("ec" . "EC.enc")
         
-        ;; LilyPond.
+        ;; input encodings
+        ("latin1" . "latin1.enc")
+        ("cork" . "cork.enc")
+
+        ;; LilyPond FETA music font
         ("fetaBraces" . "feta-braces-a.enc")
         ("fetaNumber" . "feta-nummer10.enc")
         ("fetaMusic" . "feta20.enc")
index 9d7045fd79693026646bc54a8ea2a86305cb5b7c..5edbb4be20879b0437474d4d8f02908bb38db710 100644 (file)
             (srfi srfi-13)
             (lily))
 
+(define (stderr string . rest)
+  (apply format (cons (current-error-port) (cons string rest)))
+  (force-output (current-error-port)))
+
+;;(define pdebug stderr)
+(define (pdebug . rest) #f)
+
 (define mm-to-bigpoint
   (/ 72 25.4))
 
         (pfas (map
                (lambda (x)
                
-               (let*
-                   ((aname (string-append x ".pfa"))
-                    (apath (ly:kpathsea-expand-path aname))
-
-                    (bpath (if (not apath)
-                               (ly:kpathsea-expand-path (string-append x ".pfb"))
-                               #f)))
-                    
-                           
-                 (cond
-                  (apath (ly:gulp-file apath))
-                  (bpath (ly:pfb->pfa bpath))
-                  (else
-                   (ly:warn "Can't find PFA font ~S" x)
-                   ""))))
+                 (let* ((aname (string-append x ".pfa"))
+                        (apath (ly:kpathsea-expand-path aname))
+                        
+                        (bpath (if (not apath)
+                                   (ly:kpathsea-expand-path
+                                    (string-append x ".pfb"))
+                                   #f)))
+                   (cond
+                    (apath (ly:gulp-file apath))
+                    (bpath (ly:pfb->pfa bpath))
+                    (else
+                     (ly:warn "Can't find PFA font ~S" x)
+                     ""))))
                (filter string? font-names))))
   
     (string-join pfas "\n")))
           (ops (ly:output-def-lookup bookpaper 'outputscale))
           (scaling (* ops magnification designsize)))
 
+      ;; debugging: [output]encoding is broken
+      ;; found so far: coding-alist is empty!
+      (pdebug "font: ~S\n" font)
+      (pdebug "fontname: ~S\n" fontname)
+      (pdebug "input-encoding:~S\n" input-encoding)
+      (pdebug "font-encoding:~S\n" font-encoding)
+
+      (pdebug "coding-alist:~S\n" coding-alist)
+      
       (string-append
        (define-font plain fontname scaling)
        (if (equal? input-encoding font-encoding)
         (encodings (uniq-list (sort-list (filter string? encoding-list)
                                          string<?))))
 
+    (pdebug "encodings:~S\n" encodings)
     (string-append
      (apply string-append (map font-load-encoding encodings))
      (apply string-append
      (value->string (ly:output-def-lookup paper ly-key)) " def \n"))
 
   (string-append
-   "/lily-output-units " (number->string mm-to-bigpoint) "  def  %% milimeter \n"
+   "/lily-output-units " (number->string mm-to-bigpoint) " def %% milimeter \n"
    (output-entry "staff-line-thickness" 'linethickness)
    (output-entry "line-width" 'linewidth)
    (output-entry "paper-size" 'papersize)
 (define (eps-header bookpaper bbox)
   (string-append "%!PS-Adobe-2.0 EPSF-2.0\n"
                 "%%Creator: creator time-stamp\n"
-                "%%BoundingBox: " (string-join (map number->string  bbox) " ") "\n"
+                "%%BoundingBox: "
+                (string-join (map number->string bbox) " ") "\n"
                 "%%EndComments\n"))
 
 (define (page-header bookpaper page-count)
                 "%%Creator: creator time-stamp\n"
                 "%%Pages: " (number->string page-count) "\n"
                 "%%PageOrder: Ascend\n"
-                "%%DocumentPaperSizes: " (ly:output-def-lookup bookpaper 'papersize) "\n"))
+                "%%DocumentPaperSizes: "
+                (ly:output-def-lookup bookpaper 'papersize) "\n"))
 
 (define (preamble bookpaper)
   (list
         (systems (ly:paper-book-lines book))
         (scale  (ly:output-def-lookup bookpaper 'outputscale ))
         (titles (take-while ly:paper-system-title? systems))
-        (non-title (find (lambda (x) (not (ly:paper-system-title? x))) systems))
+        (non-title (find (lambda (x)
+                           (not (ly:paper-system-title? x))) systems))
         (dump-me
          (stack-stencils Y DOWN 0.0 
                          (map ly:paper-system-stencil
                            (string-append "0 0 start-system { "
                                           "set-ps-scale-to-lily-scale "
                                           "\n"))
+
   (ly:outputter-dump-stencil outputter dump-me)
   (ly:outputter-dump-string outputter "} stop-system\n%%Trailer\n%%EOF\n")))
 
 
 (define-public (convert-to-ps book name)
   #t)
-
index 07d1146b9f216b011eb0964e880bc9054acdf721..ac1f05c374e4b9c3841afa48529d2d91fcdf1a04 100644 (file)
@@ -333,7 +333,8 @@ L1 is copied, L2 not.
 
 
 (define-public (write-me message x)
-  "Return X.  Display MESSAGE and write X.  Handy for debugging, possibly turned off."
+  "Return X.  Display MESSAGE and write X.  Handy for debugging,
+possibly turned off."
   (display message) (write x) (newline) x)
 ;;  x)
 
@@ -554,24 +555,21 @@ L1 is copied, L2 not.
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
 
 (define-public (postscript->pdf papersize name)
-  (let*
-      ((cmd  (string-append "ps2pdf -sPAPERSIZE=" papersize
-                        " "
-                        name))
-       (output-name (regexp-substitute/global #f "\\.ps" name 'pre ".pdf" 'post)))
+  (let* ((cmd (string-append "ps2pdf -sPAPERSIZE=" papersize " " name))
+        (output-name
+         (regexp-substitute/global #f "\\.ps" name 'pre ".pdf" 'post)))
+
+    (newline)
+    ;; FIXME: user message: should be translated
+    (display (format "Converting to ~s..." output-name))
+    (newline)
     
+    (if (ly:get-option 'verbose)
+       ;; FIXME: user message: should be translated
+       (display (format "Invoking ~s..." cmd)))
 
-  (display
-   (string-append
-    "Converting to " output-name    "\n"))
-
-  (if (ly:get-option 'verbose)
-      (display (format "Invoking ~S" cmd)))
-  
   (system cmd)))
 
-
-
 (define-public (postscript->png resolution name)
   (let
       ((cmd (string-append
@@ -584,7 +582,10 @@ L1 is copied, L2 not.
               " ")
           name)))
     (if (ly:get-option 'verbose)
-       (display (format "Invoking `~S'\n" cmd)))
+       ;; FIXME: user message: should be translated
+       (begin
+         (display (format "Invoking ~s..." cmd))
+         (newline)))
     (system cmd)))
 
 (define-public (lilypond-main files)
@@ -601,6 +602,7 @@ L1 is copied, L2 not.
     (if (pair? failed)
        (begin
          (display
+          ;; FIXME: user message: should be translated
           (string-append "\n *** Failed files: " (string-join failed) "\n"))
          (exit 1))
        (exit 0))))
index eb1ccedc5b22d68a3db02f586820945613fe7e9b..5a1a96918345d41acd8f4f337e4c4253209010ea 100644 (file)
@@ -66,6 +66,7 @@ for opt in options:
                verbose_p = 1
 
 for f in files:
-       out = ly.make_ps_images (f, 
-                          resolution = preview_resolution)
-       sys.stderr.write (_("Written `%s'\n"  % out ))
+       out = ly.make_ps_images (f, resolution = preview_resolution)
+       ## FIXME: silly message containing %d
+       sys.stderr.write (_ ("Wrote `%s'" % out))
+       sys.stderr.write ('\n')
index 5776d009ccc7c5d3a42d293377db120e0c978928..01da1acc01ccad09cd022b6cc34c0e0c7bffe367 100644 (file)
@@ -1,6 +1,12 @@
 %!
 % Automatically generated by the Ogonkify package
-% Do not modify
+% apt-cache says that software does not exist.
+%
+% WL says:        055   45    2D    -  ==> /hyphen (NOT: /minus)
+%
+% Changed /minus to /hyphen, but I'm afraid that this will break
+% everything except for the EC* fonts --jcn
+%
 % -- code follows this line --
 %%BeginResource: encoding ISOLatin1Encoding
 /ISOLatin1Encoding [
@@ -9,7 +15,7 @@
 /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
 /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
 /space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quoteright
-/parenleft /parenright /asterisk /plus /comma /minus /period /slash
+/parenleft /parenright /asterisk /plus /comma /hyphen /period /slash
 /zero /one /two /three /four /five /six /seven
 /eight /nine /colon /semicolon /less /equal /greater /question
 % 100