[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Bar line interface
From: |
Marc Hohl |
Subject: |
Bar line interface |
Date: |
Wed, 29 Aug 2012 11:45:43 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0 |
Hello list,
I just uploaded part 2/2 of the "Great Bar Line Interface Project",
see
http://codereview.appspot.com/6498052
I hope that it is understandable what I have done, but since the
description of the patch is rather short, I'll give an overview:
* the input string of a bar line called by \bar "<bar string>"
resembles 1:1 the output, so ":|" would be a repeat colon folllowed by
a thin line, nothing else. So a proper repeat sign looks like ":|."
from now on.
* by (define-bar-line ...) or \defineBarLine one can easily define
more bar line styles. these functions have four arguments, namely
the bar line itself, the bar line used at the end of line, the
bar line used at the begin of a new line and the span bar line.
\barLine bar-glyph end-of-line begin-of-line span-bar
For example, the repeat sign is defined by
(define-bar-line ".|:" "|" ".|:" ".|")
* There is the possibity to use annotations for barlines to
distinguish between two identical barlines with different break
apperance or span bar lines.
(define-bar-line "|" "|" "" "|")
(define-bar-line "|-withDashedSpanBar" "|" "" "!")
The annotation sign is the "-".
* To align span bars properly, the space character " " has a
special meaning. When it occurs, the width of the resembling
glyph in the bar line definition is used.
(define-bar-line ":|." ":|." "" " |.")
Notice the space in the span bar definition; it inserts an
invisible spacer which is as wide as the ":" stencil to
make the span bar align properly.
* The computation of the bar line anchor has greatly improved (in my
opinion).
Whereas the former routine used hardcoded string comparison for taking
repeat dots into account, the calculation is automated and
water-proof (I think).
* New glyphs could easily be added, as the regtest shows. The stencil
function
must have the form (make-...-bar-line grob extent), even if the extent is
not used in the drawing process.
Most probably this should be documented somewhere, but I didn't want to
put this in the patch, because
1) I was too lazy finding the proper place for this
2) I think the patch is big enough without it
Regards,
Marc
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Bar line interface,
Marc Hohl <=