OLD | NEW |
1 ;;;; This file is part of LilyPond, the GNU music typesetter. | 1 ;;;; This file is part of LilyPond, the GNU music typesetter. |
2 ;;;; | 2 ;;;; |
3 ;;;; Copyright (C) 2004--2019 Jan Nieuwenhuizen <janneke@gnu.org> | 3 ;;;; Copyright (C) 2004--2019 Jan Nieuwenhuizen <janneke@gnu.org> |
4 ;;;; Patrick McCarty <pnorcks@gmail.com> | 4 ;;;; Patrick McCarty <pnorcks@gmail.com> |
5 ;;;; | 5 ;;;; |
6 ;;;; LilyPond is free software: you can redistribute it and/or modify | 6 ;;;; LilyPond is free software: you can redistribute it and/or modify |
7 ;;;; it under the terms of the GNU General Public License as published by | 7 ;;;; it under the terms of the GNU General Public License as published by |
8 ;;;; the Free Software Foundation, either version 3 of the License, or | 8 ;;;; the Free Software Foundation, either version 3 of the License, or |
9 ;;;; (at your option) any later version. | 9 ;;;; (at your option) any later version. |
10 ;;;; | 10 ;;;; |
(...skipping 11 matching lines...) Expand all Loading... |
22 ;;;; | 22 ;;;; |
23 ;;;; Working draft: | 23 ;;;; Working draft: |
24 ;;;; http://www.w3.org/TR/SVGPrint/ -- for <pageSet> and <page> | 24 ;;;; http://www.w3.org/TR/SVGPrint/ -- for <pageSet> and <page> |
25 | 25 |
26 ;;;; TODO: | 26 ;;;; TODO: |
27 ;;;; * Once <pageSet> and <page> are supported by Inkscape and | 27 ;;;; * Once <pageSet> and <page> are supported by Inkscape and |
28 ;;;; other user agents, add a -d option (-dsvg-multiple-page) | 28 ;;;; other user agents, add a -d option (-dsvg-multiple-page) |
29 ;;;; that will create a single SVG file containing all pages | 29 ;;;; that will create a single SVG file containing all pages |
30 ;;;; of output. --pmccarty | 30 ;;;; of output. --pmccarty |
31 | 31 |
32 (define-module (scm framework-svg)) | 32 (define-module (scm-modules framework-svg)) |
33 | 33 |
34 (use-modules | 34 (use-modules |
35 (guile) | 35 (guile) |
36 (lily) | 36 (lily) |
37 (scm page) | 37 (scm-modules page) |
38 (scm paper-system) | 38 (scm-modules paper-system) |
39 (scm output-svg) | 39 (scm-modules output-svg) |
40 (scm clip-region) | 40 (scm-modules clip-region) |
41 (srfi srfi-1) | 41 (srfi srfi-1) |
42 (srfi srfi-2) | 42 (srfi srfi-2) |
43 (srfi srfi-13) | 43 (srfi srfi-13) |
44 (ice-9 regex)) | 44 (ice-9 regex)) |
45 | 45 |
46 (define format ergonomic-simple-format) | 46 (define format ergonomic-simple-format) |
47 | 47 |
48 (define (svg-begin . rest) | 48 (define (svg-begin . rest) |
49 (string-append | 49 (string-append |
50 (eo 'svg #t | 50 (eo 'svg #t |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 (format #f "~a.preview.svg" basename)))) | 320 (format #f "~a.preview.svg" basename)))) |
321 | 321 |
322 (define (output-crop-framework basename book scopes fields) | 322 (define (output-crop-framework basename book scopes fields) |
323 (let* ((paper (ly:paper-book-paper book)) | 323 (let* ((paper (ly:paper-book-paper book)) |
324 (systems (relevant-book-systems book)) | 324 (systems (relevant-book-systems book)) |
325 (page-stencils (stack-stencils Y DOWN 0.0 | 325 (page-stencils (stack-stencils Y DOWN 0.0 |
326 (map paper-system-stencil | 326 (map paper-system-stencil |
327 (reverse (reverse systems)))))) | 327 (reverse (reverse systems)))))) |
328 (if (ly:get-option 'clip-systems) (clip-system-SVG basename book)) | 328 (if (ly:get-option 'clip-systems) (clip-system-SVG basename book)) |
329 (dump-preview paper page-stencils (format #f "~a.cropped.svg" basename)))) | 329 (dump-preview paper page-stencils (format #f "~a.cropped.svg" basename)))) |
OLD | NEW |