]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/paper-book.cc
Add '-dcrop' option to ps and svg backends
[lilypond.git] / lily / paper-book.cc
index 3a672198b538df5a880c19b1032db80adb1af946..f1787e99550f2bb09eb001188b69384c69e5f004 100644 (file)
@@ -219,6 +219,25 @@ Paper_book::output (SCM output_channel)
         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
@@ -514,7 +533,7 @@ Paper_book::get_system_specs ()
               SCM footnotes = get_footnotes (unsmob<Stencil> (t)->expr ());
               ps->set_property ("footnotes", footnotes);
               ps->set_property ("is-title", SCM_BOOL_T);
-              if (list == texts)
+              if (scm_is_eq (list, texts))
                 first = ps;
               else
                 {