void DrawCanvas() { var updates = new List <Rectangle>(); canvas.GraphDefaults(updates); canvas.SetTextStyle(handler.FontType, handler.TextDirection, handler.FontSize); var font = canvas.LoadFont(handler.FontType); var str = "AaBb"; var size = font.GetRealTextSize(str, handler.TextDirection, handler.FontSize); size = (canvas.WindowSize - size) / 2; size.Width = Math.Max(size.Width, 0); canvas.OutTextXY(size.Width, size.Height, str, updates); canvas.Control.Invalidate(); }
void DrawPreview() { if (canvas == null) { return; } var updates = new List <Rectangle>(); canvas.GraphDefaults(updates); canvas.SetTextStyle(SelectedFont, handler.TextDirection, fontSize); var font = canvas.LoadFont(SelectedFont); var str = "The quick brown Fox Jumps over the lazy dog"; var size = font.GetRealTextSize(str, handler.TextDirection, fontSize); size = (canvas.WindowSize - size) / 2; size.Width = Math.Max(size.Width, 0); canvas.OutTextXY(size.Width, size.Height, str, updates); canvas.Control.Invalidate(); }