/// <summary> /// Generates the shapes corresponding the glyphs described by the font and with the setting in within the FontSpan along the described path. /// </summary> /// <param name="text">The text to generate glyphs for.</param> /// <param name="path">The path to draw the text in relation to.</param> /// <param name="style">The style and settings to use while rendering the glyphs.</param> /// <returns>The <see cref="PathCollection"/></returns> public static IPathCollection GenerateGlyphs(ReadOnlySpan <char> text, IPath path, RendererOptions style) { var glyphBuilder = new PathGlyphBuilder(path); TextRenderer.RenderText(glyphBuilder, text, style); return(glyphBuilder.BuildPath()); }
/// <summary> /// Generates the shapes corresponding the glyphs described by the font and with the setting in within the FontSpan along the described path. /// </summary> /// <param name="text">The text to generate glyphs for</param> /// <param name="path">The path to draw the text in relation to</param> /// <param name="style">The style and settings to use while rendering the glyphs</param> /// <returns>The <see cref="IPathCollection"/></returns> public static IPathCollection GenerateGlyphs(string text, IPath path, RendererOptions style) { PathGlyphBuilder glyphBuilder = new PathGlyphBuilder(path); TextRenderer renderer = new TextRenderer(glyphBuilder); renderer.RenderText(text, style); return(glyphBuilder.Paths); }