从原始文本字符串制作几何体可以将System.Windows.Media.FormattedText类与BuildGeometry()方法一起使用
public string Text2Path()
{
FormattedText formattedText = new System.Windows.Media.FormattedText("Any text you like",
CultureInfo.GetCultureInfo("en-us"),
FlowDirection.LeftToRight,
new Typeface(
new FontFamily(),
FontStyles.Italic,
FontWeights.Bold,
FontStretches.Normal),
16, Brushes.Black);
Geometry geometry = formattedText.BuildGeometry(new Point(0, 0));
System.Windows.Shapes.Path path = new System.Windows.Shapes.Path();
path.Data = geometry;
string geometryAsString = geometry.GetFlattenedPathGeometry().ToString().Replace(",",".").Replace(";",",");
return geometryAsString;
}