]> git.donarmstrong.com Git - lilypond.git/commitdiff
*** empty log message ***
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 12 Dec 2004 23:36:48 +0000 (23:36 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 12 Dec 2004 23:36:48 +0000 (23:36 +0000)
lily/font-metric.cc
lily/include/modified-font-metric.hh
lily/modified-font-metric.cc
lily/open-type-font.cc
lily/vaticana-ligature-engraver.cc

index 12c2d6039894329ca132c1f75c7cf93eeb4ce0d0..be4a3a23b631dd3048f8b259a9d5b5c93a4a228b 100644 (file)
@@ -290,7 +290,7 @@ get_encoded_index (Font_metric *m, String input_coding, int code)
 }
 
 Offset
-Font_metric::attachment_point (String str) const
+Font_metric::attachment_point (String) const
 {
   return Offset (0, 0);
 }
index d9fd9c6585d0f672616b8d76e894939d62ca335c..79ade2db860d856386c57917132b3fb072c628ed 100644 (file)
@@ -21,10 +21,11 @@ public:
                                      SCM font_encoding, SCM input_encoding);
   virtual int count () const;
   virtual Offset get_indexed_wxwy (int) const;
+  virtual Offset attachment_point (String) 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_;
index 801d666de0d6fe3ae70dee35ea6a4eed39261ba2..f92b534ad4d94caf271a414d45a270aca72a8af9 100644 (file)
@@ -134,6 +134,13 @@ Modified_font_metric::count () const
   return orig_->count ();
 }
 
