]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/all-font-metrics.cc (find_font): Add "lm" to try-AFM-first
authorJan Nieuwenhuizen <janneke@gnu.org>
Sun, 21 Nov 2004 00:18:05 +0000 (00:18 +0000)
committerJan Nieuwenhuizen <janneke@gnu.org>
Sun, 21 Nov 2004 00:18:05 +0000 (00:18 +0000)
block.

* lily/font-select.cc (select_encoded_font)
(get_font_by_mag_step, get_font_by_design_size):
* lily/modified-font-metric.cc (Modified_font_metric):
* lily/paper-def.cc (find_scaled_font): Add font_encoding parameter.

* scm/encoding.scm (coding-alist): Add fetaDynamic.
(read-encoding-file): Bugfix: do not require space after bracket.

* scm/font.scm (add-cork-lm-fonts): Remove unexistent fonts.

14 files changed:
ChangeLog
input/example-2.ly
lily/all-font-metrics.cc
lily/font-select.cc
lily/include/all-font-metrics.hh
lily/include/guile-compatibility.hh
lily/include/kpath.hh
lily/include/modified-font-metric.hh
lily/include/output-def.hh
lily/kpath.cc
lily/modified-font-metric.cc
lily/paper-def.cc
scm/encoding.scm
scm/font.scm

index d44fec5bcc39dbbc0c437a674d07f4fdbee4d07d..19983b8e2af564232686b7fb77fc44f1db1ba4e1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2004-11-21  Jan Nieuwenhuizen  <janneke@gnu.org>
+
+       * lily/all-font-metrics.cc (find_font): Add "lm" to try-AFM-first
+       block.
+
+       * lily/font-select.cc (select_encoded_font)
+       (get_font_by_mag_step, get_font_by_design_size): 
+       * lily/modified-font-metric.cc (Modified_font_metric): 
+       * lily/paper-def.cc (find_scaled_font): Add font_encoding parameter.
+
+       * scm/encoding.scm (coding-alist): Add fetaDynamic.
+       (read-encoding-file): Bugfix: do not require space after bracket.
+
+       * scm/font.scm (add-cork-lm-fonts): Remove unexistent fonts.
+
 2004-11-20  Graham Percival  <gperlist@shaw.ca>
 
        * Documentation/user/notation.itely: added info about typesetting
index 8a1f59f39a3510b3f90cac03d2e11b7e96e7a73b..b2ebafb9098744cb3563a3837ffaaa7400597c5b 100644 (file)
@@ -13,5 +13,5 @@
 %% 
 
 \relative {
-  a'2 ~ a4( e8[ )e] a,16[ a a a]
+  a'2 ~ a4( e8[e] a,16[ a a a]
 }
index 62133dfde733bd5b77f1ae08729acefb001ff5cb..df523671f777794284f5bdd4ba2b794e2464da0a 100644 (file)
@@ -1,12 +1,10 @@
 /*
-  
   all-font-metrics.cc --  implement All_font_metrics
   
   source file of the GNU LilyPond music typesetter
   
   (c) 1999--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
 #include "all-font-metrics.hh"
 
@@ -159,49 +157,46 @@ All_font_metrics::find_tfm (String name)
 Font_metric*
 All_font_metrics::find_font (String name)
 {
-  if ((name.left_string (4) == "feta") ||
-      (name.left_string (8) == "parmesan"))
+  Font_metric *f = 0;
+  if ((name.left_string (4) == "feta")
+      || (name.left_string (8) == "parmesan")
+      || (name.left_string (2) == "lm"))
     {
-      Font_metric *f = find_afm (name);
-      if (f)
-       return f;
-      else
-      f =find_tfm (name);
-      if (f)
-       return f ;
+      f = find_afm (name);
+      if (!f)
+       f = find_tfm (name);
     }
   else
     {
-      Font_metric * f = find_tfm (name);
-      if (f)
-       return f;
-      else
-      f = find_afm (name);
-      if (f)
-       return f;
+      f = find_tfm (name);
+      if (!f)
+       f = find_afm (name);
     }
 
-  warning (_f ("can't find font: `%s'", name.to_str0 ()));
-  warning (_ ("Loading default font"));
+  if (!f)
+    {
+      warning (_f ("can't find font: `%s'", name.to_str0 ()));
+      warning (_ ("Loading default font"));
+    }
   
   String def_name = default_font_str0_;
 
-  /*
-    we're in emergency recovery mode here anyway, so don't try to do
-    anything smart that runs the risk of failing.  */
-  Font_metric*  f= find_afm (def_name);
-  if (f)
-    return f;
+  /* We're in emergency recovery mode here anyway, so don't try to do
+     anything smart that runs the risk of failing.  */
+  if (!f)
+    f = find_afm (def_name);
 
