method load ~filename =
if not (MathView.load obj ~filename) then raise (ErrorLoadingFile filename)
method unload = MathView.unload obj
- method has_selection = MathView.has_selection obj
method get_selection = MathView.get_selection obj
- method set_selection node = MathView.set_selection obj node
- method reset_selection = MathView.reset_selection obj
+ method set_selection (node : Ominidom.o_mDOMNode option) = MathView.set_selection obj node
method get_width = MathView.get_width obj
method get_height = MathView.get_height obj
method get_top = MathView.get_top obj
method get_kerning = MathView.get_kerning obj
method set_log_verbosity = MathView.set_log_verbosity obj
method get_log_verbosity = MathView.get_log_verbosity obj
- method export_to_postscript ~width ~height ~x_margin ~y_margin ~disable_colors ~filename =
- if not (MathView.export_to_postscript obj ~width ~height ~x_margin ~y_margin ~disable_colors ~filename) then
- raise (ErrorWritingFile filename)
+ method export_to_postscript
+ ?(width = 595) ?(height = 822) ?(x_margin = 72) ?(y_margin = 72)
+ ?(disable_colors = false) ~filename () =
+ let result = MathView.export_to_postscript obj
+ ~width ~height ~x_margin ~y_margin ~disable_colors ~filename
+ in
+ if not result then raise (ErrorWritingFile filename)
method get_font_manager_type = MathView.get_font_manager_type obj
method set_font_manager_type ~fm_type = MathView.set_font_manager_type obj ~fm_type
end
-let math_view ?adjustmenth ?adjustmentv ?border_width
- ?width ?height ?packing ?show ()
-=
+let math_view ?adjustmenth ?adjustmentv ?font_size ?font_manager ?border_width
+ ?width ?height ?packing ?show () =
let w =
MathView.create
?adjustmenth:(may_map ~f:GData.as_adjustment adjustmenth)
()
in
Container.set w ?border_width ?width ?height;
- pack_return (new math_view w) ~packing ~show
+ let mathview = pack_return (new math_view w) ~packing ~show in
+ begin
+ match font_size with
+ | Some size -> mathview#set_font_size size
+ | None -> ()
+ end;
+ begin
+ match font_manager with
+ | Some manager -> mathview#set_font_manager_type ~fm_type:manager
+ | None -> ()
+ end;
;;