/// <summary> /// Draw a block of text on the canvas. /// </summary> /// <returns>The bounds of the painted text. Note that the returned rectangle's Width is equal to the input (IE only bottom is calculated). Use TextBlock.Measure to get text bounds</returns> public static SKRect DrawTextBlock(this SKCanvas canvas, TextBlock text, SKRect rect, TextShaper textShaper = null, FlowDirection flowDirection = FlowDirection.LeftToRight) { return(text.Draw(canvas, rect, textShaper, flowDirection)); }
/// <summary> /// Draw a text block /// </summary> public static SKRect DrawTextBlock(this SKCanvas canvas, string text, SKRect rect, Font font, SKColor color, TextShaper textShaper = null) { var textblock = new TextBlock(font, color, text); return(DrawTextBlock(canvas, textblock, rect, textShaper)); }