]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scm/encoding.scm (coding-alist):
authorJan Nieuwenhuizen <janneke@gnu.org>
Sun, 21 Nov 2004 14:43:57 +0000 (14:43 +0000)
committerJan Nieuwenhuizen <janneke@gnu.org>
Sun, 21 Nov 2004 14:43:57 +0000 (14:43 +0000)
* scm/font.scm (add-ec-fonts):
* ly/paper-defaults.ly: Use actual name for EC fontencoding:
Extended-TeX-Font-Encoding---Latin.

* lily/side-position-interface.cc (general_side_position): Add
actual offset to error message (avoid constant error messages).

* 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 lmbxi8 and lmbxi14,
these do not exist.

ChangeLog
buildscripts/mf-to-table.py
lily/afm.cc
lily/include/dimensions.hh
lily/side-position-interface.cc
lily/stencil.cc
ly/paper-defaults.ly
scm/encoding.scm
scm/font.scm

index 79261d7325b61e6cb48bd096a0d76fd6ec6a5dcd..d5fdde86aa4f33d7484c325802dec3047d0a6735 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2004-11-21  Jan Nieuwenhuizen  <janneke@gnu.org>
 
+       * scm/encoding.scm (coding-alist): 
+       * scm/font.scm (add-ec-fonts):
+       * ly/paper-defaults.ly: Use actual name for EC fontencoding:
+       Extended-TeX-Font-Encoding---Latin.
+
+       * lily/side-position-interface.cc (general_side_position): Add
+       actual offset to error message (avoid constant error messages).
+
        * lily/all-font-metrics.cc (find_font): Add "lm" to try-AFM-first
        block.
 
index 6dc4c268a70ce49f635d2e61ad80f6994e049600..d624262462529b3394c1b79c29642d918e513094 100644 (file)
@@ -130,7 +130,7 @@ def write_afm_char_metric (file, charmetric):
               charmetric['wx'] * f,
               charmetric['wy'] * f)
 
-       file.write ('C %d ; N %s ; B %d %d %d %d ; W %d %d ;\n'% tup)
+       file.write ('C %d ; N %s ; B %d %d %d %d ; W %d %d ;\n' % tup)
 
 
 def write_afm_header (file):
index ccb0562c1eaec08d4eb9b8a393dfe1a59e93801e..155bfa96f6fc5d3b24a2e5d6fbb9a8399d36aa56 100644 (file)
@@ -149,22 +149,18 @@ read_afm_file (String nm)
   return Adobe_font_metric::make_afm (fi, cs, ds);
 }
 
-
-/* Actually, AFMs will be printers point, usually, but our .py script dumps
-  real points.  */
 Box
 afm_bbox_to_box (AFM_BBox bb)
 {
-  return Box (Interval (bb.llx, bb.urx)* (1/1000.0) PT,
-             Interval (bb.lly, bb.ury)* (1/1000.0) PT);
-
+  return Box (Interval (bb.llx, bb.urx) * 0.001 PT,
+             Interval (bb.lly, bb.ury) * 0.001 PT);
 }
 
 Offset
 Adobe_font_metric::get_indexed_wxwy (int k) const
 {
-  AFM_CharMetricInfo const *mi = font_info_->cmi+ k;
-  return 1/1000.0 PT * Offset (mi->wx, mi->wy); 
+  AFM_CharMetricInfo const *mi = font_info_->cmi + k;
+  return Offset (mi->wx, mi->wy) * 0.001 PT;
 }
 
 Real
index a72361a6f4ea7c90799f320a8c7a5ab918625687..13eab8db9fa13db7ff881889a2d1ff3160f626b9 100644 (file)
@@ -5,41 +5,40 @@
 class String;
 
 
-const Real INCH_TO_PT=72.270;
-const Real CM_TO_PT=(INCH_TO_PT/2.54);
-const Real MM_TO_PT=(CM_TO_PT/10);
-const Real PT_TO_PT =1.0;
+const Real INCH_TO_PT = 72.270;
+const Real CM_TO_PT = (INCH_TO_PT / 2.54);
+const Real MM_TO_PT = (CM_TO_PT / 10);
+const Real PT_TO_PT = 1.0;
 const Real INCH_TO_BP = 72;
-const Real BIGPOINT_TO_POINT = (INCH_TO_PT/ INCH_TO_BP);
-const Real CHAR_TO_PT =1.0;
-const Real PT_TO_MM = (1.0/MM_TO_PT);
+const Real BIGPOINT_TO_POINT = (INCH_TO_PT / INCH_TO_BP);
+const Real CHAR_TO_PT = 1.0;
+const Real PT_TO_MM = (1.0 / MM_TO_PT);
 
 #ifdef POINTS
 