+Offset
+Modified_font_metric::attachment_point (String s) const
+{
+  Offset o = orig_->attachment_point (s);
+  return o * magnification_;
+}
+
 Offset
 Modified_font_metric::get_indexed_wxwy (int k) const
 {
index 92a8df25e3acae81d7c2fd3e283ec6192b0dbea9..5a9085ef4ed0fb91c752417fe4a3f74c14e4d906 100644 (file)
@@ -16,6 +16,9 @@
 #include "open-type-font.hh"
 #include "dimensions.hh"
 
+
+const  Real point_constant = 1 PT;
+
 FT_Byte *
 load_table (char const *tag_str, FT_Face face, FT_ULong *length)
 {
@@ -44,7 +47,7 @@ SCM
 load_scheme_table (char const *tag_str, FT_Face face)
 {
   FT_ULong length = 0;
-  FT_Byte* buffer =load_table (tag_str, face, &length);
+  FT_Byte* buffer = load_table (tag_str, face, &length);
 
   SCM tab = SCM_EOL;
   if (buffer)
@@ -98,8 +101,9 @@ Open_type_font::make_otf (String str)
   return otf->self_scm ();
 }
 
-Open_type_font::Open_type_font(FT_Face)
+Open_type_font::Open_type_font(FT_Face face)
 {
+  face_ = face;
   lily_character_table_ = SCM_EOL;
   lily_global_table_ = SCM_EOL;
   
@@ -127,7 +131,7 @@ Open_type_font::attachment_point (String glyph_name) const
 
   SCM char_alist = entry;
 
-  SCM att_scm =scm_cdr (scm_assq (char_alist, ly_symbol2scm ("attachment")));
+  SCM att_scm =scm_cdr (scm_assq (ly_symbol2scm ("attachment"), char_alist));
   
   return ly_scm2offset (att_scm);
 }
@@ -153,7 +157,6 @@ Open_type_font::get_indexed_char (int signed_idx) const
   Box b (Interval (-hb, m.width - hb),
         Interval (-vb, m.height - vb));
 
-  Real point_constant = 1 PT;
   
 
   b.scale (design_size() * Real (point_constant) / face_->units_per_EM);
@@ -176,5 +179,5 @@ Open_type_font::name_to_index (String nm) const
 Real
 Open_type_font::design_size () const
 {
-  return scm_to_double (scm_hashq_ref (lily_global_table_, ly_symbol2scm ("staffsize"), SCM_BOOL_F));
+  return point_constant * scm_to_double (scm_hashq_ref (lily_global_table_, ly_symbol2scm ("staffsize"), SCM_BOOL_F));
 }
index de737860b03af621dceef7ab0d33097975585697..27bc2bb05e7394f2eb3db10b9537c21ffde0a0a3 100644 (file)
@@ -395,29 +395,29 @@ Vaticana_ligature_engraver::transform_heads (Spanner *ligature,
     String glyph_name;
     if (prefix_set & VIRGA)
       {
-       glyph_name = "vaticana-punctum";
-       primitive->set_property ("add-stem", ly_bool2scm (true));
+       glyph_name = "vaticana.punctum";
+       primitive->set_property ("add.stem", ly_bool2scm (true));
       }
     else if (prefix_set & QUILISMA)
-      glyph_name = "vaticana-quilisma";
+      glyph_name = "vaticana.quilisma";
     else if (prefix_set & ORISCUS)
-      glyph_name = "solesmes-oriscus";
+      glyph_name = "solesmes.oriscus";
     else if (prefix_set & STROPHA)
       if (prefix_set & AUCTUM)
-       glyph_name = "solesmes-stropha-aucta";
-      else glyph_name = "solesmes-stropha";
+       glyph_name = "solesmes.stropha.aucta";
+      else glyph_name = "solesmes.stropha";
     else if (prefix_set & INCLINATUM)
       if (prefix_set & AUCTUM)
-       glyph_name = "solesmes-incl-auctum";
+       glyph_name = "solesmes.incl.auctum";
       else if (prefix_set & DEMINUTUM)
-       glyph_name = "solesmes-incl-parvum";
+       glyph_name = "solesmes.incl.parvum";
       else
-       glyph_name = "vaticana-inclinatum";
+       glyph_name = "vaticana.inclinatum";
     else if (prefix_set & DEMINUTUM)
       if (i == 0)
        {
          // initio debilis
-         glyph_name = "vaticana-reverse-plica";
+         glyph_name = "vaticana.reverse.plica";
        }
       else if (prev_delta_pitch > 0)
        {
@@ -425,10 +425,10 @@ Vaticana_ligature_engraver::transform_heads (Spanner *ligature,
          if (!(prev_context_info & FLEXA_RIGHT))
            /* correct head of previous primitive */
            if (prev_delta_pitch > 1)
-             prev_glyph_name = "vaticana-epiphonus";
+             prev_glyph_name = "vaticana.epiphonus";
            else
-             prev_glyph_name = "vaticana-vepiphonus";
-         glyph_name = "vaticana-plica";
+             prev_glyph_name = "vaticana.vepiphonus";
+         glyph_name = "vaticana.plica";
        }
       else // (prev_delta_pitch <= 0)
        {
@@ -439,12 +439,12 @@ Vaticana_ligature_engraver::transform_heads (Spanner *ligature,
              if (i > 1)
                {
                  /* cephalicus head with fixed size cauda */
-                 prev_glyph_name = "vaticana-inner-cephalicus";
+                 prev_glyph_name = "vaticana.inner.cephalicus";
                }
              else
                {
                  /* cephalicus head without cauda */
-                 prev_glyph_name = "vaticana-cephalicus";
+                 prev_glyph_name = "vaticana.cephalicus";
                }
 
              /*
@@ -460,35 +460,35 @@ Vaticana_ligature_engraver::transform_heads (Spanner *ligature,
              prev_primitive->set_property ("add-cauda",
                                                 ly_bool2scm (false));
            }
-         glyph_name = "vaticana-reverse-plica";
+         glyph_name = "vaticana.reverse.plica";
        }
     else if (prefix_set & (CAVUM | LINEA))
       if ((prefix_set & CAVUM) && (prefix_set & LINEA))
-       glyph_name = "vaticana-linea-punctum-cavum";
+       glyph_name = "vaticana.linea.punctum.cavum";
       else if (prefix_set & CAVUM)
-       glyph_name = "vaticana-punctum-cavum";
+       glyph_name = "vaticana.punctum.cavum";
       else
-       glyph_name = "vaticana-linea-punctum";
+       glyph_name = "vaticana.linea.punctum";
     else if (prefix_set & AUCTUM)
       if (prefix_set & ASCENDENS)
-       glyph_name = "solesmes-auct-asc";
+       glyph_name = "solesmes.auct.asc";
       else
-       glyph_name = "solesmes-auct-desc";
+       glyph_name = "solesmes.auct.desc";
     else if ((context_info & STACKED_HEAD) &&
             (context_info & PES_UPPER))
       if (prev_delta_pitch > 1)
-       glyph_name = "vaticana-upes";
+       glyph_name = "vaticana.upes";
       else
-       glyph_name = "vaticana-vupes";
+       glyph_name = "vaticana.vupes";
     else
-      glyph_name = "vaticana-punctum";
+      glyph_name = "vaticana.punctum";
 
     /*
      * This head needs a cauda, if it starts a flexa, is not the upper
      * head of a pes, and if it is a punctum.
      */
     if ((context_info & FLEXA_LEFT) && !(context_info & PES_UPPER))
-      if (!String::compare (glyph_name, "vaticana-punctum"))
+      if (!String::compare (glyph_name, "vaticana.punctum"))
        primitive->set_property ("add-cauda", ly_bool2scm (true));
 
     /*
@@ -527,11 +527,11 @@ Vaticana_ligature_engraver::transform_heads (Spanner *ligature,
       {
        if ((context_info & PES_UPPER) && (context_info & STACKED_HEAD))
          {
-           if (!String::compare (prev_glyph_name, "vaticana-punctum"))
+           if (!String::compare (prev_glyph_name, "vaticana.punctum"))
              if (prev_delta_pitch > 1)
-               prev_glyph_name = "vaticana-lpes";
+               prev_glyph_name = "vaticana.lpes";
              else
-               prev_glyph_name = "vaticana-vlpes";
+               prev_glyph_name = "vaticana.vlpes";
          }
       }