]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/modified-font-metric.cc
* stepmake/stepmake/generic-vars.make (LOOP): Add PLUS to keep -j
[lilypond.git] / lily / modified-font-metric.cc
index 3e0b6d03e7748858b00d6ec7cf63834fcc608370..6d50d06d51031b3549bb8fe722af25c060e9649e 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1999--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  (c) 1999--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 #include <cctype>
 using namespace std;
@@ -44,7 +44,7 @@ Modified_font_metric::design_size () const
 }
 
 Box
-Modified_font_metric::get_indexed_char (int i) const
+Modified_font_metric::get_indexed_char (vsize i) const
 {
   Box b = orig_->get_indexed_char (i);
   b.scale (magnification_);
@@ -52,47 +52,47 @@ Modified_font_metric::get_indexed_char (int i) const
 }
 
 Box
-Modified_font_metric::get_ascii_char (int i) const
+Modified_font_metric::get_ascii_char (vsize i) const
 {
   Box b = orig_->get_ascii_char (i);
   b.scale (magnification_);
   return b;
 }
 
-int
+vsize
 Modified_font_metric::count () const
 {
   return orig_->count ();
 }
 
 Offset
-Modified_font_metric::attachment_point (String s) const
+Modified_font_metric::attachment_point (std::string s) const
 {
   Offset o = orig_->attachment_point (s);
   return o * magnification_;
 }
 
 Offset
-Modified_font_metric::get_indexed_wxwy (int k) const
+Modified_font_metric::get_indexed_wxwy (vsize k) const
 {
   Offset o = orig_->get_indexed_wxwy (k);
   return o * magnification_;
 }
 
-int
-Modified_font_metric::name_to_index (String s) const
+vsize
+Modified_font_metric::name_to_index (std::string s) const
 {
   return orig_->name_to_index (s);
 }
 
-unsigned
-Modified_font_metric::index_to_charcode (int i) const
+vsize
+Modified_font_metric::index_to_charcode (vsize i) const
 {
   return orig_->index_to_charcode (i);
 }
 
-int
-Modified_font_metric::index_to_ascii (int k) const
+vsize
+Modified_font_metric::index_to_ascii (vsize k) const
 {
   return orig_->index_to_ascii (k);
 }
@@ -104,17 +104,17 @@ Modified_font_metric::derived_mark () const
 
 /* TODO: put this klutchness behind ly:option switch.  */
 Box
-Modified_font_metric::tex_kludge (String text) const
+Modified_font_metric::tex_kludge (std::string text) const
 {
   Interval ydims;
   Real w = 0;
-  for (int i = 0; i < text.length (); i++)
+  for (ssize i = 0; i < text.length (); i++)
     {
       switch (text[i])
        {
        case '\\':
          /* Accent marks use width of base letter */
-         if (i +1 < text.length ())
+         if (i < text.length () - 1)
            {
              if (text[i + 1]=='\'' || text[i + 1]=='`' || text[i + 1]=='"'
                  || text[i + 1]=='^')
@@ -159,7 +159,7 @@ Modified_font_metric::tex_kludge (String text) const
 }
 
 Stencil
-Modified_font_metric::text_stencil (String text) const
+Modified_font_metric::text_stencil (std::string text) const
 {
   Box b;
   if (Pango_font *pf = dynamic_cast<Pango_font *> (orig_))
@@ -177,9 +177,9 @@ Modified_font_metric::text_stencil (String text) const
 }
 
 Box
-Modified_font_metric::text_dimension (String text) const
+Modified_font_metric::text_dimension (std::string text) const
 {
-  SCM stext = scm_makfrom0str (text.to_str0 ());
+  SCM stext = scm_makfrom0str (text.c_str ());
   Box b = lookup_tex_text_dimension (orig_, stext);
   if (!b[Y_AXIS].is_empty ())
     {
@@ -197,7 +197,7 @@ Modified_font_metric::text_dimension (String text) const
 
   Real w = 0.0;
 
-  for (int i = 0; i < text.length (); i++)
+  for (ssize i = 0; i < text.length (); i++)
     {
       Box b = get_ascii_char ((unsigned char)text[i]);
 
@@ -223,7 +223,7 @@ Modified_font_metric::sub_fonts () const
   return orig_->sub_fonts ();
 }
 
-String
+std::string
 Modified_font_metric::font_name () const
 {
   return original_font ()->font_name ();