CVSROOT: /cvsroot/lilypond
Module name: lilypond
Branch:
Changes by: Han-Wen Nienhuys <[EMAIL PROTECTED]> 05/09/05 13:52:40
Modified files:
. : ChangeLog
lily : accidental.cc
lily/include : stencil.hh
scm : framework-eps.scm
Log message:
(dump-stencils-as-EPSes): cleanup.
(widen-left-stencil-edges): new function.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/ChangeLog.diff?tr1=1.4109&tr2=1.4110&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/accidental.cc.diff?tr1=1.62&tr2=1.63&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/include/stencil.hh.diff?tr1=1.20&tr2=1.21&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/scm/framework-eps.scm.diff?tr1=1.13&tr2=1.14&r1=text&r2=text
Patches:
Index: lilypond/ChangeLog
diff -u lilypond/ChangeLog:1.4109 lilypond/ChangeLog:1.4110
--- lilypond/ChangeLog:1.4109 Sun Sep 4 22:18:45 2005
+++ lilypond/ChangeLog Mon Sep 5 13:52:39 2005
@@ -1,5 +1,8 @@
2005-09-05 Han-Wen Nienhuys <[EMAIL PROTECTED]>
+ * scm/framework-eps.scm (dump-stencils-as-EPSes): cleanup.
+ (widen-left-stencil-edges): new function.
+
* lily/text-interface.cc (interpret_markup): use abort().
2005-09-04 Han-Wen Nienhuys <[EMAIL PROTECTED]>
Index: lilypond/lily/accidental.cc
diff -u lilypond/lily/accidental.cc:1.62 lilypond/lily/accidental.cc:1.63
--- lilypond/lily/accidental.cc:1.62 Thu Aug 18 09:55:08 2005
+++ lilypond/lily/accidental.cc Mon Sep 5 13:52:40 2005
@@ -23,8 +23,12 @@
Stencil
parenthesize (Grob *me, Stencil m)
{
- Stencil open = Font_interface::get_default_font (me)->find_by_name
("accidentals.leftparen");
- Stencil close = Font_interface::get_default_font (me)->find_by_name
("accidentals.rightparen");
+ Font_metric * font
+ = Font_interface::get_default_font (me);
+ Stencil open
+ = font->find_by_name ("accidentals.leftparen");
+ Stencil close
+ = font->find_by_name ("accidentals.rightparen");
m.add_at_edge (X_AXIS, LEFT, Stencil (open), 0, 0);
m.add_at_edge (X_AXIS, RIGHT, Stencil (close), 0, 0);
Index: lilypond/lily/include/stencil.hh
diff -u lilypond/lily/include/stencil.hh:1.20
lilypond/lily/include/stencil.hh:1.21
--- lilypond/lily/include/stencil.hh:1.20 Fri Aug 12 00:04:45 2005
+++ lilypond/lily/include/stencil.hh Mon Sep 5 13:52:40 2005
@@ -45,8 +45,6 @@
*/
class Stencil
{
- friend SCM ly_stencil_set_extent_x (SCM, SCM, SCM);
-
/*
This provides the reference point of the symbol, for example with
characters, it is on the base line of the character. Usually,
@@ -81,10 +79,6 @@
Box extent_box () const;
bool is_empty () const;
Stencil in_color (Real r, Real g, Real b) const;
-
- static SCM ly_get_stencil_extent (SCM mol, SCM axis);
- static SCM ly_set_stencil_extent_x (SCM, SCM, SCM);
- static SCM ly_stencil_combined_at_edge (SCM, SCM, SCM, SCM, SCM);
};
DECLARE_UNSMOB (Stencil, stencil);
Index: lilypond/scm/framework-eps.scm
diff -u lilypond/scm/framework-eps.scm:1.13 lilypond/scm/framework-eps.scm:1.14
--- lilypond/scm/framework-eps.scm:1.13 Wed Aug 31 13:20:23 2005
+++ lilypond/scm/framework-eps.scm Mon Sep 5 13:52:40 2005
@@ -20,6 +20,28 @@
(define framework-eps-module (current-module))
+
+(define (widen-left-stencil-edges stencils)
+ "Change STENCILS to use the union for the left extents in every
+stencil, so LaTeX includegraphics doesn't fuck up the alignment."
+
+ (define left
+ (apply min
+ (map (lambda (stc)
+ (interval-start (ly:stencil-extent stc X)))
+ stencils)))
+
+ (map (lambda (stil)
+
+ (ly:make-stencil
+ (ly:stencil-expr stil)
+ (cons
+ left
+ (cdr (ly:stencil-extent stil X)))
+ (ly:stencil-extent stil Y)
+ ))
+ stencils))
+
(define (dump-stencils-as-EPSes stencils book basename)
(define paper (ly:paper-book-paper book))
(define (dump-infinite-stack-EPS stencils)
@@ -37,7 +59,9 @@
(ly:output-def-lookup paper 'force-eps-font-include))
(dump-stencils-as-separate-EPS rest (1+ count)))))
-
+
+
+ ;; main body
(let* ((tex-system-name (format "~a-systems.tex" basename))
(texi-system-name (format "~a-systems.texi" basename))
(tex-system-port (open-output-file tex-system-name))
@@ -45,21 +69,24 @@
(ly:message (_ "Writing ~a...") tex-system-name)
(ly:message (_ "Writing ~a...") texi-system-name)
+
+ (set! stencils (widen-left-stencil-edges stencils))
+
(dump-stencils-as-separate-EPS stencils 1)
(for-each (lambda (c)
(if (< 0 c)
- (begin
- (display "\\ifx\\betweenLilyPondSystem \\undefined\n"
tex-system-port)
- (display " \\linebreak\n" tex-system-port)
- (display "\\else\n" tex-system-port)
- (display (format
- " \\betweenLilyPondSystem{~a}\n" c)
tex-system-port)
- (display "\\fi\n" tex-system-port)))
+ (display (format "\\ifx\\betweenLilyPondSystem \\undefined
+ \\linebreak
+\\else
+ \\betweenLilyPondSystem{~a}
+\\fi
+" c) tex-system-port))
(display (format "\\includegraphics{~a-~a.eps}\n"
basename (1+ c)) tex-system-port)
(display (format "@image{~a-~a}\n"
basename (1+ c)) texi-system-port))
(iota (length stencils)))
+
(display "@c eof - 'eof' is a Makefile marker; do not remove. "
texi-system-port)
(display "% eof - 'eof' is Makefile marker; do not remove. "
tex-system-port)
_______________________________________________
Lilypond-cvs mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-cvs