7

I am using OxyPlot in a WPF application to plot a simple LineSeries. I also defined Roboto as the standard font of my application. However my PlotView does not use this font but uses its default font Segoe UI.

The PlotModel offers a DefaultFont property to change this font. This property does not accept a FontFamily but only a string. So if I try to modify the font by entering a FontFamily name which is installed on my system it works:

var model = new PlotModel
{
     DefaultFont = "Verdana"
};

If I try to do the same with Roboto it does not:

var model = new PlotModel
{
     DefaultFont = "./Resources/Roboto/#Roboto"
};

or

var model = new PlotModel
{
     DefaultFont = "/MyNamespace;component/Resources/Roboto/#Roboto"
};

What am I missing here? Is there maybe another way to accomplish this?

Note: This is my first question, please tell me what I can improve in the future.

Jonas Bürkel
  • 708
  • 5
  • 16
  • I am fairly new to the whole OxyPlot thema, but maybe you can define the Font into the `Window/UserControl.Resources`? Maybe then will PlotModel find the Font? – Vic Oct 14 '15 at 13:27
  • @Jonas did you manage to get this work? – karollo Dec 31 '18 at 10:18

0 Answers0