-  f =  find_tfm (def_name);
-  if (f)
-    return f;
+  if (!f)
+    f =  find_tfm (def_name);
 
-  error (_f ("can't find default font: `%s'", def_name.to_str0 ()));
-  error (_f ("(search path: `%s')", search_path_.to_string ()));
-  error (_ ("Giving up"));
+  if (!f)
+    {
+      error (_f ("can't find default font: `%s'", def_name.to_str0 ()));
+      error (_f ("(search path: `%s')", search_path_.to_string ()));
+      error (_ ("Giving up"));
+    }
 
-  return 0;
+  return f;
 }
 
 All_font_metrics *all_fonts_global;
index 5e40842d4c028827dc2e141ec1dba18956ca44ae..713ee93b4f1b60015fb14369a28cfe36a7e6e594 100644 (file)
@@ -1,11 +1,10 @@
-/*   
+/*
   font-select.cc -- implement property -> font_metric routines. 
 
   source file of the GNU LilyPond music typesetter
 
   (c) 2003--2004 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- */
+*/
 
 #include <cmath>
 
@@ -55,22 +54,23 @@ wild_compare (SCM field_val, SCM val)
  */
 Font_metric *
 get_font_by_design_size (Output_def *layout, Real requested,
-                        SCM font_vector, SCM input_encoding)
+                        SCM font_vector,
+                        SCM font_encoding, SCM input_encoding)
 {
   int n = SCM_VECTOR_LENGTH (font_vector);
   Real size = 1e6;
   Real last_size = -1e6;
   int i = 0;
-  
+
   for (; i < n; i++)
     {
       SCM entry = SCM_VECTOR_REF (font_vector, i);
       Font_metric *fm = unsmob_metrics (scm_force (entry));
       size = fm->design_size ();
-      
+
       if (size > requested)
        break;
-      last_size = size; 
+      last_size = size;
     }
 
   if (i == n)
@@ -86,17 +86,18 @@ get_font_by_design_size (Output_def *layout, Real requested,
 
   Font_metric *fm = unsmob_metrics (scm_force (SCM_VECTOR_REF (font_vector,
                                                               i)));
-  return find_scaled_font (layout, fm, requested / size, input_encoding);
+  return find_scaled_font (layout, fm, requested / size,
+                          font_encoding, input_encoding);
 }
 
-Font_metric*
+Font_metric *
 get_font_by_mag_step (Output_def *layout, Real requested_step,
                      SCM font_vector, Real default_size,
-                     SCM input_encoding)
+                     SCM font_encoding, SCM input_encoding)
 {
   return get_font_by_design_size (layout, default_size
                                  * pow (2.0, requested_step / 6.0),
-                                 font_vector, input_encoding);
+                                 font_vector, font_encoding, input_encoding);
 }
 
 SCM
