-
Notifications
You must be signed in to change notification settings - Fork 1
/
TextToGeometryConverter.cs
37 lines (32 loc) · 1.21 KB
/
TextToGeometryConverter.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System;
using System.Globalization;
using Windows.Foundation;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Documents;
using Windows.UI.Xaml.Media;
namespace WhimsyEarlierLiteracy
{
public class TextToGeometryConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)
{
if (value == null) return null;
var fontsize = int.Parse((string)parameter);
CultureInfo info = CultureInfo.CurrentUICulture;
var flowDirection = FlowDirection.LeftToRight;
var fontFamily = new FontFamily((string)Application.Current.Resources["DefaultFontFamily"]);
var path = new GeometryGroup();
double scale = fontsize/(double)32;
var point = new Point();
return path;
}
private void RenderFragment(object font, double scale, ref object offsetX, object offsetY, ref object curPoint, string renderText)
{
}
public object ConvertBack(object value, Type targetType, object parameter, string language)
{
throw new NotImplementedException();
}
}
}