]> git.donarmstrong.com Git - lilypond.git/commitdiff
(wordwrap-string): use
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 25 Aug 2005 15:15:41 +0000 (15:15 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 25 Aug 2005 15:15:41 +0000 (15:15 +0000)
text-direction
(wordwrap-stencils): idem.
(line): idem..
(fill-line): idem.
(wordwrap-stencils): translate last line to right for
text-direction = LEFT.

ChangeLog
lily/pango-font.cc
scm/define-markup-commands.scm

index e214fa8de94370b3c16920f6a9079a80d995f32c..e9504e3d7eef25f129851f55759e1931c051ad61 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,8 @@
        (wordwrap-stencils): idem.
        (line): idem..
        (fill-line): idem.
+       (wordwrap-stencils): translate last line to right for
+       text-direction = LEFT.
 
        * scm/define-grob-properties.scm (all-user-grob-properties): add
        text-direction.
index 384593bd0d1fa971c09717d51fc628b5c1ec7338..7f76168ee120be5884d8c5ff4790a2b4d7f21b19 100644 (file)
@@ -221,11 +221,23 @@ Pango_font::text_stencil (String str) const
 
       Stencil item_stencil = pango_item_string_stencil (item, str, x);
 
+
       /*
       UGH. Is this correct for bidi? 
       */
       x = item_stencil.extent (X_AXIS)[RIGHT];
 
+#if 0 /* Check extents.  */
+      if (!item_stencil.extent_box ()[X_AXIS].is_empty ())
+       {
+         Stencil frame = Lookup::frame (item_stencil.extent_box (), 0.1, 0.1);
+         Box empty;
+         empty.set_empty ();
+         Stencil dimless_frame (empty, frame.expr ());
+         dest.add_stencil (frame);
+       }
+#endif
+  
       dest.add_stencil (item_stencil);
 
       ptr = ptr->next;
@@ -254,16 +266,6 @@ Pango_font::text_stencil (String str) const
       return Stencil (b, exp);
     }
 
-#if 0 /* Check extents.  */
-  if (!dest.extent_box ()[X_AXIS].is_empty ())
-    {
-      Stencil frame = Lookup::frame (dest.extent_box (), 0.1, 0.1);
-      Box empty;
-      empty.set_empty ();
-      Stencil dimless_frame (empty, frame.expr ());
-      dest.add_stencil (frame);
-    }
-#endif
 
   return dest;
 }
index c1194e36b903096e4df364f405eb921339b68d15..52e974ac506295398233de7cabcad91fff0540e9 100644 (file)
@@ -465,8 +465,15 @@ determines the space between each markup in @var{args}."
            (loop (cons line lines)
                  (cdr line-break))
 
-           (reverse (cons line lines))
-           ))
+           (begin
+             (if (= text-dir LEFT)
+                 (set! line
+                       (ly:stencil-translate-axis line
+                                                  (- line-width (interval-end (ly:stencil-extent line X)))
+                                                  X)))
+             (reverse (cons line lines))
+             
+           )))
 
       ))