@@ -108,8 +109,8 @@ properties_to_font_size_family (SCM fonts, SCM alist_chain)
 Font_metric *
 select_encoded_font (Output_def *layout, SCM chain, SCM input_encoding)
 {
-  SCM name = ly_assoc_chain (ly_symbol2scm  ("font-name"), chain);
-  
+  SCM name = ly_assoc_chain (ly_symbol2scm ("font-name"), chain);
+
   if (!scm_is_pair (name) || !scm_is_string (scm_cdr (name)))
     {
       SCM fonts = layout->lookup_variable (ly_symbol2scm ("fonts"));
@@ -125,21 +126,26 @@ select_encoded_font (Output_def *layout, SCM chain, SCM input_encoding)
                   ? robust_scm2double (scm_cdr (mag), 1.0)
                   : 1);
       Font_metric *fm = all_fonts_global->find_font (ly_scm2string (name));
-                  
-      return find_scaled_font (layout, fm, rmag, input_encoding);
+               
+      SCM font_encoding
+       = scm_cdr (ly_assoc_chain (ly_symbol2scm ("font-encoding"), chain));
+      return find_scaled_font (layout, fm, rmag, font_encoding, input_encoding);
     }
   else if (scm_instance_p (name))
     {
       SCM base_size  = scm_slot_ref (name, ly_symbol2scm ("default-size"));
       SCM vec = scm_slot_ref (name, ly_symbol2scm ("size-vector"));
-      
+
       SCM font_size = ly_assoc_chain (ly_symbol2scm ("font-size"), chain);
       Real req = 0;
       if (scm_is_pair (font_size))
        req = scm_to_double (scm_cdr (font_size));
 
+      SCM font_encoding
+       = scm_cdr (ly_assoc_chain (ly_symbol2scm ("font-encoding"), chain));
+
       return get_font_by_mag_step (layout, req, vec, scm_to_double (base_size),
-                                  input_encoding);
+                                  font_encoding, input_encoding);
     }
 
   assert (0);
index b506abaad51b4a4febb067c8d4bb3ea943b6d943..bb690d66e74a6e8d9b80436dadf441dcff06719f 100644 (file)
@@ -21,15 +21,14 @@ class All_font_metrics
   Scheme_hash_table *afm_p_dict_;
   Scheme_hash_table *tfm_p_dict_;
   File_path search_path_;
+
 public:
-  ~All_font_metrics ();  
+  All_font_metrics (String search_path);
+  ~All_font_metrics ();
+  
   Adobe_font_metric *find_afm (String name);
   Tex_font_metric *find_tfm (String);
   Font_metric *find_font (String name);  
-
-  
-  All_font_metrics (String search_path);
-  
   SCM font_descriptions () const;
 };
 
index 6dd1bea91962ffcc9946c713b7279aa8387ee651..8f5bfb65955c0e5b4cbb0cf8314825ee1f2aedd2 100644 (file)
 #ifndef GUILE_COMPATIBILITY_HH
 #define GUILE_COMPATIBILITY_HH
 
-
-
 #if SCM_MINOR_VERSION < 7
 /* guile-1.6.x compatibility */
 
 inline SCM scm_cdr (SCM x)
 {
-  if (SCM_NCONSP(x))
-    abort();
+  if (SCM_NCONSP (x))
+    abort ();
   return SCM_CDR (x);
 }
 inline SCM scm_car (SCM x)
 {
-  if (SCM_NCONSP(x))
-    abort();    
+  if (SCM_NCONSP (x))
+    abort ();    
   return SCM_CAR (x);
 }
 inline SCM scm_caar (SCM x) { return SCM_CAAR (x); }
@@ -37,33 +35,32 @@ inline SCM scm_caadr (SCM x) { return SCM_CAADR (x); }
 inline SCM scm_cadar (SCM x) { return SCM_CADAR (x); }
 #define scm_gc_unregister_collectable_memory(a, b, c) scm_done_free (b)
 #define scm_gc_register_collectable_memory(a, b, c) scm_done_malloc (b)
-#define SCM_VECTOR_REF(v,i) (SCM_VELTS ((v))[(i)])
+#define SCM_VECTOR_REF(v, i) (SCM_VELTS ((v))[(i)])
 #define scm_from_int(x) SCM_MAKINUM (x)
 #define scm_is_integer(x) SCM_INUMP (x)
-#define scm_is_string(x) SCM_STRINGP(x)
+#define scm_is_string(x) SCM_STRINGP (x)
 #define scm_hash_table_p scm_vector_p
-#define scm_i_string_chars(x) SCM_STRING_CHARS(x)
-#define scm_i_string_length(x) SCM_STRING_LENGTH(x)
+#define scm_i_string_chars(x) SCM_STRING_CHARS (x)
+#define scm_i_string_length(x) SCM_STRING_LENGTH (x)
 inline bool ly_c_number_p (SCM x) { return SCM_NUMBERP (x); }
