From: Han-Wen Nienhuys Date: Thu, 25 Aug 2005 15:15:41 +0000 (+0000) Subject: (wordwrap-string): use X-Git-Tag: release/2.7.8~17 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=81936d3c83e65b547b67ce5be365cec295fb3fca;p=lilypond.git (wordwrap-string): use text-direction (wordwrap-stencils): idem. (line): idem.. (fill-line): idem. (wordwrap-stencils): translate last line to right for text-direction = LEFT. --- diff --git a/ChangeLog b/ChangeLog index e214fa8de9..e9504e3d7e 100644 --- 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. diff --git a/lily/pango-font.cc b/lily/pango-font.cc index 384593bd0d..7f76168ee1 100644 --- a/lily/pango-font.cc +++ b/lily/pango-font.cc @@ -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; } diff --git a/scm/define-markup-commands.scm b/scm/define-markup-commands.scm index c1194e36b9..52e974ac50 100644 --- a/scm/define-markup-commands.scm +++ b/scm/define-markup-commands.scm @@ -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)) + + ))) ))