This commit is contained in:
Scott Williams 2017-05-30 22:26:02 +01:00
Родитель c1544b9325
Коммит 1a89e858c6
1 изменённых файлов: 15 добавлений и 3 удалений

Просмотреть файл

@ -7,7 +7,7 @@ using System.Text;
namespace SixLabors.Shapes
{
/// <summary>
/// <summary>
/// Text drawing extensions for a PathBuilder
/// </summary>
public static class TextBuilder
@ -16,11 +16,12 @@ namespace SixLabors.Shapes
/// Generates the shapes corresponding the glyphs described by the font and with the setting ing withing the FontSpan
/// </summary>
/// <param name="text">The text to generate glyphs for</param>
/// <param name="location">The location</param>
/// <param name="style">The style and settings to use while rendering the glyphs</param>
/// <returns></returns>
public static IPathCollection GenerateGlyphs(string text, FontSpan style)
public static IPathCollection GenerateGlyphs(string text, Vector2 location, FontSpan style)
{
var glyphBuilder = new GlyphBuilder();
var glyphBuilder = new GlyphBuilder(location);
TextRenderer renderer = new TextRenderer(glyphBuilder);
@ -28,6 +29,17 @@ namespace SixLabors.Shapes
return new PathCollection(glyphBuilder.Paths);
}
/// <summary>
/// Generates the shapes corresponding the glyphs described by the font and with the setting ing withing the FontSpan
/// </summary>
/// <param name="text">The text to generate glyphs for</param>
/// <param name="style">The style and settings to use while rendering the glyphs</param>
/// <returns></returns>
public static IPathCollection GenerateGlyphs(string text, FontSpan style)
{
return GenerateGlyphs(text, Vector2.Zero, style);
}
}
}