-#define scm_is_number(x) (scm_number_p(x)==SCM_BOOL_T)
+#define scm_is_number(x) (scm_number_p (x) == SCM_BOOL_T)
 inline int ly_scm2int (SCM x) { return scm_num2int (x, 0, "ly_scm2int"); }
-#define scm_to_int(x) (ly_scm2int(x))
+#define scm_to_int(x) (ly_scm2int (x))
 inline bool ly_c_symbol_p (SCM x) { return SCM_SYMBOLP (x); }
-#define scm_is_symbol(x) ly_c_symbol_p(x)
+#define scm_is_symbol(x) ly_c_symbol_p (x)
 inline bool ly_c_boolean_p (SCM x) { return SCM_BOOLP (x); }
 #define scm_is_bool(x) ly_c_boolean_p(x)
 inline bool ly_c_eq_p (SCM x, SCM y) { return SCM_EQ_P (x, y); }
-#define scm_is_eq(x,y)  (SCM_EQ_P((x), (y)))
+#define scm_is_eq(x,y) (SCM_EQ_P ((x), (y)))
 
-#define scm_c_string_length(x) SCM_STRING_LENGTH(x)
-#define scm_is_pair(x) (SCM_CONSP(x))
+#define scm_c_string_length(x) SCM_STRING_LENGTH (x)
+#define scm_is_pair(x) (SCM_CONSP (x))
 
 
 inline double ly_scm2double (SCM x) { return scm_num2dbl (x, "ly_scm2double"); }
-#define scm_to_double(x) (ly_scm2double(x))
-#define scm_from_double(x) (scm_make_real(x))
-
-
+#define scm_to_double(x) (ly_scm2double (x))
+#define scm_from_double(x) (scm_make_real (x))
 
 #endif /* SCM_MINOR_VERSION < 7 */
+
 #endif /* GUILE_COMPATIBILITY_HH */
index af0825a3d2f4c7bf792465cca603ebf8af65f820..6bc42424bba9137cf021ee19efea32456820382a 100644 (file)
@@ -12,8 +12,8 @@
 
 class String;
 
-String kpathsea_find_afm (char const * name);
-String kpathsea_find_tfm (char const * name);
+String kpathsea_find_afm (char const *name);
+String kpathsea_find_tfm (char const *name);
 void initialize_kpathsea (char *av0);
 
 #endif /* KPATH_HH */
index c3cd7639f07f8c2890db7c67895d30a310ac070c..d9fd9c6585d0f672616b8d76e894939d62ca335c 100644 (file)
@@ -17,34 +17,31 @@ struct Modified_font_metric : public Font_metric
 public:
   Box text_dimension (String);
   
-  
-  static SCM make_scaled_font_metric (SCM, Font_metric*, Real);
+  static SCM make_scaled_font_metric (Font_metric *fm, Real magnification,
+                                     SCM font_encoding, SCM input_encoding);
   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;  
+  virtual Font_metric *original_font () const;  
 
 protected:
-  
   SCM coding_vector_;
   SCM coding_table_;
   SCM coding_mapping_;
   SCM coding_description_;
+  Font_metric *orig_;
+  Real magnification_;
+  String input_encoding_;
   friend SCM ly_font_encoding_alist (SCM);
     
+  Modified_font_metric (Font_metric *fm, Real magnification,
+                       String font_encoding, String input_encoding);
   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;
 };
 
index cf8208714b0ade6896057f98512a846f649b5411..15b35f1eacbe860722e9dbd122752d83f084d389 100644 (file)
@@ -74,8 +74,9 @@ Font_metric *select_font (Output_def *layout, SCM chain);
 DECLARE_UNSMOB (Output_def, output_def);
 
 
-Font_metric *find_scaled_font (Output_def * od,
-                              Font_metric *f, Real m, SCM input_enc_name);
+Font_metric *find_scaled_font (Output_def *od,
+                              Font_metric *f, Real magnification,
+                              SCM font_encoding, SCM input_encoding);
 Output_def *scale_output_def (Output_def *def, Real scale);
 Real output_scale (Output_def*);
 
