Issue 4678: Fix spaces in metronome mark (issue 323420043 by beauleetienne0@gmail.com)

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Issue 4678: Fix spaces in metronome mark (issue 323420043 by beauleetienne0@gmail.com)

beauleetienne0
Reviewers: ,

Message:
Even though this part is fixed, it would be important to combine all
consecutive
text parts of the tempo indication into one <text> tag. This would make
the
output neater, as there can be a very wide gap between the text and
metronome
mark, and the excessive space before the last bracket (as seen in the
issue).

With those issues out of the way, it should be easier to fix the more
important
bug: https://sourceforge.net/p/testlilyissues/issues/3778/

Thank you for reviewing this patch and for improving the SVG
functionality.

Description:
Issue 4678: Fix spaces in metronome mark

This change specifies the types of spaces used in the metronome
markings as comments. It also changes the type of space to non-breaking
around the equals sign. The change also improves readability by
combining chars into strings.

Please review this at https://codereview.appspot.com/323420043/

Affected files (+4, -6 lines):
   M scm/translation-functions.scm


Index: scm/translation-functions.scm
diff --git a/scm/translation-functions.scm b/scm/translation-functions.scm
index  
0ed0deff0a24817edc4f53b42fb902313f0e75bc..e911b7c3c5f5209266f282034301e9d0a8f4160f  
100644
--- a/scm/translation-functions.scm
+++ b/scm/translation-functions.scm
@@ -65,9 +65,8 @@ way the transposition number is displayed."
                                 (list
                                  (make-simple-markup
                                          (number->string (car count)))
-                                (make-simple-markup " ")
-                                (make-simple-markup "–")
-                                (make-simple-markup " ")
+                                ; Spaces are thin U+2009
+                                (make-simple-markup " - ")
                                  (make-simple-markup
                                          (number->string (cdr count))))))
                               (else #f)))
@@ -75,9 +74,8 @@ way the transposition number is displayed."
                            (make-concat-markup
                             (list
                              (make-general-align-markup Y DOWN note-mark)
-                            (make-simple-markup " ")
-                            (make-simple-markup "=")
-                            (make-simple-markup " ")
+                            ; Spaces are non-breaking U+00A0
+                            (make-simple-markup " = ")
                              count-markup))
                            #f))
           (text-markup (if (not (null? text))


_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
dak
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Issue 4678: Fix spaces in metronome mark (issue 323420043 by beauleetienne0@gmail.com)

dak
Uh, isn't that just skirting the issue?  SVG text generation has a bug
swallowing spaces and instead of fixing that, one instance of space use
rather uses something else?

That sounds like a bottomless barrel.  Shouldn't we rather try to fix
the actual problem?  I mean, it will occur for user-generated texts
anyway.

https://codereview.appspot.com/323420043/

_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Issue 4678: Fix spaces in metronome mark (issue 323420043 by beauleetienne0@gmail.com)

beauleetienne0
In reply to this post by beauleetienne0
On 2017/08/16 22:03:31, dak wrote:
> Uh, isn't that just skirting the issue?  SVG text generation has a bug
> swallowing spaces and instead of fixing that, one instance of space
use rather
> uses something else?

> That sounds like a bottomless barrel.  Shouldn't we rather try to fix
the actual
> problem?  I mean, it will occur for user-generated texts anyway.

No, this behaviour is documented and is part of the SVG standard. The
non-breaking space is the correct character to use here, and so this is
not just skirting the issue. The issue was the incorrect use of normal
spaces. In user-generated texts, this character might also be the
correct one, I don't see what you mean. Sorry I didn't see this sooner;
didn't get any notification.

https://codereview.appspot.com/323420043/

_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
dak
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Issue 4678: Fix spaces in metronome mark (issue 323420043 by beauleetienne0@gmail.com)

dak
In reply to this post by beauleetienne0
On 2017/08/17 19:59:30, Ebe123 wrote:
> On 2017/08/16 22:03:31, dak wrote:
> > Uh, isn't that just skirting the issue?  SVG text generation has a
bug
> > swallowing spaces and instead of fixing that, one instance of space
use rather
> > uses something else?
> >
> > That sounds like a bottomless barrel.  Shouldn't we rather try to
fix the
> actual
> > problem?  I mean, it will occur for user-generated texts anyway.

> No, this behaviour is documented and is part of the SVG standard. The
> non-breaking space is the correct character to use here, and so this
is not just
> skirting the issue. The issue was the incorrect use of normal spaces.
In
> user-generated texts, this character might also be the correct one, I
don't see
> what you mean. Sorry I didn't see this sooner; didn't get any
notification.

The SVG standard does _not_ determine what we can place in markup.  If
our translation from markup to SVG loses spaces, we need to fix that
conversion, not avoid using spaces in markups.

https://codereview.appspot.com/323420043/

_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Issue 4678: Fix spaces in metronome mark (issue 323420043 by beauleetienne0@gmail.com)

beauleetienne0
In reply to this post by beauleetienne0
We are not losing spaces, the standard is to ignore trailing whitespace,
such as line-breaks and (breaking) spaces at the beginning of tabs. We
are still using normal spaces where appropriate (such as the second
space on line 78). Our translation from markup to SVG does have issues
(see issues 5174 and 5011 as examples), but our translation does not
lose spaces; it actually adds unnecessary but unproblematic whitespace,
like the newline at the beginning of each <tspan tag. This is not a
bottomless barrel.

I see that you are interested in another possible solution, outlined in
issue 1434. I've just made a patch to that effect:
http://codereview.appspot.com/321460043. And so, I'll close this issue.

https://codereview.appspot.com/323420043/

_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
dak
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Issue 4678: Fix spaces in metronome mark (issue 323420043 by beauleetienne0@gmail.com)

dak
In reply to this post by beauleetienne0
On 2017/08/18 03:50:30, Ebe123 wrote:
> We are not losing spaces, the standard is to ignore trailing
whitespace, such as
> line-breaks and (breaking) spaces at the beginning of tabs.

If we represent a space in markup by something in XML (never mind
whether or not it looks like a space character) that is ignored, we
_are_ losing spaces.  You are confusing the payload with the file
representation.  When we output stuff to XML, we need to quote it
appropriately.  We do so for metacharacters like < & but it would appear
that we also need to treat spaces in certain situations different from
what we do.

https://codereview.appspot.com/323420043/

_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Loading...