-#define PT  *PT_TO_PT
-#define MM  *MM_TO_PT
-#define CM  *CM_TO_PT
-#define INCH *INCH_TO_PT
-#define BIGPOINT *BIGPOINT_TO_POINT
-#define CHAR *CHAR_TO_PT
-
-
 #define INTERNAL_UNIT "pt"
 
+#define PT * (PT_TO_PT)
+#define MM * (MM_TO_PT)
+#define CM  * (CM_TO_PT)
+#define INCH * (INCH_TO_PT)
+#define BIGPOINT * (BIGPOINT_TO_POINT)
+#define CHAR * (CHAR_TO_PT)
+
 #else  // mm
 
-#define PT  *PT_TO_PT *PT_TO_MM
-#define MM  *MM_TO_PT *PT_TO_MM
-#define CM  *CM_TO_PT *PT_TO_MM
-#define INCH *INCH_TO_PT *PT_TO_MM
-#define BIGPOINT *BIGPOINT_TO_POINT *PT_TO_MM
-#define CHAR *CHAR_TO_PT *PT_TO_MM
 #define INTERNAL_UNIT "mm"
 
+#define PT * (PT_TO_PT * PT_TO_MM)
+#define MM * (MM_TO_PT * PT_TO_MM)
+#define CM * (CM_TO_PT *PT_TO_MM)
+#define INCH * (INCH_TO_PT * PT_TO_MM)
+#define BIGPOINT * (BIGPOINT_TO_POINT * PT_TO_MM)
+#define CHAR * (CHAR_TO_PT * PT_TO_MM)
 
 #endif
 
 String print_dimen (Real);
 
-#endif // DIMENSIONS_HH
+#endif /* DIMENSIONS_HH */
 
index ec15be6641a3fd0e1cf5fd48693443474c6d21d9..d40648c7519d958a71558ab01985c02a772deefb 100644 (file)
@@ -19,6 +19,7 @@
 #include "group-interface.hh"
 #include "directional-element-interface.hh"
 #include "staff-symbol-referencer.hh"
+#include "string-convert.hh"
 
 void
 Side_position_interface::add_support (Grob*me, Grob*e)
@@ -62,12 +63,10 @@ Side_position_interface::aligned_on_support_extents (SCM element_smob, SCM axis)
 }
 
 
-/*
- Puts the element next to the support, optionally taking in
- account the extent of the support.
-*/
+/* Put the element next to the support, optionally taking in
+   account the extent of the support.  */
 SCM