index 1f3b00573738f8c2c0e13f93fbd4319af5bc3a12..22910f95fcb8a6266a365217e4b272e79ef769e4 100644 (file)
@@ -44,22 +44,16 @@ extern "C" {
 #include "warn.hh"
 
 String
-kpathsea_find_afm (char const * name)
+kpathsea_find_afm (char const *name)
 {
 #if (KPATHSEA && HAVE_KPSE_FIND_FILE)
-  char * name_ptr =  kpse_find_file (name, kpse_afm_format, false);
 
-  if (!name_ptr)
-    {
-  /*
-    don't mutter about afms, since we try to find them first, and lots of
-    TFMs don't have AFMs. 
-   */
-      //      warning (_f ("kpathsea couldn't find AFM file `%s'", name));
-    }
-  else
-    return name_ptr;
-  
+  if (char *afm = kpse_find_file (name, kpse_afm_format, false))
+    return afm;
+#if 0 /* Do not mutter about afms, since we try to find them first, and
+        lots of TFMs don't have AFMs. */
+  warning (_f ("kpathsea can not find AFM file `%s'", name));
+#endif
 #endif
   return "";
 }
@@ -80,11 +74,9 @@ kpathsea_find_tfm (char const *name)
             but we assume that if there is a .PFA, there is also a .TFM,
         and it's no use generating TFMs on the fly, because PFAs cannot
         be generated on the fly. */
-      char *p = kpse_find_file (name, kpse_tfm_format, false);
-      if (!p)
-       warning (_f ("kpathsea can not find TFM file: `%s'", name));
-      else
-       file_name = p;
+      if (char *tfm = kpse_find_file (name, kpse_tfm_format, false))
+       return tfm;
+      warning (_f ("kpathsea can not find TFM file: `%s'", name));
     }
 #endif
   return file_name;
index f7631734c363f5bb25e24c490febd735283408db..801d666de0d6fe3ae70dee35ea6a4eed39261ba2 100644 (file)
 #include "warn.hh"
 #include "stencil.hh"
 
