]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.3.47.mb1
authorMats Bengtsson <mats.bengtsson@s3.kth.se>
Sun, 30 Apr 2000 16:06:58 +0000 (18:06 +0200)
committerMats Bengtsson <mats.bengtsson@s3.kth.se>
Sun, 30 Apr 2000 16:06:58 +0000 (18:06 +0200)
1.3.47.mb1
===========

* Simplified ly2dvi using the power of the geometry package.

* Improved heuristic size calculation of TeX macros. Handles e.g.
  "\\u{a}", "\\"{o}" and "\\^{u}" correctly.

CHANGES
VERSION
lily/font-metric.cc
scripts/ly2dvi.py

diff --git a/CHANGES b/CHANGES
index ba1a1e5bdb48c5d6e7483bbe7759f48194c41749..7bdea74a219f1841c5ab5406ab289ee55d0ca0f9 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,12 @@
+1.3.47.mb1
+===========
+
+* Simplified ly2dvi using the power of the geometry package.
+
+* Improved heuristic size calculation of TeX macros. Handles e.g.
+  "\\u{a}", "\\"{o}" and "\\^{u}" correctly.
+
+
 1.3.46.jcn2
 ===========
 
diff --git a/VERSION b/VERSION
index 0a0477f199f92496a45449898af0c0a64c9a944a..9c4c574e39389411d06ca7d9d47a0f06690f82ab 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=3
 PATCH_LEVEL=47
-MY_PATCH_LEVEL=
+MY_PATCH_LEVEL=mb1
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
index 1f54aa5eada1193fd11041769dc006bcfcd35cfe..f11483f8f092ee826a22f0c8a1b5e250caf906ff 100644 (file)
@@ -4,7 +4,8 @@
   source file of the GNU LilyPond music typesetter
   
   (c) 1999--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
+
+    Mats Bengtsson <matsb@s3.kth.se>  (the ugly TeX parsing in text_dimension)
  */
 
 #include <math.h>
@@ -22,23 +23,29 @@ Font_metric::text_dimension (String text) const
   for (int i = 0; i < text.length_i (); i++) 
     {
       
-      if (text[i]=='\\'
+      switch (text[i]
        {
-         for (i++; (i < text.length_i ()) && isalpha(text[i]); i++)
+       case '\\':
+         for (i++; (i < text.length_i ()) && !isspace(text[i]) 
+                && text[i]!='{' && text[i]!='}'; i++)
            ;
          // ugh.
          i--; // Compensate for the increment in the outer loop!
-       }
-      else
-       {
+         break;
+       case '{':  // Skip '{' and '}'
+       case '}':
+         break;
+       
+       default: 
          Box b = get_char ((unsigned char)text[i],false);
-
+         
          // Ugh, use the width of 'x' for unknown characters
          if (b[X_AXIS].length () == 0) 
            b = get_char ((unsigned char)'x',false);
          
          w += b[X_AXIS].length ();
          ydims.unite (b[Y_AXIS]);
+         break;
        }
     }
   if (ydims.empty_b ())
@@ -74,7 +81,6 @@ Font_metric::Font_metric (Font_metric const &)
 }
 
 
-
 Box 
 Font_metric::get_char (int, bool)const
 {
index 730273ea3cc0aa9a63fdba29d33545ce36c34501..e17b41b1f11c35fc5b21d13e39f808d09722b636 100644 (file)
@@ -245,8 +245,6 @@ class TeXOutput:
             pageheight = Props.get('pageheight')
             pagewidth = Props.get('pagewidth')
                                 
-        horizontalMarginArg =  ( (pagewidth - linewidth)/2 )   
-        verticalMarginArg =  ( (pageheight - textheight)/2  )
 
         top= r"""
 %% Creator: %s
@@ -265,16 +263,7 @@ class TeXOutput:
 %%\headheight9pt
 %%\headsep0pt
 %% Maybe this is too drastic, but let us give it a try.
-\headheight0pt
-\headsep2mm
-\footskip2mm
-%%
-%%\addtolength{\oddsidemargin}{-1cm} 
-%%\addtolength{\topmargin}{-1cm} 
-%%\setlength{\textwidth}{%s} 
-%%\setlength{\textheight}{%s} 
-%%
-\geometry{width=%spt, left=%spt, height=%spt, top=%spt} 
+\geometry{width=%spt, height=%spt,headheight=2mm,headsep=0pt,footskip=2mm} 
 \input lilyponddefs 
 \input titledefs 
 %s
@@ -286,9 +275,8 @@ class TeXOutput:
 \renewcommand{\@oddfoot}{\parbox{\textwidth}{\mbox{}\thefooter}}%%
 \begin{document}
 """ % ( program_id(), Props.get('filename'), now, Props.get('papersize'),
-        Props.get('language'), Props.get('pagenumber'), linewidth, textheight,
-        linewidth, horizontalMarginArg, textheight, verticalMarginArg,
-        Props.get('header') )
+        Props.get('language'), Props.get('pagenumber'), linewidth,
+        textheight, Props.get('header') )
         
         base, ext = os.path.splitext(file)
         this.__base = base