]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/font-metric.cc
release: 1.3.142
[lilypond.git] / lily / font-metric.cc
index 7ce615a85926fd9f6fdbf290cb2c74b8fe0f0855..b421075119a2b9fcd61e7a33e999f49aa4d23999 100644 (file)
@@ -29,6 +29,22 @@ Font_metric::text_dimension (String text) const
       switch (text[i]) 
        {
        case '\\':
+  // accent marks use width of base letter
+         if (i +1 < text.length_i ())
+          {
+            if (text[i+1]=='\'' || text[i+1]=='`' || text[i+1]=='"' ||
+                text[i+1]=='^')
+              {
+                i++;
+                break;
+              }
+            // for string width \\ is a \ and \_ is a _.
+            if (text[i+1]=='\\' || text[i+1]=='_')        
+              {
+                break;
+              }
+          }
+         
          for (i++; (i < text.length_i ()) && !isspace (text[i]) 
                 && text[i]!='{' && text[i]!='}'; i++)
            ;