@end ignore
+@item
+An argument, @code{-dcrop}, has been added, formatting @code{SVG} and
+@code{PDF} output without margins or page-breaks.
+
@item
It is now possible to move systems with reference to their current
position using the @code{extra-offset} subproperty of
block. See @ruser{Extracting fragments of music}. No fragments are
extracted though if used with the @option{-dno-print-pages} option.
+@item @code{crop}
+@tab @code{#f}
+@tab Match the size of the normal output to the typeset image.
+
@item @code{datadir}
@tab
@tab Prefix for data files (read-only).
@item @code{print-pages}
@tab @code{#t}
@tab Generate full pages, the default. @option{-dno-print-pages} is
-useful in combination with @option{-dpreview}.
+useful in combination with @option{-dpreview} or @option{-dcrop}.
@item @code{profile-property-accesses}
@tab @code{#f}
warning (_f ("program option -dpreview not supported by backend `%s'",
get_output_backend_name ()));
}
+
+ if (get_program_option ("crop"))
+ {
+ SCM framework
+ = ly_module_lookup (mod, ly_symbol2scm ("output-crop-framework"));
+
+ if (scm_is_true (framework))
+ {
+ SCM func = scm_variable_ref (framework);
+ scm_call_4 (func,
+ output_channel,
+ self_scm (),
+ scopes,
+ dump_fields ());
+ }
+ else
+ warning (_f ("program option -dcrop not supported by backend `%s'",
+ get_output_backend_name ()));
+ }
}
void
#t
)))
+(define-public (output-crop-framework basename book scopes fields)
+ (let* ((paper (ly:paper-book-paper book))
+ (systems (relevant-book-systems book)))
+ (dump-stencil-as-EPS paper
+ (stack-stencils Y DOWN 0.0
+ (map paper-system-stencil
+ (reverse (reverse systems))))
+ (format #f "~a.cropped" basename)
+ #t)
+ (postprocess-output book framework-ps-module
+ (cons "png" (ly:output-formats))
+ (format #f "~a.cropped" basename)
+ (format #f "~a.cropped.eps" basename)
+ #t
+ )))
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (output-width-height defs)
(map paper-system-stencil
(reverse to-dump-systems)))
(format #f "~a.preview.svg" basename))))
+
+(define (output-crop-framework basename book scopes fields)
+ (let* ((paper (ly:paper-book-paper book))
+ (systems (relevant-book-systems book))
+ (page-stencils (stack-stencils Y DOWN 0.0
+ (map paper-system-stencil
+ (reverse (reverse systems))))))
+ (dump-preview paper page-stencils (format #f "~a.cropped.svg" basename))))
(clip-systems
#f
"Generate cut-out snippets of a score.")
+ (crop
+ #f
+ "Match the size of the normal output to the typeset image.")
(datadir
#f
"LilyPond prefix for data files (read-only).")