-Modified_font_metric::Modified_font_metric (String input_encoding,
-                                           Font_metric *m, Real magn)
+Modified_font_metric::Modified_font_metric (Font_metric *fm,
+                                           Real magnification,
+                                           String font_encoding,
+                                           String input_encoding)
 {
-  /* 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;
-
+  input_encoding_ = input_encoding;
   coding_vector_ = SCM_EOL;
   coding_mapping_ = SCM_EOL;
   coding_table_ = SCM_EOL;
   coding_description_ = SCM_EOL;
+  magnification_ = magnification;
   
-  magnification_ = magn;
-  
-  SCM desc = m->description_;
+  SCM desc = fm->description_;
 
-  Real total_mag = magn * scm_to_double (scm_cdr (desc));
+  Real total_mag = magnification * scm_to_double (scm_cdr (desc));
   assert (total_mag);
   
   description_ = scm_cons (scm_car (desc), scm_make_real (total_mag));
-  orig_ = m;
-  
-  if (coding_scheme_ != "" 
-      && coding_scheme_ != "TeX"
-      && coding_scheme_ != "ASCII"
-      && coding_scheme_ !=  orig_->coding_scheme ())
+  orig_ = fm;
+
+  String metric_coding = orig_->coding_scheme ();
+  if (metric_coding != "FontSpecific"
+      && metric_coding != font_encoding)
+    warning (_f ("conflicting metric coding (%s) and font_encoding (%s)",
+                metric_coding, font_encoding));
+
+  if (input_encoding_ != "" 
+      && input_encoding_ != "TeX"
+      && input_encoding_ != "ASCII"
+      && input_encoding_ !=  font_encoding)
     {
-      /* FIXME: this is broken, cannot get font encoding from font/AFM file,
-        should use encoding from font-tree in fonts.scm.  */
-
-      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 (font_encoding.to_str0 ()));
 
       if (!ly_c_vector_p (coding_vector_))
        {
@@ -58,9 +53,8 @@ Modified_font_metric::Modified_font_metric (String input_encoding,
          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_table_ = scm_call_1 (ly_scheme_function ("get-coding-table"),
+                                 scm_makfrom0str (font_encoding.to_str0 ()));
 
       coding_mapping_
        = scm_call_2 (ly_scheme_function ("make-encoding-mapping"),
@@ -70,7 +64,7 @@ Modified_font_metric::Modified_font_metric (String input_encoding,
       coding_description_ = SCM_EOL;
       coding_description_
        = scm_acons (ly_symbol2scm ("input-name"),
-                    scm_makfrom0str (coding_scheme_.to_str0 ()),
+                    scm_makfrom0str (input_encoding_.to_str0 ()),
                     coding_description_);
       coding_description_
        = scm_acons (ly_symbol2scm ("input-vector"),
@@ -89,20 +83,25 @@ Modified_font_metric::Modified_font_metric (String input_encoding,
                     coding_description_);
     } 
 }
+
 SCM
-Modified_font_metric::make_scaled_font_metric (SCM coding,
-                                              Font_metric *m, Real s)
+Modified_font_metric::make_scaled_font_metric (Font_metric *fm, Real scaling,
+                                              SCM font_encoding,
+                                              SCM input_encoding)
 {
   /*
     UGH.
    */
-  if (scm_is_symbol (coding))
-    coding = scm_symbol_to_string (coding);
-  
-  String scheme = scm_is_string (coding) ? ly_scm2string (coding) : ""; 
+  if (scm_is_symbol (input_encoding))
+    input_encoding = scm_symbol_to_string (input_encoding);
   
-  Modified_font_metric *sfm = new Modified_font_metric (scheme, m, s);
+  String font_encoding_str = ly_symbol2string (font_encoding);
+  String input_encoding_str
+    = scm_is_string (input_encoding) ? ly_scm2string (input_encoding) : ""; 
   
+  Modified_font_metric *sfm = new Modified_font_metric (fm, scaling,
+                                                       font_encoding_str,
+                                                       input_encoding_str);
   return sfm->self_scm ();
 }
 
@@ -157,7 +156,7 @@ Modified_font_metric::index_to_ascii (int k) const
 String
 Modified_font_metric::coding_scheme () const
 {
-  return coding_scheme_;
+  return input_encoding_;
 }
 
 void
@@ -229,11 +228,11 @@ Box
 Modified_font_metric::text_dimension (String text) 
 {
   Box b; 
-  if (coding_scheme_ == "TeX")
+  if (input_encoding_ == "TeX")
     b = tex_kludge (text);
-  else if (coding_scheme_ == "ASCII"
-          || coding_scheme_ == "" 
-          || coding_scheme_ ==  orig_->coding_scheme ())
+  else if (input_encoding_ == "ASCII"
+          || input_encoding_ == "" 
+          || input_encoding_ ==  orig_->coding_scheme ())
     {
       Interval ydims;
 
index 0b16578ce9420c5fbe3efdd0c364e1b4081d0227..d40e1abc389eeaec9445742d351ff6f8dddb99cb 100644 (file)
@@ -20,11 +20,11 @@ output_scale (Output_def *od)
 
 /* TODO: should add nesting for Output_def here too. */
 Font_metric *
-find_scaled_font (Output_def *mod,
-                 Font_metric *f, Real m, SCM input_enc_name)
+find_scaled_font (Output_def *mod, Font_metric *f, Real m,
+                 SCM font_encoding, SCM input_encoding)
 {
   if (mod->parent_)
-    return find_scaled_font (mod->parent_, f, m, input_enc_name);
+    return find_scaled_font (mod->parent_, f, m, font_encoding, input_encoding);
   
   Real lookup_mag = m;
   if (!dynamic_cast<Virtual_font_metric*> (f))
@@ -65,9 +65,9 @@ find_scaled_font (Output_def *mod,
       SCM *t = &lst;
       for (SCM s = vf->get_font_list (); scm_is_pair (s); s = scm_cdr (s))
        {
-         Font_metric *scaled = find_scaled_font (mod,
-                                                 unsmob_metrics (scm_car (s)),
-                                                 m, input_enc_name);
+         Font_metric *scaled
+           = find_scaled_font (mod, unsmob_metrics (scm_car (s)), m,
+                               font_encoding, input_encoding);
          *t = scm_cons (scaled->self_scm (), SCM_EOL);
          t = SCM_CDRLOC (*t);
        }
@@ -76,10 +76,9 @@ find_scaled_font (Output_def *mod,
       val = vf->self_scm ();
     }
   else
-    {
-      val = Modified_font_metric::make_scaled_font_metric (input_enc_name,
-                                                          f, lookup_mag);
-    }
+    val = Modified_font_metric::make_scaled_font_metric (f, lookup_mag,
+                                                        font_encoding,
+                                                        input_encoding);
 
   sizes = scm_acons (scm_make_real (lookup_mag), val, sizes);
   scm_gc_unprotect_object (val);
index d22223f496d2248f023279516a79a4d401ff09fa..8498ef69cd646137f2e7972bfb13969beb32a60d 100644 (file)
@@ -17,7 +17,7 @@
         (raw (ly:gulp-file path))
         (string (regexp-substitute/global #f "%[^\n]*" raw 'pre "" 'post))
         (command (match:substring
-                  (string-match "/([^ \t\n\r]*)[ \t\n\r]+[[]" string) 1))
+                  (string-match "/([^ \t\n\r]*)[ \t\n\r]*[[]" string) 1))
         (encoding (match:substring (string-match "[[](.*)[]]" string) 1))
         (ps-lst (string-tokenize encoding))
         (lst (map (lambda (x) (string->symbol (substring x 1))) ps-lst))
@@ -74,7 +74,6 @@ vector of symbols."
   (map (lambda (x)
         (cons (car x)
               (cons (cdr x) (delay (get-coding-from-file (cdr x))))))
-       
        '(
         ;; teTeX font (output) encodings
         ("TeX-typewriter-text" . "09fbbfac.enc") ;; cmtt10
@@ -99,6 +98,7 @@ vector of symbols."
 
         ;; LilyPond FETA music font
         ("fetaBraces" . "feta-braces-a.enc")
+        ("fetaDynamic" . "feta-din10.enc")
         ("fetaNumber" . "feta-nummer10.enc")
         ("fetaMusic" . "feta20.enc")
         ("parmesanMusic" . "parmesan20.enc"))
@@ -135,18 +135,14 @@ vector of symbols."
 (define-public (decode-byte-string encoding-name str)
   "Return vector of glyphname symbols that correspond to string,
 assuming that STR is byte-coded using ENCODING-NAME."
-  
-  (let*
-      ((coding-vector (get-coding-vector encoding-name))
-       (len (string-length str))
-       (output-vector (make-vector len '.notdef))
-       )
 
+  (let* ((coding-vector (get-coding-vector encoding-name))
+        (len (string-length str))
+        (output-vector (make-vector len '.notdef)))
 
     (do
        ((idx 0 (1+ idx)))
        ((>= idx len) output-vector)
       (vector-set! output-vector idx
                     (vector-ref coding-vector
-                                (char->integer (string-ref str idx))))
-      )))
+                                (char->integer (string-ref str idx)))))))
index 66e3aaddc42a77620636b49fa7fc94d5574b62d0..921cddeb06d9c860a02148fbb4d6d7da11d796fa 100644 (file)
       . (10.0 . #(,(delay (ly:font-load "lmri7"))
                  ,(delay (ly:font-load "lmri10"))
                  ,(delay (ly:font-load "lmri12")))))
-     (#(roman italic bold) 
-      . (10.0 . #(,(delay (ly:font-load "lmbxi8"))
-                 ,(delay (ly:font-load "lmbxi10"))
-                 ,(delay (ly:font-load "lmbi14")))))
-     (#(roman caps medium) 
+     (#(roman italic bold)
+      . (10.0 . #(,(delay (ly:font-load "lmbxi10")))))
+     (#(roman caps medium)
       . (10.0 . #(,(delay (ly:font-load "lmcsc10")))))
      (#(roman upright bold-narrow ) 
       . (10.0 . #(,(delay (ly:font-load "lmb10")))))