Create WPFFont from System.Windows.Media.FontFamily?
Moderator: Queue Moderators
Create WPFFont from System.Windows.Media.FontFamily?
Is it possible to create a WPFFont object from a System.Windows.Media.FontFamily instead of a System.Drawing.FontFamily? The two don't seem to have equivalent lookup tables for the FontFamily name and in my project all of our fonts are selected from the System.Windows.Media collection.
-
- Posts: 42
- Joined: Thu Mar 28, 2013 9:20 am
Re: Create WPFFont from System.Windows.Media.FontFamily?
There is no such constructor for now.
You could try following kind of code to get FontFamily from System.Windows.Media.FontFamily:
You could try following kind of code to get FontFamily from System.Windows.Media.FontFamily:
Code: Select all
System.Windows.Media.FontFamily ff = new System.Windows.Media.FontFamily("Times New Roman");
List<String> listFamilyNames = new List<string>(ff.FamilyNames.Values);
WPFFont wpfFont = new WPFFont(listFamilyNames[0], 12);
LightningChart Support Team, TK