-Side_position_interface::general_side_position (Grob * me, Axis a, bool use_extents)
+Side_position_interface::general_side_position (Grob *me, Axis a, bool use_extents)
 {
   Real ss = Staff_symbol_referencer::staff_space (me);
   SCM support = me->get_property ("side-support-elements");
@@ -86,7 +85,7 @@ Side_position_interface::general_side_position (Grob * me, Axis a, bool use_exte
     
   for (SCM s = support; s != SCM_EOL; s = scm_cdr (s))
     {
-      Grob * e  = unsmob_grob (scm_car (s));
+      Grob *e = unsmob_grob (scm_car (s));
       if (e)
        if (use_extents)
          dim.unite (e->extent (common, a));
@@ -98,14 +97,12 @@ Side_position_interface::general_side_position (Grob * me, Axis a, bool use_exte
     }
 
   if (dim.is_empty ())
-    {
-      dim = Interval (0,0);
-    }
+    dim = Interval (0, 0);
 
   Direction dir = Side_position_interface::get_direction (me);
     
-  Real off =  me->get_parent (a)->relative_coordinate (common, a);
-  Real  minimum_space = ss * robust_scm2double (me->get_property ("minimum-space"),  -1);
+  Real off = me->get_parent (a)->relative_coordinate (common, a);
+  Real minimum_space = ss * robust_scm2double (me->get_property ("minimum-space"),  -1);
 
   Real total_off = dim.linear_combination (dir) - off;
   total_off += dir * ss * robust_scm2double (me->get_property ("padding"), 0);
@@ -113,15 +110,11 @@ Side_position_interface::general_side_position (Grob * me, Axis a, bool use_exte
   if (minimum_space >= 0
       && dir
       && total_off * dir < minimum_space)
-    {
-      total_off = minimum_space * dir;
-    }
+    total_off = minimum_space * dir;
 
+  /* FIXME: 100CM should relate to paper size.  */
   if (fabs (total_off) > 100 CM)
-    programming_error ("Huh ? Improbable staff side dim.");
-
-
-  
+    programming_error (String_convert::form_string ("Improbable offset for grob %s: %f%s", me->name (), total_off, INTERNAL_UNIT));
   
   return scm_make_real (total_off);
 }
index b1ac31b705c45b05c2863ac7aa715c481aa04f4b..b07ed7bb0870cab8ac0aa065d28c8d9947df1d19 100644 (file)
@@ -13,8 +13,9 @@
 #include <libc-extension.hh>   // isinf
 
 #include "input-smob.hh"
-#include "font-metric.hh" 
+#include "font-metric.hh"
 #include "dimensions.hh"
+#include "string-convert.hh"
 #include "warn.hh"
 
 #include "ly-smobs.icc"
@@ -87,10 +88,13 @@ Stencil::translate (Offset o)
   Axis a = X_AXIS;
   while (a < NO_AXES)
     {
+      /* FIXME: 100CM should relate to paper size.  */
       if (abs (o[a]) > 100 CM
          || isinf (o[a]) || isnan (o[a]))
        {
-         programming_error ("Improbable offset for translation: setting to zero");
+         programming_error (String_convert::form_string ("Improbable offset for stencil: %f%s", o[a], INTERNAL_UNIT)
+                            + "\n"
+                            + "Setting to zero.");
          o[a] =  0.0;
        }
       incr (a);
@@ -103,7 +107,7 @@ Stencil::translate (Offset o)
     dim_.translate (o);
   origin_ += o;
 }
-  
+
 void
 Stencil::translate_axis (Real x, Axis a)
 {
@@ -202,7 +206,7 @@ interpret_stencil_expression (SCM expr,
         return;
 
       SCM head = scm_car (expr);
-     
+
       if (head == ly_symbol2scm ("translate-stencil"))
         {
           o += ly_scm2offset (scm_cadr (expr));
@@ -217,16 +221,15 @@ interpret_stencil_expression (SCM expr,
       else if (head == ly_symbol2scm ("grob-cause"))
        {
          SCM grob = scm_cadr (expr);
-         
+       
          (*func) (func_arg, scm_list_2 (head, grob));
          interpret_stencil_expression (scm_caddr (expr), func, func_arg, o);
          (*func) (func_arg, scm_list_1 (ly_symbol2scm ("no-origin")));
-         
-         return ; 
+         return;
        }
       else
         {
-          (*func) (func_arg, 
+          (*func) (func_arg,
                    scm_list_4 (ly_symbol2scm ("placebox"),
                                scm_make_real (o[X_AXIS]),
                                scm_make_real (o[Y_AXIS]),
@@ -249,7 +252,7 @@ find_font_function (void *fs, SCM x)
 
   if (scm_car (x) == ly_symbol2scm ("placebox"))
     {
-      SCM args = scm_cdr (x); 
+      SCM args = scm_cdr (x);
       SCM what = scm_caddr (args);
 
       if (scm_is_pair (what))
@@ -267,10 +270,10 @@ SCM
 find_expression_fonts (SCM expr)
 {
   Font_list fl;
-  
+
   fl.fonts_ = SCM_EOL;
-  
-  interpret_stencil_expression (expr, &find_font_function, 
+
+  interpret_stencil_expression (expr, &find_font_function,
                                (void*) &fl, Offset (0,0));
 
   return fl.fonts_;
index 05726b3921ff81fffb06a75e344c2ad13293f309..9b61589f21b668d6ff659449588bbd6d37a77391 100644 (file)
@@ -69,7 +69,7 @@
     #(define text-font-defaults
       `((font-encoding
         . ,(if (and (not (ly:kpathsea-find-file "ecrm10.pfa"))
-                (ly:kpathsea-find-file "cork-lm.enc")) 'cork-lm 'ec))
+                (ly:kpathsea-find-file "cork-lm.enc")) 'cork-lm 'Extended-TeX-Font-Encoding---Latin))
        (baseline-skip . 2)
        (word-space . 0.6)))
 
index 8498ef69cd646137f2e7972bfb13969beb32a60d..13970ef5b6a29d2638dd1ce04ad5b905242fa1bf 100644 (file)
@@ -88,7 +88,7 @@ vector of symbols."
         ("T1" . "tex256.enc")
         ("adobe" . "8a.enc")
         ;; EC-fonts-mftraced
-        ("ec" . "EC.enc")
+        ("Extended-TeX-Font-Encoding---Latin" . "EC.enc")
         ;; lmodern, encoding flavour latin1
         ("cork-lm" . "cork-lm.enc")
         
index 921cddeb06d9c860a02148fbb4d6d7da11d796fa..76690df7983bbe3486ba11cb1a918d1070c89753 100644 (file)
 (define-public (add-ec-fonts node factor)
   (for-each
    (lambda (x) (add-font node
-                        `((font-encoding . ec)
+                        `((font-encoding . Extended-TeX-Font-Encoding---Latin)
                           (font-series . ,(vector-ref (car x) 2))
                           (font-shape . ,(vector-ref (car x) 1))
                           (font-family . ,(vector-ref (car x) 0)))