X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fmatita%2FmatitaMathView.ml;h=f772a84ed4b85e44eb835013d8270979ecff20fc;hb=ac45365fea68bc3ce11afe76bc7595e53b235777;hp=ad0a66294db314ff2ac47be9c59e45b2ee9df6ea;hpb=590b41b39d52ae1e320bf1c01220b06fadb1ba8d;p=helm.git diff --git a/helm/software/matita/matitaMathView.ml b/helm/software/matita/matitaMathView.ml index ad0a66294..f772a84ed 100644 --- a/helm/software/matita/matitaMathView.ml +++ b/helm/software/matita/matitaMathView.ml @@ -1576,10 +1576,7 @@ let mathViewer () = method show_uri_list ?(reuse=false) ~entry l = (self#get_browser reuse)#load entry - method screenshot status sequent metasenv subst (filename as ofn) = - let mathml = - ApplyTransformation.nmml_of_cic_sequent status metasenv subst sequent - in + method screenshot status sequents metasenv subst (filename as ofn) = let w = GWindow.window ~title:"screenshot" () in let width = 600 in let height = 2000 in @@ -1589,16 +1586,39 @@ let mathViewer () = ~show:true () in w#show (); - m#load_root ~root:mathml#get_documentElement; - let pixmap = m#get_buffer in - let pixbuf = GdkPixbuf.create ~width ~height () in - GdkPixbuf.get_from_drawable ~dest:pixbuf pixmap; - let filename = filename ^ "-raw.png" in - GdkPixbuf.save ~filename ~typ:"png" pixbuf; + let filenames = + HExtlib.list_mapi + (fun sequent i -> + let mathml = + ApplyTransformation.nmml_of_cic_sequent + status metasenv subst sequent + in + m#load_root ~root:mathml#get_documentElement; + let pixmap = m#get_buffer in + let pixbuf = GdkPixbuf.create ~width ~height () in + GdkPixbuf.get_from_drawable ~dest:pixbuf pixmap; + let filename = + filename ^ "-raw" ^ string_of_int i ^ ".png" + in + GdkPixbuf.save ~filename ~typ:"png" pixbuf; + filename) + sequents + in + let items = + List.map (fun x -> + Printf.sprintf + " '(' -trim -border 3 -bordercolor white %s ')' " + (Filename.quote x)) + filenames + in ignore(Sys.command (Printf.sprintf - "convert -trim -border 3 -bordercolor white %s %s" - (Filename.quote filename) + "convert %s +append %s" + (String.concat (" '(' -gravity center -size 9x150 xc: "^ + "-draw \"line 5,0 5,48\" "^ + "-draw \"line 5,52 5,98\" " ^ + "-draw \"line 5,102 5,150\" " ^ " ')'") items) (Filename.quote (ofn ^ ".png")))); + List.iter Sys.remove filenames; w#destroy (); end