How can I use a font not installed on the PC?
Posted: Fri Apr 30, 2021 11:46 am
Hello,
Is it possible to use a font for the axis title and labels, which is not installed on the computer but supplied with the application as .ttf file? It is included as a resource in a WPF application. In a resource dictionary I can use it without problems for TextBoxes in the application but the charts are not accepting it. Could you please tell me how I can use it?
I tried:
Dim font = New WpfFont(13)
font.Family = DirectCast(Application.Current.FindResource("MarvelFontFamily"), FontFamily)
yAxis.LabelsFont = font
or alternatively loading the font into a PrivateFontCollection and then using the Syste.Drawing.FontFamily:
font = New WpfFont(FontCollection.Families(0), 12, FontStyle.Regular)
but none of those resultated in a change of the labels font.
Is it possible to use a font for the axis title and labels, which is not installed on the computer but supplied with the application as .ttf file? It is included as a resource in a WPF application. In a resource dictionary I can use it without problems for TextBoxes in the application but the charts are not accepting it. Could you please tell me how I can use it?
I tried:
Dim font = New WpfFont(13)
font.Family = DirectCast(Application.Current.FindResource("MarvelFontFamily"), FontFamily)
yAxis.LabelsFont = font
or alternatively loading the font into a PrivateFontCollection and then using the Syste.Drawing.FontFamily:
font = New WpfFont(FontCollection.Families(0), 12, FontStyle.Regular)
but none of those resultated in a change of the labels font.