Create WPFFont from System.Windows.Media.FontFamily?

A forum dedicated to WPF version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
ShawnCG
Posts: 57
Joined: Tue Oct 15, 2013 8:31 pm

Create WPFFont from System.Windows.Media.FontFamily?

Post by ShawnCG » Mon Jan 06, 2014 8:10 pm

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.

ArctionTero
Posts: 42
Joined: Thu Mar 28, 2013 9:20 am

Re: Create WPFFont from System.Windows.Media.FontFamily?

Post by ArctionTero » Tue Jan 07, 2014 6:20 am

There is no such constructor for now.

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

Post Reply