public static void DrawToFile(VisualiseOptions visualiseOptions, Func<IEnumerable<SizeF>, Rectangle, IEnumerable<Rectangle>> arrangeRectangles, IEnumerable<WordModel> wordModels)
 {
     if (visualiseOptions.OutputName == null)
         throw new ArgumentException("File name was not set");
     var image = new Bitmap(visualiseOptions.W, visualiseOptions.H);
     var graphics = Graphics.FromImage(image);
     graphics.TextRenderingHint = TextRenderingHint.AntiAliasGridFit;
     Draw(graphics, new Rectangle(0, 0, visualiseOptions.W, visualiseOptions.H), arrangeRectangles, wordModels, visualiseOptions.FontName);
     image.Save(visualiseOptions.OutputName, ImageFormat.Png);
 }
 public static void DrawToForm(VisualiseOptions visualiseOptions, Func<IEnumerable<SizeF>, Rectangle, IEnumerable<Rectangle>> arrangeRectangles, IEnumerable<WordModel> wordModels)
 {
     var form = new Form {Size = new Size(visualiseOptions.W, visualiseOptions.H)};
     form.Paint += (sender, args) => Draw(args.Graphics, args.ClipRectangle, arrangeRectangles, wordModels, visualiseOptions.FontName);
     form.ShowDialog();
 }